-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Load solutions out-of-proc #70240
Load solutions out-of-proc #70240
Conversation
We had an option as a fallback in case of the out-of-proc build had bugs, but we haven't had any reports of bugs, so just removing it.
ebfbec7
to
c4b29ad
Compare
public Task<bool> IsProjectFileSupportedAsync(string projectFilePath, CancellationToken cancellationToken) | ||
public Task<bool> HasUsableMSBuildAsync(string projectOrSolutionFilePath, CancellationToken cancellationToken) | ||
{ | ||
return Task.FromResult(TryEnsureMSBuildLoaded(projectOrSolutionFilePath)); |
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.
It's still funky that HasUsableMSBuildAsync() implicitly triggers an actual load, but the hope is this goes away once we can reliably do all discovery in-proc.
var buildHost = await buildHostProcessManager.GetBuildHostAsync(BuildHostProcessManager.BuildHostProcessKind.NetCore, CancellationToken.None); | ||
|
||
// If we don't have a .NET Core SDK on this machine at all, try .NET Framework | ||
if (!await buildHost.HasUsableMSBuildAsync(solutionFilePath, CancellationToken.None)) |
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.
should this logic move into GetBuildHostAsync
, where the reverse fallback already lives? Would be nice if all the fallback logic was in one place
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.
Going to leave it since this will get refactored further in a week or two.
This brings a few benefits: 1. It's possible that the user might have an 8.0 SDK but only a 7.0 runtime installed; in that case, our language server will run with the 7.0 runtime, but will fail to find an MSBuild since the only one on the machine might be the 8.0 version which is not runnable. This ensures we can still function in that scenario. We'll also fall back to using a .NET Framework MSBuild if somehow that's all you have. 2. When we loaded an MSBuild, that sets environment variables, which might not be the same variables set if we're registering a different version in our child processes. But the environment variables might get inherited, which could result in surprises. Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1886993
c4b29ad
to
416c09a
Compare
This brings a few benefits:
In this PR I'm also removing the fallback flag to enable in-proc builds; we never needed it and no bugs got filed, so just removing it for good.
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1886993