Skip to content

Use .NET10p3 SDK #18471

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Use .NET10p3 SDK #18471

wants to merge 8 commits into from

Conversation

vzarytovskii
Copy link
Member

It's roughly this time of the year, when F# is switching to the new preview SDKs, to start testing BCL and CLR changes. Switching of the TFM usually happens around summer.

Copy link
Contributor

github-actions bot commented Apr 11, 2025

⚠️ Release notes required, but author opted out

Warning

Author opted out of release notes, check is disabled for this pull request.
cc @dotnet/fsharp-team-msft

@vzarytovskii vzarytovskii added the NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes label Apr 11, 2025
@vzarytovskii
Copy link
Member Author

vzarytovskii commented Apr 11, 2025

Hm, some source build (presumably) issues, I can fix them, please ping me next week.

@T-Gro
Copy link
Member

T-Gro commented Apr 28, 2025

@vzarytovskii : Ping, do you have an ideas what caused it?

@vzarytovskii
Copy link
Member Author

Judging by the plain builds working fine, some arcade shenanigans. I've updated on top of main, let me see what fails and how can I fix it.

@vzarytovskii
Copy link
Member Author

@ViktorHofer @baronfel getting a bunch of following by just upgrading SDK to 10p3:

D:\a\_work\1\s\tests\fsharp\FSharpSuite.Tests.fsproj : error NU1510: PackageReference System.Memory will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. [D:\a\_work\1\s\VisualFSharp.sln]
##[error]tests\fsharp\FSharpSuite.Tests.fsproj(0,0): error NU1510: (NETCORE_ENGINEERING_TELEMETRY=Restore) PackageReference System.Memory will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.
D:\a\_work\1\s\tests\fsharp\FSharpSuite.Tests.fsproj : error NU1510: PackageReference System.Reflection.Metadata will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. [D:\a\_work\1\s\VisualFSharp.sln]
##[error]tests\fsharp\FSharpSuite.Tests.fsproj(0,0): error NU1510: (NETCORE_ENGINEERING_TELEMETRY=Restore) PackageReference System.Reflection.Metadata will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.
  Restored D:\a\_work\1\s\tests\benchmarks\CompiledCodeBenchmarks\MicroPerf\MicroPerf.fsproj (in 541 ms).
  Restored D:\a\_work\1\s\tests\benchmarks\CompiledCodeBenchmarks\MicroPerf\CS\MicroPerfCSharp.csproj (in 2 ms).
D:\a\_work\1\s\tests\FSharp.Test.Utilities\FSharp.Test.Utilities.fsproj : error NU1510: PackageReference System.Collections.Immutable will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. [D:\a\_work\1\s\VisualFSharp.sln]
##[error]tests\FSharp.Test.Utilities\FSharp.Test.Utilities.fsproj(0,0): error NU1510: (NETCORE_ENGINEERING_TELEMETRY=Restore) PackageReference System.Collections.Immutable will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.
D:\a\_work\1\s\tests\FSharp.Test.Utilities\FSharp.Test.Utilities.fsproj : error NU1510: PackageReference System.Memory will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. [D:\a\_work\1\s\VisualFSharp.sln]
##[error]tests\FSharp.Test.Utilities\FSharp.Test.Utilities.fsproj(0,0): error NU1510: (NETCORE_ENGINEERING_TELEMETRY=Restore) PackageReference System.Memory will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.
D:\a\_work\1\s\tests\FSharp.Test.Utilities\FSharp.Test.Utilities.fsproj : error NU1510: PackageReference System.Buffers will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. [D:\a\_work\1\s\VisualFSharp.sln]
##[error]tests\FSharp.Test.Utilities\FSharp.Test.Utilities.fsproj(0,0): error NU1510: (NETCORE_ENGINEERING_TELEMETRY=Restore) PackageReference System.Buffers will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.
D:\a\_work\1\s\tests\FSharp.Test.Utilities\FSharp.Test.Utilities.fsproj : error NU1510: PackageReference System.Diagnostics.DiagnosticSource will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. [D:\a\_work\1\s\VisualFSharp.sln]

I haven't seen it before, does this ring a bell by any chance?

@ViktorHofer
Copy link
Member

Heyho. This is a new NuGet feature in the .NET 10 SDK. See https://learn.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#how-prunepackagereference-works for more details.

