-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Move to 8.0 #71507
Move to 8.0 #71507
Conversation
# Picking the right TargetFramework | ||
Projects in our repository should include the following values in `<TargetFramework(s)>` based on the rules below: |
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.
This documentation is great, thanks!
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.
Glad you appreciate it. Really want to try and do this more as I do infra changes so people can better understand the rationale a few months from now.
...Compilers/CSharp/Test/CommandLine/Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests.csproj
Outdated
Show resolved
Hide resolved
@@ -2,16 +2,13 @@ | |||
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. --> | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
<PropertyGroup> | |||
<TargetFrameworks>net6.0;netcoreapp3.1;netstandard2.0</TargetFrameworks> | |||
<TargetFrameworks>$(NetPrevious);netstandard2.0</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.
I'm not sure why this had explicit references for net6.0 and netcoreapp3.1 since it appears this is effectively a source package?
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.
Agree. I'm not sure what the point of the multi-target here was other than maybe to get nullable warnings. But that didn't explain why two .NET TFMs.
...xternalAccess/OmniSharp.CSharp/Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.CSharp.csproj
Outdated
Show resolved
Hide resolved
eng/build.ps1
Outdated
@@ -399,12 +399,12 @@ function TestUsingRunTests() { | |||
$args += " --configuration $configuration" | |||
|
|||
if ($testCoreClr) { | |||
$args += " --tfm net6.0 --tfm net7.0 --tfm net8.0" | |||
$args += " --tfm net7.0 --tfm net8.0" |
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.
This is so so fragile. Save for the integration tests failing I would've missed that I needed to update the TFMS here.
I think this is a complication we don't really need anymore. The only real distinction we need in RunTests is framework or core. Probably going to simplify RunTests to only consider that.
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.
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.
Thanks for tackling that too!
<Otherwise> | ||
<PropertyGroup> | ||
<NetRoslynToolset>net8.0</NetRoslynToolset> | ||
<NetRoslynSourceBuild>net7.0;net8.0</NetRoslynSourceBuild> |
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.
Should this point to $(NetVSShared), or is it possible for those to be different?
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.
It's possible for them to be different. Consider ~6 months into the future where
- DevKit has moved to
net8.0
- Roslyn has a .NET 9 SDK preview
At that point $(NetVSShared)
will simply be net8.0
but $(NetRoslynSourceBuild)
will be net8.0;net9.0
...xternalAccess/OmniSharp.CSharp/Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.CSharp.csproj
Outdated
Show resolved
Hide resolved
- Source build: requires us to ship `$(NetCurrent)` and `$(NetPrevious)` in workspaces and below (presently `net8.0` and `net7.0` respectively) | ||
- Visual Studio: requires us to ship `net472` for base IDE components and `net6.0` for private runtime components. | ||
- .NET SDK: requires us to ship compilers on current servicing target framework (presently `net8.0`) | ||
- Source build: requires us to ship `$(NetCurrent)` and `$(NetPrevious)` in workspaces and below (presently `net9.0` and `net8.0` respectively) |
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.
- Source build: requires us to ship `$(NetCurrent)` and `$(NetPrevious)` in workspaces and below (presently `net9.0` and `net8.0` respectively) | |
- Source Build: requires us to ship workspaces and below on `$(NetCurrent)` and `$(NetPrevious)` (presently `net9.0` and `net8.0` respectively) |
Since the "workspaces and below" might have been what the parenthetical applied to.
|
||
1. `$(NetRoslynSourceBuild)`: code that needs to be part of source build. This property will change based on whether the code is building in a source build context or official builds. In official builds this will include the TFMs for `$(NetVSShared)` | ||
2. `$(NetVS)`: code that needs to execute on the private runtime of Visual Studio. | ||
3. `$(NetVSCode)`: code that needs to execute in DevKit host |
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.
3. `$(NetVSCode)`: code that needs to execute in DevKit host | |
3. `$(NetVSCode)`: code that needs to execute in the DevKit host |
4. `$(NetVSShared)`: code that needs to execute in both Visual Studio and VS Code but does not need to be source built. | ||
5. `$(NetRoslynToolset)`: packages that ship the Roslyn toolset. The compiler often builds against multiple target frameworks. This property controls which of those frameworks are shipped in the toolset packages. This value will potentially change in source builds. | ||
6. `$(NetRoslynAll)`: code, generally test utilities, that need to build for all .NET runtimes that we support. | ||
7. `$(NetRoslyn)`:code that needs to execute on .NET but does not have any specific product deployment requirements. For example utilities that are used by our infra, compiler unit tests, etc ... |
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.
7. `$(NetRoslyn)`:code that needs to execute on .NET but does not have any specific product deployment requirements. For example utilities that are used by our infra, compiler unit tests, etc ... | |
7. `$(NetRoslyn)`: code that needs to execute on .NET but does not have any specific product deployment requirements. For example utilities that are used by our infra, compiler unit tests, etc ... |
eng/build.ps1
Outdated
@@ -399,12 +399,12 @@ function TestUsingRunTests() { | |||
$args += " --configuration $configuration" | |||
|
|||
if ($testCoreClr) { | |||
$args += " --tfm net6.0 --tfm net7.0 --tfm net8.0" | |||
$args += " --tfm net7.0 --tfm net8.0" |
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.
Thanks for tackling that too!
// The compiler must emit binary serialization metadata entries even though it doesn't | ||
// actually do binary serialization. | ||
#pragma warning disable SYSLIB0050 |
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.
😨
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.
Yeah it's an interesting problem. The technology is being deprecated but compiler still has to emit and read it cause it will live forever in net472
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.
I'm also surprised the compiler needs to do special stuff for this.
@@ -4,7 +4,7 @@ | |||
<PropertyGroup> | |||
<OutputType>Exe</OutputType> | |||
<RootNamespace>Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator</RootNamespace> | |||
<TargetFrameworks>net7.0;net472</TargetFrameworks> | |||
<TargetFrameworks>$(NetRoslyn);net472</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.
This may be a place where we want a different version property here -- this is a tool that's consumed by the Code Index team, so any change to this requires a change on their side. I've verified with them they're good to take the update to 8.0 (they had already been deploying that as the newer runtime version in the last few weeks), but a change here at least means they should be notified about that.
<IsShipping>false</IsShipping> | ||
<LangVersion>11</LangVersion> | ||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly> | ||
<NoWarn>$(NoWarn);NETSDK1206</NoWarn> |
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.
Consider adding a comment here.
@@ -87,7 +87,7 @@ | |||
</Target> | |||
|
|||
<!-- | |||
Deploy a net472 and net6.0 version of the BuildHost process which will be used depending on the type of project. We will use the deployed version even if | |||
Deploy a net472 and $(NetVS) version of the BuildHost process which will be used depending on the type of project. We will use the deployed version even if |
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.
Is $(NetVS)
guaranteed to be in the set of $(NetRoslynSourceBuild)
?
<ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true'"> | ||
<_NetFrameworkBuildHostProjectReference Include="..\..\..\Workspaces\Core\MSBuild.BuildHost\Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.csproj"> | ||
<TargetFramework>net472</TargetFramework> | ||
<ContentFolderName>BuildHost-net472</ContentFolderName> | ||
</_NetFrameworkBuildHostProjectReference> | ||
<_NetFrameworkBuildHostProjectReference Include="..\..\..\Workspaces\Core\MSBuild.BuildHost\Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.csproj"> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<TargetFramework>$(NetVS)</TargetFramework> |
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.
Is $(NetVS)
guaranteed to be in the set of $(NetRoslynSourceBuild)
? And in this case we'd need the lowest version of all of them, or otherwise we could end up with say a 7.0 targeting app that consumes this as a 7.0 library, but the underlying build host is targeting 8.0 and things are broken if the user doesn't have 8.0 on their machine too.
(Longer term, this is probably a very special case where we could leave this as hard-coded since there's little code in this and it's almost entirely just shelling out to MSBuild, but there's a bit more work that needs to happen first.)
@jasonmalinowski really appreciate your feedback on this PR. The remaining items seem non-blocking by my reading. This is an unwieldy PR and is blocking @tmat. At this point my plan is to merge this PR as is then grab a follow up PR to clean up a few of your remaining comments. Please let me know if there is something you think is critical to get in initially. |
@jaredpar Go for it! My bad -- I meant to send you a message affirming nothing here was blocking and you can go for a merge...and I forgot. |
This updates our TFMS to recognize that .NET 8 has shipped and .NET 6 is no longer supported. At the same time I am trying to update our code base to be more driven off of `$(NetCurrent)` and `$(NetPrevious)`. This is important for source build and VMR work as these properties are often overriden to drive the larger build efforts. Hard coded .NET Core based TFMs interfere with that and cause friction for those teams.
Co-authored-by: Jason Malinowski <[email protected]>
The integration failures appear to all be known / part of the existing catastrophic failures we're seeing in other PRs. Everything else is green so merging. |
This updates our TFMS to recognize that .NET 8 has shipped and .NET 6 is no longer supported.
At the same time I am trying to update our code base to be more driven off of
$(NetCurrent)
and$(NetPrevious)
. This is important for source build and VMR work as these properties are often overriden to drive the larger build efforts. Hard coded .NET Core based TFMs interfere with that and cause friction for those teams.Note: this PR is being discussed in the following teams thread
Please begin the review by reading the changes to the
Target Framework Strategy.md
file as that largely outlines the change here.VS Validation Build
VS Test Insertion