Remove custom logic of fetching dotnet dir#26851
Merged
Merged
Conversation
marcpopMSFT
reviewed
Aug 2, 2022
| return dotnetRootPath; | ||
| // Get the dotnet directory, while ignoring custom msbuild resolvers | ||
| return Microsoft.DotNet.NativeWrapper.EnvironmentProvider.GetDotnetExeDirectory(key => | ||
| key.Equals("DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR", StringComparison.InvariantCultureIgnoreCase) |
Member
There was a problem hiding this comment.
I'm not 100% clear on why you want to ignore this environment variable here? Is it basically not supposed to be used when getting dotnet for the common options but should still be used in the EnvironmentProvider (hence the override)?
Member
Author
There was a problem hiding this comment.
Great question @marcpopMSFT! I had the exactly same one and I addressed it to you: #26837 (comment)
Can you please help identify proper owner in CLI and help find the answer?
de30783 to
7cb5cc6
Compare
a903560 to
4e20e35
Compare
Closed
3c22057 to
7a1ffd7
Compare
2b6b664 to
b99e5bb
Compare
Member
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Fixes #26837
Proposal of removing custom hardcoded logic of fetching dotnet dir location.
EnvironmentProvider.GetDotnetExeDirectory()now first checks the current process (thus handling the case of xcopy dotnet install) and environemnt after that.CommonOptions.GetCurrentRuntimeId()now do not have it's custom logic of locating the dotnet folder. It calls theEnvironmentProvider.GetDotnetExeDirectory(), but it doesn't intentionally recognize custom MSBuild resolver (defined viaDOTNET_MSBUILD_SDK_RESOLVER_CLI_DIRenv var) - so that it's in line with previous logicSince this is not code I own/maintain, I'd appreciate any insight if there are opposing ideas. Specifically:
EnvironmentProvider.GetDotnetExeDirectory()?tagging @sfoslund here as the original author
CommonOptions.GetCurrentRuntimeId()fine ignoring the custom MSBuild resolver (as it was before)?tagging @marcpopMSFT as the supposed owner of the code.