@@ -6,8 +6,35 @@ VERSION_PREFIX=3.1
6
6
# See https://github.com/dotnet/source-build/issues/579, this version
7
7
# needs to be compatible with the runtime produced from source-build
8
8
DEV_CERTS_VERSION_DEFAULT=3.0.0-preview8-28405-07
9
+
10
+ # Use uname to determine what the CPU is.
11
+ cpuName=$( uname -p)
12
+ # Some Linux platforms report unknown for platform, but the arch for machine.
13
+ if [[ " $cpuName " == " unknown" ]]; then
14
+ cpuName=$( uname -m)
15
+ fi
16
+
17
+ case $cpuName in
18
+ aarch64)
19
+ buildArch=arm64
20
+ ;;
21
+ amd64|x86_64)
22
+ buildArch=x64
23
+ ;;
24
+ armv* l)
25
+ buildArch=arm
26
+ ;;
27
+ i686)
28
+ buildArch=x86
29
+ ;;
30
+ * )
31
+ echo " Unknown CPU $cpuName detected, treating it as x64"
32
+ buildArch=x64
33
+ ;;
34
+ esac
35
+
9
36
__ROOT_REPO=$( cat " $SCRIPT_ROOT /artifacts/obj/rootrepo.txt" | sed ' s/\r$//' ) # remove CR if mounted repo on Windows drive
10
- targetRid=$( cat " $SCRIPT_ROOT /artifacts/obj/x64 /Release/TargetInfo.props" | grep -i targetrid | sed -E ' s|\s*</?TargetRid>\s*||g' )
37
+ targetRid=$( cat " $SCRIPT_ROOT /artifacts/obj/${buildArch} /Release/TargetInfo.props" | grep -i targetrid | sed -E ' s|\s*</?TargetRid>\s*||g' )
11
38
12
39
export DOTNET_CLI_TELEMETRY_OPTOUT=1
13
40
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
@@ -208,7 +235,7 @@ function doCommand() {
208
235
runPublishScenarios () {
209
236
" ${dotnetCmd} " publish --self-contained false /bl:" ${binlogPrefix} publish-fx-dep.binlog"
210
237
" ${dotnetCmd} " publish --self-contained true -r $targetRid /bl:" ${binlogPrefix} publish-self-contained-${targetRid} .binlog"
211
- " ${dotnetCmd} " publish --self-contained true -r linux-x64 /bl:" ${binlogPrefix} publish-self-contained-portable.binlog"
238
+ " ${dotnetCmd} " publish --self-contained true -r linux-${buildArch} /bl:" ${binlogPrefix} publish-self-contained-portable.binlog"
212
239
}
213
240
if [ " $projectOutput " == " true" ]; then
214
241
runPublishScenarios | tee -a " $logFile "
@@ -360,7 +387,7 @@ echo "<Project />" | tee Directory.Build.props > Directory.Build.targets
360
387
361
388
# Unzip dotnet if the dotnetDir is not specified
362
389
if [ " $dotnetDir " == " " ]; then
363
- OUTPUT_DIR=" $SCRIPT_ROOT /artifacts/x64 /$configuration /"
390
+ OUTPUT_DIR=" $SCRIPT_ROOT /artifacts/${buildArch} /$configuration /"
364
391
DOTNET_TARBALL=" $( ls ${OUTPUT_DIR} dotnet-sdk-${VERSION_PREFIX} * ) "
365
392
366
393
mkdir -p " $cliDir "
@@ -377,7 +404,7 @@ echo SDK under test is:
377
404
378
405
# setup restore path
379
406
export NUGET_PACKAGES=" $restoredPackagesDir "
380
- SOURCE_BUILT_PKGS_PATH=" $SCRIPT_ROOT /artifacts/obj/x64 /$configuration /blob-feed/packages/"
407
+ SOURCE_BUILT_PKGS_PATH=" $SCRIPT_ROOT /artifacts/obj/${buildArch} /$configuration /blob-feed/packages/"
381
408
export DOTNET_ROOT=" $dotnetDir "
382
409
# OSX also requires DOTNET_ROOT to be on the PATH
383
410
if [ " $( uname) " == ' Darwin' ]; then
0 commit comments