Migrate to the .NET 10 SDK - #244
Open
nojaf wants to merge 2 commits into
Open
Conversation
Move global.json to 10.0.100 and retarget every net6.0 project to net10.0: the fslex and fsyacc tools, the Expecto test projects and the example projects. The shipped FsLexYacc.targets and the NuGet template now point at build/fslex/net10.0 and build/fsyacc/net10.0, so consumers of the tools package need a .NET 10 runtime. Raise the FSharp.Core floor to 10.0.0. The older versions are no longer usable on this SDK: 4.6.2 and 4.7.2 make the compiler emit dynamic arithmetic instead of inlining, which fails at runtime with "Dynamic invocation of op_Subtraction is not supported" from Position.Column, and 6.0.0 breaks publish with NETSDK1152 because it ships duplicate FSharp.Core.xml content files. Bump the local tools. Paket had to move to 10.3.1 because 8.0.3 cannot parse the net10.0 framework identifier at all. Fantomas 8 no longer recognises fsharp_max_dot_get_expression_width and renamed the check command, and it reformats one call in Lexing.fs. Bump actions/setup-dotnet to v6; the other actions are already on their latest major.
build.fsx is now a Fun.Build script run through dotnet fsi, and OldFsYaccTests.fsx is a plain dotnet fsi script. FAKE compiles a script against the reference assemblies of the framework named in its "#r paket:" header, and a machine with only the .NET 10 SDK has no net6.0 targeting pack, so the build died before the first target ran. Its bundled Paket cannot parse net10.0 either, so no value of that header worked. Beyond that, FAKE has seen little maintenance lately. The FAKE targets become three pipelines: Build (the default), Release, which adds packaging, and Docs. ReleaseNotes.parse, AssemblyInfoFile, Shell.cleanDirs and Paket.pack are replaced by local equivalents. Release notes reach dotnet pack and paket pack through an explicit argument list rather than a command string, so the multi-line text survives without quoting. build.sh and build.cmd invoke dotnet fsi, and pipelines are selected with -p instead of -t. Ignore the signature files fslex has emitted since 11.2.0. Every generated .fs was ignored but none of its .fsi siblings were, and fantomas checks src/, so a leftover signature file failed CheckFormat on the second consecutive build. repro1885.fs is generated too and was tracked by mistake; nothing compiles it, and the committed copy still held an absolute path from whoever last ran the suite.
Contributor
|
IMO 10 makes the most sense - 8 and 9 are going out of support in a few months. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move
global.jsonto 10.0.100 and retarget everynet6.0project tonet10.0: the fslex and fsyacc tools, the Expecto test projects and the example projects. The shippedFsLexYacc.targetsand the NuGet template now point atbuild/fslex/net10.0andbuild/fsyacc/net10.0, so consumers of the tools package need a .NET 10 runtime.FSharp.Core 10 — is this reasonable?
@dsyme @T-Gro @baronfel — I'd like a sanity check on one part of this before merging.
This raises the
FSharp.Corefloor forFsLexYacc.Runtimefrom>= 4.6.2to>= 10.1.400. That is a big jump for a package that a lot of people take a transitive dependency on, so I don't want to do it quietly.My reasoning is that the older versions are no longer usable on the .NET 10 SDK, not merely old:
Dynamic invocation of op_Subtraction is not supported, thrown fromPosition.ColumninLexing.fs— which is a plainint - int.dotnet publishwithNETSDK1152, because the package shipsFSharp.Core.xmlunder bothnetstandard2.0andnetstandard2.1content files and the SDK now rejects the collision.So the floor has to move; the question is how far. I went to 10 because that is what the compiler repo itself ships and consumes (
FSharpCoreShippedPackageVersionValueis10.0.101ineng/Versions.props), and picking an intermediate version looked like it would just defer the same conversation.I think this is fine, but it's a one-way door for anyone still on an older FSharp.Core, so I'd rather ask than assume. If you'd prefer a lower floor that still works, I'm happy to change it.
Everything else
net10.0framework identifier at all. Fantomas is on the latest 8.0.0 alpha; it no longer recognisesfsharp_max_dot_get_expression_width, renamed the check command, and reformats one call inLexing.fs.build.fsxis now a Fun.Build script run withdotnet fsi, andtests/fsyacc/OldFsYaccTests.fsxis a plaindotnet fsiscript. Beyond FAKE being fairly quiet these days, it was an active blocker here: FAKE compiles its scripts against the reference assemblies of the framework in the#r "paket:"header, and a runner with only the .NET 10 SDK has nonet6.0targeting pack, so the build died before the first target ran. FAKE's bundled Paket cannot parsenet10.0either, so there was no version of that header that worked.build.shandbuild.cmdnow invokedotnet fsi build.fsx; pipelines are selected with-p(-p Release,-p Docs) instead of FAKE's-t.actions/setup-dotnetbumped to v6; the other actions are already on their latest major.