Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update .NET SDK to Preview 2 #8624

Merged
merged 8 commits into from
Mar 29, 2022
Merged

Update .NET SDK to Preview 2 #8624

merged 8 commits into from
Mar 29, 2022

Conversation

mmitche
Copy link
Member

@mmitche mmitche commented Mar 16, 2022

To double check:

@mmitche
Copy link
Member Author

mmitche commented Mar 16, 2022

@carlossanlop @hoyosjs Does that core dump when running p2 on ubuntu-latest look familiar at all?

Welcome to .NET 7.0!
---------------------
SDK Version: 7.0.100-preview.2.22153.17

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
Cannot get required symbol SSL_set_alpn_protos from libssl
/__w/1/s/eng/common/tools.sh: line 474:   488 Aborted                 (core dumped) "$_InitializeBuildTool" "$@"
Build failed with exit code 134. Check errors above.
Killing running build processes...

@hoyosjs
Copy link
Member

hoyosjs commented Mar 16, 2022

Not really. Also @bartonjs, given the missing libssl symbol... It's 20.04 with OpenSSL 1.1.1f, which I expect to have said symbols...

@hoyosjs
Copy link
Member

hoyosjs commented Mar 16, 2022

I also can't repro with openssl 1.1.1f-1ubuntu2.12 amd64 on 20.04:

root@5c2c8e61a500:/# readelf --dyn-syms /lib/x86_64-linux-gnu/libssl.so.1.1 | grep SSL_set_alpn_protos
   907: 000000000003a100   147 FUNC    GLOBAL DEFAULT   15 SSL_set_alpn_protos@@OPENSSL_1_1_0

That missing method would definitely cause that... but seems like a custom build of libssl in the agent? Is there a way to get a hold of the image?

@mmitche
Copy link
Member Author

mmitche commented Mar 16, 2022

I also can't repro with openssl 1.1.1f-1ubuntu2.12 amd64 on 20.04:

root@5c2c8e61a500:/# readelf --dyn-syms /lib/x86_64-linux-gnu/libssl.so.1.1 | grep SSL_set_alpn_protos
   907: 000000000003a100   147 FUNC    GLOBAL DEFAULT   15 SSL_set_alpn_protos@@OPENSSL_1_1_0

That missing method would definitely cause that... but seems like a custom build of libssl in the agent? Is there a way to get a hold of the image?

Interesting. @MattGal @dotnet/dnceng, I know we had a set of images created that mirror the hosted pool images. Is there one for ubuntu-latest or whatever that maps too?

@MattGal
Copy link
Member

MattGal commented Mar 16, 2022

I also can't repro with openssl 1.1.1f-1ubuntu2.12 amd64 on 20.04:

root@5c2c8e61a500:/# readelf --dyn-syms /lib/x86_64-linux-gnu/libssl.so.1.1 | grep SSL_set_alpn_protos
   907: 000000000003a100   147 FUNC    GLOBAL DEFAULT   15 SSL_set_alpn_protos@@OPENSSL_1_1_0

That missing method would definitely cause that... but seems like a custom build of libssl in the agent? Is there a way to get a hold of the image?

Interesting. @MattGal @dotnet/dnceng, I know we had a set of images created that mirror the hosted pool images. Is there one for ubuntu-latest or whatever that maps too?

I didn't make a "latest" tag though that's possible if we think it's really valuable. You can see them at the bottom of https://helix.dot.net/. 20.04 is currently the same as latest per https://github.com/actions/virtual-environments.

You want 1es-ubuntu-2004-open for the public project, and 1es-ubuntu-2004 for internal. Ping me if you hit any trouble; we've already got a fair bit of builds moved over here.

@am11
Copy link
Member

am11 commented Mar 21, 2022

We are using Ubuntu 14:

image

which is out of support in .NET 6: https://github.com/dotnet/core/blob/main/release-notes/6.0/supported-os.md#linux

I think we should be using 18.04 or 20.04, to match runtime pipelines?

@MattGal
Copy link
Member

MattGal commented Mar 21, 2022

I think we should be using 18.04 or 20.04, to match runtime pipelines?

