Skip to content

Commit 44b9b29

Browse files
Fix/macos m2 detection bug (#19369)
* Updated get_machine_architecture to correctly obtain arm64 * Increased Version task.json * Update task.json * Update task.loc.json * generated output --------- Co-authored-by: MerlynOMsft <[email protected]> Co-authored-by: Merlyn Oppenheim (from Dev Box) <[email protected]>
1 parent 31fdc51 commit 44b9b29

File tree

10 files changed

+63
-18
lines changed

10 files changed

+63
-18
lines changed

Tasks/UseDotNetV2/externals/get-os-distro.sh

+15
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ get_legacy_os_name() {
159159
get_machine_architecture() {
160160

161161
if command -v uname > /dev/null; then
162+
local osn=$(get_current_os_name || echo "")
162163
CPUName=$(uname -m)
163164
case $CPUName in
164165
armv7l)
@@ -169,6 +170,20 @@ get_machine_architecture() {
169170
echo "arm64"
170171
return 0
171172
;;
173+
arm64)
174+
echo "arm64"
175+
return 0
176+
;;
177+
x86_64)
178+
if [ "$osn" = "osx" ]; then
179+
if [ "$(sysctl -in sysctl.proc_translated)" = "1" ]; then
180+
echo "arm64"
181+
else
182+
echo "x64"
183+
fi
184+
return 0
185+
fi
186+
;;
172187
esac
173188
fi
174189

Tasks/UseDotNetV2/task.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Microsoft Corporation",
1414
"version": {
1515
"Major": 2,
16-
"Minor": 232,
16+
"Minor": 234,
1717
"Patch": 0
1818
},
1919
"satisfies": [
@@ -194,4 +194,4 @@
194194
"SupportPhaseNotPresentInChannel": "support-phase is not present in the channel with channel-version %s.",
195195
"DepricatedVersionNetCore": "NET Core version you specfied %s is out of support and will be removed from hosted agents soon. Please refer to https://aka.ms/dotnet-core-support for more information about the .NET support policy."
196196
}
197-
}
197+
}

Tasks/UseDotNetV2/task.loc.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Microsoft Corporation",
1414
"version": {
1515
"Major": 2,
16-
"Minor": 232,
16+
"Minor": 234,
1717
"Patch": 0
1818
},
1919
"satisfies": [
@@ -194,4 +194,4 @@
194194
"SupportPhaseNotPresentInChannel": "ms-resource:loc.messages.SupportPhaseNotPresentInChannel",
195195
"DepricatedVersionNetCore": "ms-resource:loc.messages.DepricatedVersionNetCore"
196196
}
197-
}
197+
}

_generated/UseDotNetV2.versionmap.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Default|2.232.0
2-
Node20_229_3|2.232.1
1+
Default|2.234.0
2+
Node20_229_3|2.234.1

_generated/UseDotNetV2/externals/get-os-distro.sh

+15
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ get_legacy_os_name() {
159159
get_machine_architecture() {
160160

161161
if command -v uname > /dev/null; then
162+
local osn=$(get_current_os_name || echo "")
162163
CPUName=$(uname -m)
163164
case $CPUName in
164165
armv7l)
@@ -169,6 +170,20 @@ get_machine_architecture() {
169170
echo "arm64"
170171
return 0
171172
;;
173+
arm64)
174+
echo "arm64"
175+
return 0
176+
;;
177+
x86_64)
178+
if [ "$osn" = "osx" ]; then
179+
if [ "$(sysctl -in sysctl.proc_translated)" = "1" ]; then
180+
echo "arm64"
181+
else
182+
echo "x64"
183+
fi
184+
return 0
185+
fi
186+
;;
172187
esac
173188
fi
174189

_generated/UseDotNetV2/task.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Microsoft Corporation",
1414
"version": {
1515
"Major": 2,
16-
"Minor": 232,
16+
"Minor": 234,
1717
"Patch": 0
1818
},
1919
"satisfies": [
@@ -195,7 +195,7 @@
195195
"DepricatedVersionNetCore": "NET Core version you specfied %s is out of support and will be removed from hosted agents soon. Please refer to https://aka.ms/dotnet-core-support for more information about the .NET support policy."
196196
},
197197
"_buildConfigMapping": {
198-
"Default": "2.232.0",
199-
"Node20_229_3": "2.232.1"
198+
"Default": "2.234.0",
199+
"Node20_229_3": "2.234.1"
200200
}
201201
}

_generated/UseDotNetV2/task.loc.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Microsoft Corporation",
1414
"version": {
1515
"Major": 2,
16-
"Minor": 232,
16+
"Minor": 234,
1717
"Patch": 0
1818
},
1919
"satisfies": [
@@ -195,7 +195,7 @@
195195
"DepricatedVersionNetCore": "ms-resource:loc.messages.DepricatedVersionNetCore"
196196
},
197197
"_buildConfigMapping": {
198-
"Default": "2.232.0",
199-
"Node20_229_3": "2.232.1"
198+
"Default": "2.234.0",
199+
"Node20_229_3": "2.234.1"
200200
}
201201
}

_generated/UseDotNetV2_Node20/externals/get-os-distro.sh

+15
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ get_legacy_os_name() {
159159
get_machine_architecture() {
160160

161161
if command -v uname > /dev/null; then
162+
local osn=$(get_current_os_name || echo "")
162163
CPUName=$(uname -m)
163164
case $CPUName in
164165
armv7l)
@@ -169,6 +170,20 @@ get_machine_architecture() {
169170
echo "arm64"
170171
return 0
171172
;;
173+
arm64)
174+
echo "arm64"
175+
return 0
176+
;;
177+
x86_64)
178+
if [ "$osn" = "osx" ]; then
179+
if [ "$(sysctl -in sysctl.proc_translated)" = "1" ]; then
180+
echo "arm64"
181+
else
182+
echo "x64"
183+
fi
184+
return 0
185+
fi
186+
;;
172187
esac
173188
fi
174189

_generated/UseDotNetV2_Node20/task.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Microsoft Corporation",
1414
"version": {
1515
"Major": 2,
16-
"Minor": 232,
16+
"Minor": 234,
1717
"Patch": 1
1818
},
1919
"satisfies": [
@@ -199,7 +199,7 @@
199199
"DepricatedVersionNetCore": "NET Core version you specfied %s is out of support and will be removed from hosted agents soon. Please refer to https://aka.ms/dotnet-core-support for more information about the .NET support policy."
200200
},
201201
"_buildConfigMapping": {
202-
"Default": "2.232.0",
203-
"Node20_229_3": "2.232.1"
202+
"Default": "2.234.0",
203+
"Node20_229_3": "2.234.1"
204204
}
205205
}

_generated/UseDotNetV2_Node20/task.loc.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Microsoft Corporation",
1414
"version": {
1515
"Major": 2,
16-
"Minor": 232,
16+
"Minor": 234,
1717
"Patch": 1
1818
},
1919
"satisfies": [
@@ -199,7 +199,7 @@
199199
"DepricatedVersionNetCore": "ms-resource:loc.messages.DepricatedVersionNetCore"
200200
},
201201
"_buildConfigMapping": {
202-
"Default": "2.232.0",
203-
"Node20_229_3": "2.232.1"
202+
"Default": "2.234.0",
203+
"Node20_229_3": "2.234.1"
204204
}
205205
}

0 commit comments

Comments
 (0)