-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Retarget to .NET 9 #10451
Retarget to .NET 9 #10451
Conversation
@@ -98,7 +91,6 @@ | |||
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.11.0-3.24378.3"> | |||
<Uri>https://github.com/dotnet/roslyn</Uri> | |||
<Sha>5e3a11e2e7f952da93f9d35bd63a2fa181c0608b</Sha> | |||
<SourceBuild RepoName="roslyn" ManagedOnly="true" /> |
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.
Why was this removed?
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.
After new arkade sdk was consumed, the source build was failing on this one, with errors: https://dev.azure.com/dnceng-public/public/_build/results?buildId=762782&view=logs&j=c316b76e-5b95-5e79-2740-62e92f13eebd&t=e33df8ad-5872-5105-0672-039423de0ed3 Only place elements on source-build intermediate nupkgs.
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.
The correct fix is to add the corresponding soucebuild intermediate dependency (ideally right after this dependency)
<Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.11.0-3.24378.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>5e3a11e2e7f952da93f9d35bd63a2fa181c0608b</Sha>
<SourceBuild RepoName="roslyn" ManagedOnly="true" />
</Dependency>
Then delete the change to https://github.com/dotnet/msbuild/pull/10451/files#diff-f88ce4026366ce74fb1a981785c542757617abf4393a33ca34465a5e9a0dd343
global.json
Outdated
"vs": { | ||
"version": "17.8.0" | ||
}, | ||
"xcopy-msbuild": "17.8.5" | ||
}, | ||
"msbuild-sdks": { | ||
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24376.1" | ||
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24379.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.
Have we confirmed with dnceng that this is what they want for our LTS branch?
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.
Filed the issue: https://github.com/dotnet/dnceng/issues/3713
[Fact] | ||
public void TryConvertToLongGivenDoubleWithLongMaxValue() | ||
[WindowsFullFrameworkOnlyFact] | ||
public void TryConvertToLongGivenDoubleWithLongMaxValueFramework() |
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 don't think I understand this test change. Can you elaborate on the reasoning?
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.
The test previously introduced here 0f6ed65
Testing different behaviour on different archtitecture.
However after moving to .net 9 the precision is not lost hence we are receveing the expected outcome of what was written:
result.ShouldBeTrue();
actual.ShouldBe(longMaxValue);
This is true only for .NET 9 target, and the Framework left as it is.
fs.ReadExactly(keyBytes, 0, fileLength); | ||
#else | ||
#pragma warning disable CA2022 // Avoid inexact read with 'Stream.Read' | ||
// TODO: Read the count of read bytes and check if it matches the expected length, if not raise an exception | ||
fs.Read(keyBytes, 0, fileLength); |
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'd still prefer a polyfill here so the source can just unconditionally say ReadExactly
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.
Let's track that than. It feels that it'd be outside of scope of retargetting change.
<!-- For ease of logging the "not supported on Core" message, these tasks are a | ||
TaskRequiresFramework on netstandard/netcore. Since the type is sealed there, | ||
that shouldn't cause any implementation problems since no one can derive | ||
from it and try to call TaskExtension.Log. --> |
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.
Please preserve the comments where the suppressions aren't removed.
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.
Excluding the changes in eng folder (I haven't reviewed those) and the commented stuff it looks OK (great job!).
The VS insertion looks OK as well (both tests failures are expected and known, and this change even brings some nice perf improvements - 👏).
The only thing missing for me for signoff (appart from commented stuff) is a list of manual changes to eng folder that has been done beyond arcade consuming (if any beyond already described and #10451 (comment))
dotnet_diagnostic.IDE0100.severity = suggestion | ||
|
||
# File header should match the template, making it error since couple of files met in the code base without any header | ||
dotnet_diagnostic.IDE0073.severity = error |
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.
❤️
if (data.Mode.HasValue) | ||
{ | ||
_env.SetEnvironmentVariable("MSBUILD_SDKREFERENCE_PROPERTY_EXPANSION_MODE", data.Mode.ToString()); | ||
} | ||
else | ||
{ | ||
_env.SetEnvironmentVariable("MSBUILD_SDKREFERENCE_PROPERTY_EXPANSION_MODE", null); | ||
} | ||
|
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.
Can nullcheck operator be used here?
if (data.Mode.HasValue) | |
{ | |
_env.SetEnvironmentVariable("MSBUILD_SDKREFERENCE_PROPERTY_EXPANSION_MODE", data.Mode.ToString()); | |
} | |
else | |
{ | |
_env.SetEnvironmentVariable("MSBUILD_SDKREFERENCE_PROPERTY_EXPANSION_MODE", null); | |
} | |
_env.SetEnvironmentVariable("MSBUILD_SDKREFERENCE_PROPERTY_EXPANSION_MODE", data.Mode.?ToString()); | |
<Left>ref/net8.0/Microsoft.Build.dll</Left> | ||
<Right>ref/net8.0/Microsoft.Build.dll</Right> | ||
<IsBaselineSuppression>true</IsBaselineSuppression> | ||
<DiagnosticId>PKV006</DiagnosticId> |
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 might deserve a comment
fs.ReadExactly(keyBytes, 0, fileLength); | ||
#else | ||
#pragma warning disable CA2022 // Avoid inexact read with 'Stream.Read' | ||
// TODO: Read the count of read bytes and check if it matches the expected length, if not raise an exception | ||
fs.Read(keyBytes, 0, fileLength); |
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.
Let's track that than. It feels that it'd be outside of scope of retargetting change.
You can't skip |
Closing this PR with respect to the new PR with more clear history and less changes: #10484 |
Fixes #10280
Context
.NET 9 is in preview 6.
Consuming the latest Arcade + retargeting the the msbuild core version to .net 9.
Changes Made
darc update-dependencies --channel ".NET Eng - Latest" --name "Microsoft.DotNet.Arcade.Sdk"
dotnet pack /p:GenerateCompatibilitySuppressionFile=true
null
valueTesting