Ideally yes, but note that the docker image you build inside is independent of the build agent... that is, if you have some valid reason to be using Ubuntu 14.04 (I'm interested in knowing it) you can update the agent and keep using the ancient container as long as you like. Barring a good reason, you should be updating to at least a "Pro" supported 16.04 or 18.04 as soon as reasonably possible though.

@am11
Copy link
Member

am11 commented Mar 21, 2022

If the build is failing inside Ubuntu 14, that will explain the reason of missing symbol. See this workaround for Ubuntu 14: https://gist.github.com/am11/11b8f526747c5ad12c9a74e7765e14a4#file-dockerfile-L12. We already deleted trusty setup in #7694, just need to update container references in pipelines to use something more recent (i.e. one of the supported version of Ubuntu).

@mmitche
Copy link
Member Author

mmitche commented Mar 21, 2022

The SDK itself no longer supports 14.04, so running inside the 14.04 container wouldn't necessarily be expected to work. I've updated to the cotnainer the runtime uses for linux x64

@hoyosjs
Copy link
Member

hoyosjs commented Mar 21, 2022

Actually - we should just update. Arcade has no native deps and it's using ubuntu-14.04-cross-0cd4667-20170319080304 (I somehow managed to overlook it was containerized). That's a cross-build image and it's not needed here.

@mmitche
Copy link
Member Author

mmitche commented Mar 22, 2022

@MattGal This looks a bit puzzling. It's looking for aspnetcore but using the version of the core runtime. I think this is because this line https://github.com/dotnet/arcade/pull/8624/files#diff-8ab8c282f3d9822870eee0d25497d5ed8a335820fe03b6194b2dce937e1ca321L9 has an empty NetCoreSdkVersion property.

Does this look familiar or should I dig further?

@MattGal
Copy link
Member

MattGal commented Mar 22, 2022

@MattGal This looks a bit puzzling. It's looking for aspnetcore but using the version of the core runtime. I think this is because this line https://github.com/dotnet/arcade/pull/8624/files#diff-8ab8c282f3d9822870eee0d25497d5ed8a335820fe03b6194b2dce937e1ca321L9 has an empty NetCoreSdkVersion property.

Does this look familiar or should I dig further?

Not instantly familiar but I'm taking a peek

@@ -2,7 +2,7 @@
<PropertyGroup>
<IncludeDotNetCli Condition=" '$(IncludeDotNetCli)' != 'true' ">false</IncludeDotNetCli>
<!-- TODO (https://github.com/dotnet/arcade/issues/7787): When bumping this, we should do #7787 -->
<AspNetCoreRuntimeVersion>6.0.0</AspNetCoreRuntimeVersion>
<AspNetCoreRuntimeVersion>7.0.0-preview.2.22153.2</AspNetCoreRuntimeVersion>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't meant to be a preview / unstable version, rather it's what Xharness expects. I don't think you should rev the version here until 7.0.0 is GA

@@ -4,7 +4,7 @@
<IncludeDotNetCli>true</IncludeDotNetCli>
<IncludeXHarnessCli>true</IncludeXHarnessCli>
<XHarnessTargetFramework Condition=" '$(XHarnessTargetFramework)' == '' ">net6.0</XHarnessTargetFramework>
<DotNetCliVersion Condition=" '$(DotNetCliVersion)' == '' ">6.0.100</DotNetCliVersion>
<DotNetCliVersion Condition=" '$(DotNetCliVersion)' == '' ">7.0.100-preview.2.22153.17</DotNetCliVersion>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here... this is specific to Xharness, it doesn't need to be on the preview bleeding edge.

@MattGal
Copy link
Member

MattGal commented Mar 22, 2022

@mmitche I think you should just revert the lines from the Xharness Helix SDK, and that what you're going for (assuming that build # is correct) will be brought in when #8336 is done.

@mmitche
Copy link
Member Author

mmitche commented Mar 23, 2022

@MattGal No dice on reverting the xharness SDK (either both DotNetCli.props and XHarnessRunner.targets or only XHarnessRunner.targets.

It appears that the SDK knows the runtime tied to the SDK in the global.json, and that's ending up as DotNetCliVersion.

@tkapin
Copy link
Member

tkapin commented Mar 23, 2022

/cc @premun to make sure you are aware of this once you are back

@MattGal
Copy link
Member

MattGal commented Mar 23, 2022

@MattGal No dice on reverting the xharness SDK (either both DotNetCli.props and XHarnessRunner.targets or only XHarnessRunner.targets.

It appears that the SDK knows the runtime tied to the SDK in the global.json, and that's ending up as DotNetCliVersion.

Rats, I thought we honored the version in the .targets. It might just be that you need the other work coming in from @chcosta , but I defer to @premun for the XHarness Xpertise

@premun
Copy link
Member

premun commented Mar 28, 2022

XHarness flows are in no way special really. They just utilize the IncludeDotNetCli property like any client can do. The only way it is special is probably that it wants aspnetcore-runtime and no other flows really want that flavour so it is actually catching an edge case where the versions of the runtime do not really match with what's coming from global.json.

There should also be some unit test somewhere testing that the aspnetcore-runtime is fine (#7227). You can also check how we were doing these bumps before:
9fc83fb

We can also use the full SDK with XHarness and things will work as well (seems to be hinted in #7787). We can try taking this:
https://github.com/dotnet/arcade/blob/main/src/Microsoft.DotNet.Helix/Sdk/tools/xharness-runner/XHarnessRunner.targets#L2-L10
and reducing it to this:

  <PropertyGroup Condition=" '$(IncludeXHarnessCli)' == 'true' ">
    <IncludeDotNetCli>true</IncludeDotNetCli>
    <XHarnessTargetFramework Condition=" '$(XHarnessTargetFramework)' == '' ">net6.0</XHarnessTargetFramework>
    <DotNetCliVersion Condition=" '$(DotNetCliVersion)' == '' ">6.0.100</DotNetCliVersion>
    <DotNetCliPackageType Condition=" '$(DotNetCliPackageType)' != 'sdk' ">sdk</DotNetCliPackageType>
  </PropertyGroup>

We can then bump DotNetCliVersion once XHarness consumes this and is built with .NET 7 preview 1. However, if we could get this version from global.json, we can get rid of this need for manual bumps. I know it's available in some MSBuild property somewhere.

…unner.targets

Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
@mmitche
Copy link
Member Author

mmitche commented Mar 29, 2022

@premun No dice :/

@premun
Copy link
Member

premun commented Mar 29, 2022

Unable to find dotnet cli sdk version 7.0.0-preview.2.22152.2 from any of the specified feeds.

Where does that number come from?

@mmitche
Copy link
Member Author

mmitche commented Mar 29, 2022

Unable to find dotnet cli sdk version 7.0.0-preview.2.22152.2 from any of the specified feeds.

Where does that number come from?

That's the dotnet runtime that is within the SDK specified in global.json

@premun
Copy link
Member

premun commented Mar 29, 2022

image

Is this it?

I think this boils down again to our FindDotNetVersion target (or how it's called) that is getting the info from some json somewhere and it is why we needed to type down this ASP.NET Core runtime version in the first place. I remember a discussion here: #7022

@premun
Copy link
Member

premun commented Mar 29, 2022

That's the dotnet runtime that is within the SDK specified in global.json

Why does it want the runtime version when we specify SDK?

@mmitche
Copy link
Member Author

mmitche commented Mar 29, 2022

@premun DotNetCliVersion is set here. I think maybe the right thing to do is to set it explicitly with 6.0.100, regardless of whethe it's already set.

@premun
Copy link
Member

premun commented Mar 29, 2022

@premun DotNetCliVersion is set here. I think maybe the right thing to do is to set it explicitly with 6.0.100, regardless of whethe it's already set.

@mmitche I am afraid your last solution won't work once XHarness consumes newest Arcade, it will be built with .NET 7 and start requiring .NET 7 runtime/sdk to be run

@mmitche
Copy link
Member Author

mmitche commented Mar 29, 2022

That's the dotnet runtime that is within the SDK specified in global.json

Why does it want the runtime version when we specify SDK?

In DotNetCli.props:

<DotNetCliPackageType Condition=" '$(DotNetCliPackageType)' == '' ">runtime</DotNetCliPackageType>
    <DotNetCliVersion Condition=" '$(DotNetCliVersion)' == '' AND '$(DotNetCliPackageType)' == 'runtime' ">$(BundledNETCoreAppPackageVersion)</DotNetCliVersion>
    <!-- TODO (https://github.com/dotnet/arcade/issues/7022): We are hardcoding this version to use the one tied to the SDK version from global.json -->
    <DotNetCliVersion Condition=" '$(DotNetCliVersion)' == '' AND '$(DotNetCliPackageType)' == 'aspnetcore-runtime' ">$(AspNetCoreRuntimeVersion)</DotNetCliVersion>
    <DotNetCliVersion Condition=" '$(DotNetCliVersion)' == '' AND '$(DotNetCliPackageType)' == 'sdk' ">$(NETCoreSdkVersion)</DotNetCliVersion>
    <DotNetCliChannel Condition=" '$(DotNetCliChannel)' == '' ">Current</DotNetCliChannel>

@mmitche
Copy link
Member Author

mmitche commented Mar 29, 2022

@premun DotNetCliVersion is set here. I think maybe the right thing to do is to set it explicitly with 6.0.100, regardless of whethe it's already set.

@mmitche I am afraid your last solution won't work once XHarness consumes newest Arcade, it will be built with .NET 7 and start requiring .NET 7 runtime/sdk to be run

When is this slated to happen? Maybe we just wait till that flows into here and then we update?

@premun
Copy link
Member

premun commented Mar 29, 2022

@mmitche I am afraid your last solution won't work once XHarness consumes newest Arcade, it will be built with .NET 7 and start requiring .NET 7 runtime/sdk to be run

When is this slated to happen? Maybe we just wait till that flows into here and then we update?

We can totally do it in sync, this is not a big deal at all. I am more worried about the non-XHarness usages of Helix SDK which will probably still suffer from this behaviour when trying to install the SDK because something is probably broken there?

Feel free to merge this, I can do the XHarness bump tomorrow and bump it here as well.

@mmitche mmitche enabled auto-merge (squash) March 29, 2022 17:37
@mmitche
Copy link
Member Author

mmitche commented Mar 29, 2022

k just waiting for review then.

@mmitche mmitche merged commit cfdac35 into dotnet:main Mar 29, 2022
@riarenas
Copy link
Member

@mmitche fyi that this is stuck in arcade-validation: dotnet/arcade-validation#3022

I'm going to try and .net 7 all the things there real quick and if it's not straightforward I'll have FR take a look

@riarenas
Copy link
Member

It's unblocked now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants