-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Update to net8.0 SDK #45879
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 to net8.0 SDK #45879
Conversation
Blocked on getting an SDK from dotnet/installer#15151 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks good (once you've got the installer available).
@@ -1,6 +1,6 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
<PropertyGroup> | |||
<TargetFrameworks>net7.0</TargetFrameworks> | |||
<TargetFrameworks>$(DefaultNetCoreTargetFramework)</TargetFrameworks> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes here cannot work until we have an 8.0.0 SDK containing net8.0
bits. The basic idea is RepoTasks
and GenerateFiles
aren't part of the product. They're instead used in msbuild
(or dotnet msbuild
) and to generate the extra Directory.Build.props, Directory.Build.targets, and dotnet-tools.json files used in almost every other project in the repo.
Why did this file and RepoTasks.tasks need to change in the first place❔ Note GenerateFiles
still targets net5.0
and (other than the deprecated TFM warning we're suppressing somewhere) that's fine.
See for example
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that's why this is blocked on dotnet/installer#15151 as I mentioned above. It needs to change because SourceBuild breaks if it doesn't target the latest TFM (though I don't know why the same isn't true for GenerateFiles
) - dotnet/installer#15151 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a new one, will look tomorrow:
|
@JamesNK can we just disable trimming for |
What do you mean by disable trimming? Our projects are annotated to help trimming succeed, but that's it. Trimming happens when publishing an app. Who is publishing? |
I think our Helix tests publish. Not sure if they would be impacted by this. |
This error happens very early on, during framework reference resolution. Presumably the SDK is doing some scanning that sees we have |
@sbomer looks like this was caused by dotnet/sdk#29441 - is it intentional that we get these errors for netstandard2.1 projects that enable trimming? |
@wtgodbe Is it definitely the case that @vitek-karas is this considered a supported scenario? If so, we might need to add a |
They set Line 10 in 5b43ed1
|
Setting <Target Name="_FixKnownILLinkPack"
BeforeTargets="ProcessFrameworkReferences">
<ItemGroup>
<KnownILLinkPack Include="@(KnownILLinkPack)"
Condition="'%(TargetFramework)' == 'net7.0'"
TargetFramework="netstandard2.1"
ILLinkPackVersion="%(KnownILLinkPack.ILLinkPackVersion)" />
</ItemGroup>
</Target> This should keep it working as before (by adding a |
I'm suggesting keeping |
No, I think it will hit the same error because some of the logic for |
…105.3 Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Helix.Sdk From Version 8.0.0-beta.22630.1 -> To Version 8.0.0-beta.23055.3
}, | ||
"tools": { | ||
"dotnet": "8.0.100-alpha.1.22531.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of the new SDK, I believe we will need to update the CI pipeline to use the binlogtosln
that supports v15
(dotnet/arcade#11995), if it is not updated yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just merged that PR into this one
Remaining errors are all:
@sbomer are you aware of any other recent linker changes that might have caused this to start happening? |
The same change dotnet/sdk#29441 removes ILLink as a bundled SDK - it now needs to be downloaded based on the TFM - but it looks like aspnetcore was relying on it being present in the SDK layout. I think someone from aspnetcore needs to look into this. Probably https://github.com/dotnet/aspnetcore/blob/main/src/Tools/LinkabilityChecker/LinkabilityChecker.csproj needs to set some properties to tell the SDK to download ILLink - I think it would suffice to add |
Removing ILLink sounds like a regression, especially if the SDK doesn't treat references to the SDK in the same way it does missing targeting packs. What's the mid-term story here❔ |
@dougbu It sounds like ILLink isn't in the SDK by default, but it is automatically downloaded when All we need to do is add @sbomer Correct me if I'm wrong here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. If you want to avoid this for .NET 9 and onwards, consider setting DisableImplicitFrameworkReferences
to true in RepoTasks.csproj as presumably that project doesn't need the framework references and the underlying targeting pack.
Thanks, testing that out pre-SDK update here: #45971 |
Don't think that'll work since our RepoTasks do use stuff from runtime. We can probably just apply the FrameworkReference workaround we give to non-Tools projects to RepoTasks to fix this going forward. |
I don't think we need to fix this right now and would instead love to see this go in. Should we file an issue to track the follow-up work? |
Just some additional context - the main reason we made the change is for versioning. We need to download a linker that matches the TFM, and it would bloat the SDK if we bundled a version of the linker for each supported TFM. |
Hi @sbomer. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
@wtgodbe this change broke official builds. See https://dev.azure.com/dnceng/internal/_build/results?buildId=2083576&view=results for example. Please immediately either revert this change or update the |
I see, this did bring in the new |
Never mind, can't remove that because it's used directly before we get to eng/common. Opened #45982 to just update it |
- 8.0.100-alpha.1.23055.1 -> 8.0.100-alpha.1.23059.8 - not a big jump because dotnet#45879 went in just this morning - that PR was relatively up to date
* Move to latest .NET SDK - 8.0.100-alpha.1.23055.1 -> 8.0.100-alpha.1.23059.8 - not a big jump because #45879 went in just this morning - that PR was relatively up to date * Hopefully fix analyzer warning Co-authored-by: Steve Sanderson <[email protected]>
No description provided.