Skip to content

Commit

Permalink
Merge in 'release/5.0' changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dotnet-bot committed Oct 22, 2021
2 parents 88faabc + 65fdc45 commit 7211aa0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/installer/corehost/cli/hostmisc/pal.windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,14 @@ bool pal::get_global_dotnet_dirs(std::vector<pal::string_t>* dirs)
bool dir_found = false;
if (pal::get_dotnet_self_registered_dir(&custom_dir))
{
remove_trailing_dir_seperator(&custom_dir);
dirs->push_back(custom_dir);
dir_found = true;
}
if (get_default_installation_dir(&default_dir))
{
remove_trailing_dir_seperator(&default_dir);

// Avoid duplicate global dirs.
if (!dir_found || !are_paths_equal_with_normalized_casing(custom_dir, default_dir))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,18 @@
var machine = system.sysctl("hw.machine");
var cputype = system.sysctl("hw.cputype");
var cpu64 = system.sysctl("hw.cpu64bit_capable");
var translated = system.sysctl("sysctl.proc_translated");
system.log("Machine type: " + machine);
system.log("Cpu type: " + cputype);
system.log("64-bit: " + cpu64);
system.log("Translated: " + translated);
// From machine.h
// CPU_TYPE_X86_64 = CPU_TYPE_X86 | CPU_ARCH_ABI64 = 0x010000007 = 16777223
// CPU_TYPE_X86 = 7
var result = machine == "amd64" || machine == "x86_64" || cputype == "16777223" || (cputype == "7" && cpu64 == "1");
// We may be running under translation (Rosetta) that makes it seem like system is x64, if so assume machine is not actually x64
result = result && (translated != "1");
system.log("IsX64Machine: " + result);
return result;
}]]></script>
Expand Down

0 comments on commit 7211aa0

Please sign in to comment.