Multilevel SDK Lookup#1568
Conversation
|
Hi @cakine, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution! The agreement was validated by .NET Foundation and real humans are currently evaluating your PR. TTYL, DNFBOT; |
| pal::string_t env_lookup; | ||
|
|
||
| // Multi-level SDK lookup can be disabled by setting DOTNET_MULTILEVEL_LOOKUP env var to zero | ||
| bool multilevel_lookup = true; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| pal::string_t retval; | ||
| for (pal::string_t dir : hive_dir) | ||
| { | ||
| trace::verbose(_X("Searching SDK directory in [%s]"), dir.c_str()); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
gkhanna79
left a comment
There was a problem hiding this comment.
Looks good modulo a refactoring comment. Please update the PR for that.
|
|
||
| if (pal::getenv(_X("DOTNET_MULTILEVEL_LOOKUP"), &env_lookup)) | ||
| { | ||
| auto env_val = pal::xtoi(env_lookup.c_str()); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
I consider this policy to be wrong. Just because a command is in my path, doesn't mean that it should affect other commands. Take for example two machines: one that does and one that doesn't have |
I do not think the app should break if there is no dotnet on path - it should only result in us determining that there is no global location for dotnet installation. This change is implemented at |
| // Exe: 9999.0.0 | ||
| // Expected: 9999.0.0 from exe dir | ||
| dotnet.Exec("help") | ||
| .WorkingDirectory(_currentWorkingDir) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
I'll merge the changes tomorrow (Feb. 22nd) if there are no more concerns. |
|
Ubuntu Arm release failure is unrelated. Merging the PR. |
.NETCore activation will look for the SDK version folder in the current working directory, the user location, the executable directory and the global .NET location, in the order described.
The user and global locations are defined as follows:
User location:
Windows 32-bit: %SystemDrive%\Users\username.dotnet\x86
Windows 64-bit: %SystemDrive%\Users\username.dotnet\x64
Unix 32-bit: /home/username/.dotnet/x86
Unix 64-bit: /home/username/.dotnet/x64
Global location:
Windows 32-bit: %SystemDrive%\Program Files\dotnet
Windows 64-bit (32-bit application): %SystemDrive%\Program Files (x86)\dotnet
Windows 64-bit (64-bit application): %SystemDrive%\Program Files\dotnet
Unix: the directory of “dotnet” defined in the system path.