From e8951bf883cad27d9495c1964672a4a185eed483 Mon Sep 17 00:00:00 2001 From: sfoslund Date: Fri, 17 Sep 2021 13:56:33 -0700 Subject: [PATCH 1/2] Update mac x64 installer script arch detection --- .../src/GenerateMacOSDistributionFile.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Microsoft.DotNet.Build.Tasks.Installers/src/GenerateMacOSDistributionFile.cs b/src/Microsoft.DotNet.Build.Tasks.Installers/src/GenerateMacOSDistributionFile.cs index 4d988fd2d75..b2bc20c3595 100644 --- a/src/Microsoft.DotNet.Build.Tasks.Installers/src/GenerateMacOSDistributionFile.cs +++ b/src/Microsoft.DotNet.Build.Tasks.Installers/src/GenerateMacOSDistributionFile.cs @@ -42,11 +42,16 @@ public override bool Execute() var archScriptContent = @""; var scriptElement = new XElement("script", new XText(archScriptContent)); From 6fde1846cd1e4b330306f6edde0f18226ef83a94 Mon Sep 17 00:00:00 2001 From: sfoslund Date: Fri, 17 Sep 2021 14:35:15 -0700 Subject: [PATCH 2/2] Add comments to x64 machine detection script --- .../src/GenerateMacOSDistributionFile.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.DotNet.Build.Tasks.Installers/src/GenerateMacOSDistributionFile.cs b/src/Microsoft.DotNet.Build.Tasks.Installers/src/GenerateMacOSDistributionFile.cs index b2bc20c3595..d471bee08dd 100644 --- a/src/Microsoft.DotNet.Build.Tasks.Installers/src/GenerateMacOSDistributionFile.cs +++ b/src/Microsoft.DotNet.Build.Tasks.Installers/src/GenerateMacOSDistributionFile.cs @@ -48,7 +48,10 @@ function IsX64Machine() { system.log(""Machine type: "" + machine); system.log(""Cpu type: "" + cputype); system.log(""64-bit: "" + cpu64); - + + // 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""); system.log(""IsX64Machine: "" + result); return result;