Repository navigation
fix(#r "paket:"): honour the rollForward of the tool manifest - #4500
Merged
Merged
Conversation
…aket:" `dotnet tool run` runs a local tool with --roll-forward Major when its manifest says "rollForward": true, as `dotnet tool install --allow-roll-forward` writes it. #r "paket:" ran the paket.dll as its runtimeconfig.json and DOTNET_ROLL_FORWARD said, so it could fail where `dotnet paket` worked: the Paket .NET tools roll forward with their rollForwardOnNoCandidateFx, unless DOTNET_ROLL_FORWARD is Minor, LatestMinor, LatestPatch or Disable. With LatestMajor, it ran on the latest major version rather than on the one of the tool. The manifest gives the paket tool, with its version and its rollForward, matched with its case as dotnet reads it, from the first "paket" object that has a version. The paket.dll of the local tool is paired with that rollForward in one place. The most recent Paket .NET tool restored, which runs when the local tool isn't restored, runs without it: it is another version.
With --roll-forward Major, which the host takes over DOTNET_ROLL_FORWARD and the runtimeconfig.json, the local tool also runs on a later major version of .NET. The pick of dotnet didn't know it: with DOTNET_ROLL_FORWARD=Minor, a dotnet with only a later major version was taken as unable to run paket, and passed over. withRollForward takes --roll-forward Major as a DOTNET_ROLL_FORWARD of Major, and findDotnet moves into Internals.Logic, with DOTNET_ROLL_FORWARD as a parameter, so that a test checks the dotnet it picks.
fpellet
force-pushed
the
fix/fsi-manifest-roll-forward
branch
from
November 22, 2026 17:37
08f5688 to
b843c73
Compare
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.
Follows #4499, on which it builds:
findDotnettakes thepaket.dllsince #4496, and this change makes it see the roll forward of the manifest.Problem
dotnet tool install --allow-roll-forward(SDK 8.0.300 and later) writes"rollForward": truefor the tool in the manifest.dotnet tool runthen runs it withdotnet --roll-forward Major <dll>, which the host takes overDOTNET_ROLL_FORWARDand theruntimeconfig.json: the tool runs on the major version it targets when thedotnethas it, and on a later one otherwise.#r "paket:"runs thepaket.dllof the local tool with adotnetit picks itself (#4496), and ignored that setting. Paket 12 already rolls forward with therollForwardOnNoCandidateFx: 2of itsruntimeconfig.json, so the difference shows whenDOTNET_ROLL_FORWARDsays otherwise: withMinor,LatestMinororLatestPatchand nodotnetwith .NET 10, or withDisableand none with .NET 10.0.0,#r "paket:"failed wheredotnet paketworked; withLatestMajor, it ran Paket on the latest version of thedotnetwheredotnet paketruns it on .NET 10.Change
paketOfToolManifestgives the paket tool of the manifest, with itsVersionand itsRollForward(ManifestPaket)."rollForward"is matched with its case, as the SDK reads it (TryGetBooleanValue, case-sensitive). The first"paket"object that has a version counts, so that a"paket"property of another tool doesn't hide the tool, as the single regex used before already ensured.toolResolverCacheor in the NuGet packages folders, runs withdotnet --roll-forward Major "<paket.dll>"(dotnetArguments), as theMuxerCommandSpecMakerof the SDK builds it.dotnetcounts it:withRollForwardletsrunsApptake a later major version whateverDOTNET_ROLL_FORWARDsays, and keepsDOTNET_ROLL_FORWARD, then theruntimeconfig.json, without it.dotnet tool runwould fail there.Docs: a release note, and a few sentences in
fsi-integration.md.Commits:
rollForwardof the manifest:ManifestPaket,dotnetArguments, therollForwardcarried byPaketDllthroughchoosePaket, their tests, the doc and the release note;dotnetis picked:withRollForwardinfindDotnet, its test, and the end of the first sentence of the release note.Tests
tests/Paket.Tests/FsiExtension.fs:paketOfToolManifest: therollForwardof paket in a manifest asdotnet tool install --allow-roll-forwardwrites it,false,"RollForward"with another case, therollForwardof another tool, and a"paket"property of another tool;withRollForward:--roll-forward MajorbeforeDOTNET_ROLL_FORWARD, and without itDOTNET_ROLL_FORWARD, then the roll forward of theruntimeconfig.json;dotnetArguments:--roll-forward Majorbefore thepaket.dll;choosePaket: therollForwardof the local tool is passed on.Checked by hand on Linux, with SDK 10.0.404 and runtime 10.0.15 only,
dotnet fsi --compilertool:pointing at the built extension, and a manifest written bydotnet tool install paket --version 12.0.0-alpha003 --allow-roll-forwardwith its ownDOTNET_CLI_HOME::paket> using /usr/share/dotnet/dotnet --roll-forward Major "…/paket.dll", and the script gets its package;runtimeconfig.jsonof the restoredpaket.dllchanged to ask for 9.0.0 without roll forward, andDOTNET_ROLL_FORWARD=Minor: with"rollForward": truethe script runs, and withfalseit fails ("You must install or update .NET"), asdotnet paketdoes in both cases.Limits
rollForwardof the manifest (above)."rollForward": "true"ornull, with whichdotnet tool runfails, count asfalse; a duplicate key, or a commented-out"rollForward": true, count astrue.global.json,dotnet tool rundoesn't read therollForwardof the manifest, while#r "paket:"does.runsAppstill countsLatestPatchandDisableasMinor(fix(#r "paket:"): find dotnet to run the local tool #4496): withDOTNET_ROLL_FORWARD=Disableand norollForwardin the manifest, the firstdotnetwith a .NET 10 is taken even when it lacks 10.0.0.paket.dllof the local tool withdotnet, without therollForwardof the manifest.PaketHandler, which is internal, has no automated test.