Multi-level SharedFX lookup implemented.#1241
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; |
| std::vector<pal::string_t> hive_dir; | ||
|
|
||
| //Multi-level SharedFX lookup happens only if dotnet_lookup env var is set to 1 | ||
| if (pal::getenv(_X("dotnet_lookup"), &env_lookup) && env_lookup == _X("1")) |
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.
|
Pls. fix spacing and the PR feedback otherwise, this looks fine to me! |
456b412 to
70b8bde
Compare
|
|
||
| if (pal::getcwd(&cwd)) | ||
| { | ||
| hive_dir.push_back(cwd); |
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.
| std::vector<pal::string_t> hive_dir; | ||
|
|
||
| //Multi-level SharedFX lookup happens only if dotnet_lookup env var is set to 1 | ||
| if (pal::getenv(_X("DOTNET_ORDERED_LOOKUP"), &env_lookup) && env_lookup == _X("1")) |
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.
| append_path(&fx_dir, fx_name.c_str()); | ||
|
|
||
| bool do_roll_forward = false; | ||
| if (specified_fx_version.empty()) |
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.
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.
|
|
||
| if (!do_roll_forward) | ||
| { | ||
| trace::verbose(_X("Did not roll forward because specified version='%s', patch_roll_fwd=%d, chose [%s]"), specified_fx_version.c_str(), config.get_patch_roll_fwd(), fx_ver.c_str()); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| if (!do_roll_forward) | ||
| { | ||
| trace::verbose(_X("Did not roll forward because specified version='%s', patch_roll_fwd=%d, chose [%s]"), specified_fx_version.c_str(), config.get_patch_roll_fwd(), fx_ver.c_str()); | ||
| append_path(&fx_dir, fx_ver.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.
| bool get_own_executable_path(string_t* recv); | ||
| bool getenv(const char_t* name, string_t* recv); | ||
| bool get_default_servicing_directory(string_t* recv); | ||
| bool get_local_dotnet_dir(string_t* recv); |
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 dir; | ||
| if (!pal::getenv("HOME", &dir)) | ||
| { | ||
| struct passwd* pw = getpwuid(getuid()); |
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 path; | ||
| if (!pal::getenv(_X("PATH"), &path)) | ||
| { | ||
| return false; |
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.
|
Also, can you please add tests for the new scenarios to your PR? |
| std::vector<pal::string_t> hive_dir; | ||
|
|
||
| //Multi-level SharedFX lookup happens only if dotnet_lookup env var is set to 1 | ||
| if (pal::getenv(_X("DOTNET_ORDERED_LOOKUP"), &env_lookup) && env_lookup == _X("1")) |
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.
36122e8 to
22ef56d
Compare
| std::vector<pal::string_t> hive_dir; | ||
|
|
||
| //Multi-level SharedFX lookup happens only if dotnet_lookup env var is set to 1 | ||
| bool multilevel_lookup = pal::getenv(_X("DOTNET_MULTILEVEL_LOOKUP"), &env_lookup) && env_lookup == _X("1"); |
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.
7f1768b to
78f2d91
Compare
|
Change looks good to me. Will you be able to get the tests incorporated as well? |
|
I'm just finishing the md file right now. I still need to take a look at how the HostActivation Tests are done, though. |
dd5d6e8 to
8041e96
Compare
| { | ||
| throw new DirectoryNotFoundException(); | ||
| } | ||
| Directory.Delete(sharedFxDir, true); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| // completed, the folder is supposed to be empty. We're just playing safe | ||
| if (Directory.Exists(multilevelDir)) | ||
| { | ||
| Directory.Delete(multilevelDir, true); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
5c01574 to
e482331
Compare
| pal::string_t env_lookup; | ||
|
|
||
| // Multi-level SharedFX lookup happens only if DOTNET_MULTILEVEL_LOOKUP env var is set to 1 | ||
| bool multilevel_lookup = pal::getenv(_X("DOTNET_MULTILEVEL_LOOKUP"), &env_lookup) && (env_lookup == _X("1")); |
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.
e482331 to
823f8f1
Compare
|
I am good with this change. @ramarag Do you have anything to add? |
|
@cakine I see your newly added test failing in the log (see https://ci.dot.net/job/dotnet_core-setup/job/master/job/release_windows_nt_x64_prtest/636/consoleFull):
Can you please take a look? |
| .Should() | ||
| .Fail() | ||
| .And | ||
| .HaveStdErrContaining("It was not possible to find any compatible framework version"); |
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.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
I am planning to merge #1560. Once it is merged, you should rebase against it and update your negative test to invoke the Execute method as exemplified in that PR. This will keep real test passes segregated from real failures. |
|
@cakine I have merged the PR - please rebase against it and update your test. |
823f8f1 to
d91237a
Compare
d91237a to
512a54d
Compare
|
@gkhanna79 Done. |
Framework search is done in relation to the executable directory. It would be better to be able to search for it in other directories as well. Suggested folders are the current working directory, the user location and the global .NET location. The user and global folders may vary depending on the running operational system. They 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 .NET 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.