The gist is that the package references that are already provided by the shared frameworks used (usually Microsoft.NETCore.App) are unnecessary and should be removed. I.e. System.Text.Json is already provided inbox on .NETCoreApp TFMs.

@ViktorHofer
Copy link
Member

cc @nkolev92 @ericstj - looks like the warning is still creating confusion

@vzarytovskii
Copy link
Member Author

Heyho. This is a new NuGet feature in the .NET 10 SDK. See https://learn.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#how-prunepackagereference-works for more details.

The gist is that the package references that are already provided by the shared frameworks used (usually Microsoft.NETCore.App) are unnecessary and should be removed. I.e. System.Text.Json is already provided inbox on .NETCoreApp TFMs.

Thanks! Huh, good to know. How does it play together with netfx? If we build both core and desktop compilers? Or is it purely build-time feature (where to copy assemblies from?)?

@ViktorHofer
Copy link
Member

ViktorHofer commented Apr 28, 2025

If we build both core and desktop compilers? Or is it purely build-time feature (where to copy assemblies from?)?

For multi-targeting projects you want to condition PackageReference items on the TFMs that need them.

@vzarytovskii
Copy link
Member Author

If we build both core and desktop compilers? Or is it purely build-time feature (where to copy assemblies from?)?

For multi-targeting projects you want to condition PackageReference items on the TFMs that need them.

Thanks. Btw, when conditionally aded the S.C.Immutable, got the following:

  FSharp.Compiler.Service netstandard2.0 succeeded with 4 warning(s) (48.9s) → artifacts/bin/FSharp.Compiler.Service/Release/netstandard2.0/FSharp.Compiler.Service.dll
    /Users/u/code/fsharp3/src/Compiler/Utilities/Activity.fs(96,19): warning FS3261: Nullness warning: The types 'ActivityDisposable' and 'IDisposable | null' do not have compatible nullability.
    /Users/u/code/fsharp3/src/Compiler/Utilities/Activity.fs(103,59): warning FS3261: Nullness warning: The types 'ActivityDisposable' and 'IDisposable | null' do not have compatible nullability.
    /Users/u/code/fsharp3/src/Compiler/Utilities/Activity.fs(130,83): warning FS3261: Nullness warning: The types 'ActivityDisposable' and 'IDisposable | null' do not have compatible nullability.
    /Users/u/code/fsharp3/src/Compiler/Utilities/Cancellable.fs(187,85): warning FS3261: Nullness warning: The types 'IDisposable' and ''a MaybeNull' do not have compatible nullability.
  FSharp.Compiler.Service net9.0 succeeded with 4 warning(s) (51.1s) → artifacts/bin/FSharp.Compiler.Service/Release/net9.0/FSharp.Compiler.Service.dll
    /Users/u/code/fsharp3/src/Compiler/Utilities/Activity.fs(96,19): warning FS3261: Nullness warning: The types 'ActivityDisposable' and 'IDisposable | null' do not have compatible nullability.
    /Users/u/code/fsharp3/src/Compiler/Utilities/Activity.fs(103,59): warning FS3261: Nullness warning: The types 'ActivityDisposable' and 'IDisposable | null' do not have compatible nullability.
    /Users/u/code/fsharp3/src/Compiler/Utilities/Activity.fs(130,83): warning FS3261: Nullness warning: The types 'ActivityDisposable' and 'IDisposable | null' do not have compatible nullability.
    /Users/u/code/fsharp3/src/Compiler/Utilities/Cancellable.fs(187,85): warning FS3261: Nullness warning: The types 'IDisposable' and ''a MaybeNull' do not have compatible nullability.
  fsc net9.0 succeeded (1.3s) → artifacts/bin/fsc/Release/net9.0/fsc.dll
  fsi net9.0 succeeded (1.7s) → artifacts/bin/fsi/Release/net9.0/fsi.dll
  FSharp.Test.Utilities net9.0 failed with 1 error(s) (4.0s)
    FSC : error FS0078: Unable to find the file '/lib/netstandard2.0/System.Collections.Immutable.dll' in any of /Users/u/code/fsharp3/tests/FSharp.Test.Utilities

Had to ignore the warning.

@vzarytovskii vzarytovskii requested a review from a team as a code owner April 28, 2025 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes
Projects
Status: New
Development

Successfully merging this pull request may close these issues.

4 participants