-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Allow specifying SDK search paths in global.json #113512
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
Conversation
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov |
|
||
bool multilevel_lookup_enabled(); | ||
void get_framework_and_sdk_locations(const pal::string_t& dotnet_dir, const bool disable_multilevel_lookup, std::vector<pal::string_t>* locations); | ||
void get_framework_locations(const pal::string_t& dotnet_dir, const bool disable_multilevel_lookup, std::vector<pal::string_t>* locations); |
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.
I switched this to just be for frameworks, since callers of this for SDK locations always disable multi-level lookup, so all this did was add dotnet_dir
(if non-empty) to locations
.
Are these paths absolute? If so, would it make sense to additionally support repo-relative paths using Git’s pathspec? See: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec. Specifically:
For example, when positioned in In the context of global.json, |
They can be absolute, but I expect the common use case is relative. If the path is not rooted, we treat it as relative to the global.json. I think that is a simple enough distinction without needing a pathspec or special keywords/token. Made me realized I missed adding a test for that case (thanks!) - will add one. |
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.
/ba-g Failure is #113580 |
paths
can be absolute or relative to the global.json.$host$
is a special value indicating the runningdotnet
patherrorMessage
is shown on SDK resolution failure (instead of the host's default SDK resolution error message).hostfxr
search for SDKs with custom paths if specified and error out with custom message if specifieddotnet <command>
- global.json based on process working directory, runs command using resolved SDK respecting global.json pathshostfxr_resolve_sdk2
- global.json based on working directory argument, returns resolved SDK respecting global.json paths--info
and--list-sdks
- global.json based on process working directory, prints found SDKs respecting global.json pathshostfxr_get_available_sdks
andhostfxr_get_dotnet_environment_info
- global.json based on process working directory, returns found SDKs respecting global.json pathsPart of https://github.com/dotnet/designs/blob/main/proposed/local-sdk-global-json.md.
SDK needs to be updated as well. It currently assumes that its process is the SDK root path, which would no longer be the case if the SDK is resolved via a custom path. It needs this for launching sub-processes for
build
,run
, etc.Contributes to dotnet/sdk#8254
cc @dotnet/appmodel @jaredpar @rainersigwald