-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
force roll forward when discovered .NET version is greater than FSAC TFM #1889
Conversation
src/Core/LanguageService.fs
Outdated
let shouldApplyImplicitRollForward = | ||
not (hasUserFxVersion || hasUserRollForward) | ||
&& sdkTfm <> fsacTfm // if the SDK doesn't match one of our FSAC TFMs, then we're in compat mode |
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.
core of the change is here - if the derived 'default' TFM of the SDK in use is not the TFM of the version of FSAC that we just chose (e.g. net8.0 on a 8.0.100-preview SDK with a net7.0 TFM FSAC binary), then we must apply rollforward flags to force the runtime to choose 8.0 bits. otherwise on a system with 7.0 bits installed we'll use those.
src/Core/LanguageService.fs
Outdated
[ if shouldApplyImplicitRollForward then | ||
"DOTNET_ROLL_FORWARD", box "LatestMajor" |
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.
pertinent change 1
src/Core/LanguageService.fs
Outdated
match sdkVersion.prerelease with | ||
| null -> () | ||
| pres when pres.Count > 0 -> | ||
"DOTNET_ROLL_FORWARD_TO_PRERELEASE", box "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.
if the sdk in use is a preview we must apply another flag to let the runtime float forward to those previews
WHAT
🤖 Generated by Copilot at e108e17
This pull request enhances the compatibility and reliability of the F# language service by improving the fsautocomplete.dll launching logic. It uses the TFMs of the dotnet SDK and the fsautocomplete.dll to determine the best roll-forward policy and arguments. It also refactors and cleans up some code.
🤖 Generated by Copilot at e108e17
🛠️🚀🆕
WHY
When running against a .NET 8 SDK, we can use the net7.0 binaries, but we must roll forward to the more recent Runtime. This is because without this roll forward, if the system has 7.0 runtimes installed the .NET host will prefer using those binaries.
HOW
🤖 Generated by Copilot at e108e17
runtimeVersion
tosdkVersion
to better reflect its purpose (link)probePathForTFMs
to return TFM and path tofsautocomplete.dll
for each TFM (link)fsacPathForTfm
with type signature ofstring * string
(link)fsautocomplete.dll
path if it ends with ".dll" (link)discoverDotnetArgs
to simplify logic of finding SDK version, FSAC TFM and path, and roll-forward arguments and environment variables (link)fsautocomplete.dll
path inspawnNetCore
(link)