From baf636aa4318bbbdf695fc271b0612c453b9481b Mon Sep 17 00:00:00 2001 From: SingleAccretion Date: Mon, 6 Oct 2025 01:28:33 +0300 Subject: [PATCH] Move foreign architecture ILC testing to Helix --- eng/pipelines/common/global-build-job.yml | 13 ++- eng/pipelines/common/platform-matrix.yml | 10 +- .../templates/pipeline-with-resources.yml | 7 -- .../coreclr/templates/helix-queues-setup.yml | 2 +- eng/pipelines/runtimelab-official.yml | 4 +- eng/pipelines/runtimelab.yml | 4 +- eng/pipelines/runtimelab/install-wasi-sdk.ps1 | 18 +++- .../runtimelab/remove-duplicate-packages.ps1 | 2 +- .../runtimelab-post-build-steps.yml | 53 +++++----- .../runtimelab/sendtohelix-naot-llvm.proj | 98 +++++++++++++++++++ ...-and-test-tools.sh => set-emsdk-python.sh} | 4 - .../set-ilc-emulation-environment.ps1 | 19 ---- .../Microsoft.NETCore.Native.targets | 2 +- src/tests/build.cmd | 4 +- src/tests/build.sh | 12 --- src/tests/run.cmd | 8 +- src/tests/run.sh | 3 + 17 files changed, 171 insertions(+), 92 deletions(-) create mode 100644 eng/pipelines/runtimelab/sendtohelix-naot-llvm.proj rename eng/pipelines/runtimelab/{install-build-and-test-tools.sh => set-emsdk-python.sh} (64%) delete mode 100644 eng/pipelines/runtimelab/set-ilc-emulation-environment.ps1 diff --git a/eng/pipelines/common/global-build-job.yml b/eng/pipelines/common/global-build-job.yml index aa630ae9d46a..3f95f1a9761e 100644 --- a/eng/pipelines/common/global-build-job.yml +++ b/eng/pipelines/common/global-build-job.yml @@ -205,10 +205,13 @@ jobs: # Install Wasm dependencies: emscripten, LLVM, NodeJS - ${{ if and(eq(parameters.runtimeFlavor, 'coreclr'), eq(parameters.archType, 'wasm')) }}: - ${{ if ne(parameters.hostedOs, 'windows') }}: - - script: /tmp/docker exec -t -u 0 naot-llvm-ci-container sh -c "tdnf install -y sudo" - displayName: Install sudo - - script: $(Build.SourcesDirectory)/eng/pipelines/runtimelab/install-build-and-test-tools.sh - displayName: Install NativeAOT-LLVM build and test tools + - ${{ if eq(parameters.hostedTargetArch, '') }}: + - script: /tmp/docker exec -t -u 0 naot-llvm-ci-container sh -c "tdnf install -y sudo" + displayName: Install sudo + - script: sudo tdnf install -y lldb python3-lldb + displayName: Install LLDB + - script: $(Build.SourcesDirectory)/eng/pipelines/runtimelab/set-emsdk-python.sh + displayName: Set EMSDK_PYTHON - script: pwsh $(Build.SourcesDirectory)/eng/pipelines/runtimelab/install-emscripten.ps1 $(Build.SourcesDirectory)/wasm-tools -CI displayName: Install/activate emscripten - ${{ if eq(parameters.hostedOs, 'windows') }}: @@ -240,6 +243,7 @@ jobs: - ${{ if ne(preBuildStep.template, '') }}: - template: ${{ preBuildStep.template }} parameters: + hostedOs: ${{ parameters.hostedOs }} osGroup: ${{ parameters.osGroup }} osSubgroup: ${{ parameters.osSubgroup }} archType: ${{ parameters.archType }} @@ -279,6 +283,7 @@ jobs: - ${{ if ne(postBuildStep.template, '') }}: - template: ${{ postBuildStep.template }} parameters: + hostedOs: ${{ parameters.hostedOs }} osGroup: ${{ parameters.osGroup }} osSubgroup: ${{ parameters.osSubgroup }} archType: ${{ parameters.archType }} diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml index c0d705a4cf6f..5cf486b976e9 100644 --- a/eng/pipelines/common/platform-matrix.yml +++ b/eng/pipelines/common/platform-matrix.yml @@ -541,18 +541,18 @@ jobs: buildConfig: ${{ parameters.buildConfig }} ${{ insert }}: ${{ parameters.jobParameters }} -- ${{ if containsValue(parameters.platforms, 'browser_wasm_linux_arm64_naot_llvm') }}: +- ${{ if containsValue(parameters.platforms, 'wasi_wasm_linux_arm64_naot_llvm') }}: - template: xplat-setup.yml parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} variables: ${{ parameters.variables }} - osGroup: browser + osGroup: wasi archType: wasm - targetRid: browser-wasm - platform: browser_wasm_linux_arm64_naot_llvm + targetRid: wasi-wasm + platform: wasi_wasm_linux_arm64_naot_llvm shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: linux_arm64_naot_llvm + container: linux_arm64 jobParameters: hostedOs: linux hostedTargetArch: arm64 diff --git a/eng/pipelines/common/templates/pipeline-with-resources.yml b/eng/pipelines/common/templates/pipeline-with-resources.yml index 62559ef461e8..879a9e2daf51 100644 --- a/eng/pipelines/common/templates/pipeline-with-resources.yml +++ b/eng/pipelines/common/templates/pipeline-with-resources.yml @@ -88,13 +88,6 @@ extends: env: ROOTFS_DIR: /crossrootfs/x64 - # For arm64, we need to install QEMU. - linux_arm64_naot_llvm: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-cross-arm64 - options: '--name naot-llvm-ci-container -v /usr/bin/docker:/tmp/docker:ro' - env: - ROOTFS_DIR: /crossrootfs/arm64 - # We use a CentOS Stream 8 image here to test building from source on CentOS Stream 9. SourceBuild_centos_x64: image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9 diff --git a/eng/pipelines/coreclr/templates/helix-queues-setup.yml b/eng/pipelines/coreclr/templates/helix-queues-setup.yml index 201bead89062..fa73789d4383 100644 --- a/eng/pipelines/coreclr/templates/helix-queues-setup.yml +++ b/eng/pipelines/coreclr/templates/helix-queues-setup.yml @@ -68,7 +68,7 @@ jobs: - (Debian.12.Arm32)Ubuntu.2204.ArmArch@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-arm32v7 # Linux arm64 - - ${{ if eq(parameters.platform, 'linux_arm64') }}: + - ${{ if in(parameters.platform, 'linux_arm64', 'wasi_wasm_linux_arm64_naot_llvm') }}: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - (Ubuntu.2004.Arm64.Open)Ubuntu.2204.Armarch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-helix-arm64v8 - ${{ if eq(variables['System.TeamProject'], 'internal') }}: diff --git a/eng/pipelines/runtimelab-official.yml b/eng/pipelines/runtimelab-official.yml index 2b143659f3a2..da7293527471 100644 --- a/eng/pipelines/runtimelab-official.yml +++ b/eng/pipelines/runtimelab-official.yml @@ -38,8 +38,8 @@ extends: platforms: - browser_wasm_win - wasi_wasm_win - - browser_wasm_linux_x64_naot_llvm - - browser_wasm_linux_arm64_naot_llvm + - wasi_wasm_linux_x64_naot_llvm + - wasi_wasm_linux_arm64_naot_llvm jobParameters: templatePath: 'templates-official' timeoutInMinutes: 300 diff --git a/eng/pipelines/runtimelab.yml b/eng/pipelines/runtimelab.yml index 70ff5f494fcc..861c64371427 100644 --- a/eng/pipelines/runtimelab.yml +++ b/eng/pipelines/runtimelab.yml @@ -115,7 +115,7 @@ extends: - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml buildConfig: release platforms: - linux_x64 @@ -125,7 +125,7 @@ extends: - wasi_wasm_win - browser_wasm_linux_x64_naot_llvm - wasi_wasm_linux_x64_naot_llvm - - browser_wasm_linux_arm64_naot_llvm + - wasi_wasm_linux_arm64_naot_llvm jobParameters: timeoutInMinutes: 300 buildArgs: -s clr.aot+libs -c $(_BuildConfig) diff --git a/eng/pipelines/runtimelab/install-wasi-sdk.ps1 b/eng/pipelines/runtimelab/install-wasi-sdk.ps1 index 85c198287f30..959a147e8bf0 100644 --- a/eng/pipelines/runtimelab/install-wasi-sdk.ps1 +++ b/eng/pipelines/runtimelab/install-wasi-sdk.ps1 @@ -1,5 +1,6 @@ param( $InstallDir, + $HostArch = $null, [switch]$CI ) @@ -16,13 +17,21 @@ if ($WasiSdkVersion -lt [int]$UpstreamWasiSdkVersion) exit } -if ($IsWindows) +if (!$HostArch) { - $WasiSdkHost = "x86_64-windows" + $HostArch = [Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture } -else +$WasiSdkHostArch = switch ($HostArch) { - $WasiSdkHost = "x86_64-linux" + x64 { "x86_64" } + default { "$HostArch".ToLowerInvariant() } +} + +$WasiSdkHost = $IsWindows ? "$WasiSdkHostArch-windows" : "$WasiSdkHostArch-linux" +if ($WasiSdkHost -eq "arm64-windows") +{ + # TODO-LLVM: remove once we updgrade to WASI SDK 27.0 that supports win-arm64. For now we rely on emulation. + $WasiSdkHost = "x86_64-windows" } $WasiSdkDirName = "wasi-sdk-$WasiSdkVersion.0-$WasiSdkHost" $WasiSdkGzFile = "$WasiSdkDirName.tar.gz" @@ -30,6 +39,7 @@ $WasiSdkGzFile = "$WasiSdkDirName.tar.gz" Invoke-WebRequest -Uri https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$WasiSdkVersion/$WasiSdkGzFile -OutFile $WasiSdkGzFile tar -xzf $WasiSdkGzFile +del $WasiSdkGzFile mv $WasiSdkDirName wasi-sdk # The upstream build expects this sentinel to exist, otherwise it tries to use a provisioned SDK. diff --git a/eng/pipelines/runtimelab/remove-duplicate-packages.ps1 b/eng/pipelines/runtimelab/remove-duplicate-packages.ps1 index dd57889ba2df..572f9f5144af 100644 --- a/eng/pipelines/runtimelab/remove-duplicate-packages.ps1 +++ b/eng/pipelines/runtimelab/remove-duplicate-packages.ps1 @@ -40,7 +40,7 @@ if (!$PublishTargetPackages) Remove-Item -Force $PackagesPath/$TargetPackagePattern } -$PublishHostPackages = $TargetOS -eq "browser" +$PublishHostPackages = $TargetOS -eq "wasi" if (!$PublishHostPackages) { $HostPackagePattern = "runtime.$HostRid.Microsoft.DotNet.ILCompiler.LLVM.*.nupkg" diff --git a/eng/pipelines/runtimelab/runtimelab-post-build-steps.yml b/eng/pipelines/runtimelab/runtimelab-post-build-steps.yml index c32174630dbf..56ebe9658476 100644 --- a/eng/pipelines/runtimelab/runtimelab-post-build-steps.yml +++ b/eng/pipelines/runtimelab/runtimelab-post-build-steps.yml @@ -18,42 +18,49 @@ steps: displayName: Build the ILC and RyuJit cross-compilers # Build target packages (note: target libs already built). - - script: $(Build.SourcesDirectory)/build$(scriptExt) nativeaot.packages -os ${{ parameters.osGroup }} -a wasm -c $(buildConfigUpper) $(_officialBuildParameter) -ci $(wasmEnableThreadsArg) + - script: $(Build.SourcesDirectory)/build$(scriptExt) nativeaot.packages -os ${{ parameters.osGroup }} -a wasm -c $(buildConfigUpper) $(_officialBuildParameter) -ci ${{ parameters.wasmEnableThreadsArg }} displayName: Build target packages # Build host packages. - script: $(Build.SourcesDirectory)/build$(scriptExt) libs+nativeaot.packages -a $(hostedTargetArch) -c $(buildConfigUpper) -cross $(_officialBuildParameter) -ci displayName: Build host packages - # Build coreclr native test output outside of official build + # Build and run runtime tests outside of official build - ${{ if ne(parameters.isOfficialBuild, true) }}: - - ${{ if and(eq(parameters.archType, 'wasm'), ne(parameters.nameSuffix, ''), eq(parameters.wasmEnableThreadsArg, '')) }}: - - script: pwsh $(Build.SourcesDirectory)/eng/pipelines/runtimelab/set-ilc-emulation-environment.ps1 -Arch $(hostedTargetArch) - displayName: Set up ILC emulation environment - - - ${{ if eq(parameters.archType, 'wasm') }}: - - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) nativeaot $(buildConfigUpper) ${{ parameters.osGroup }} $(crossArg) $(_officialBuildParameter) ci tree nativeaot /p:LibrariesConfiguration=${{ parameters.librariesConfiguration }} ${{ parameters.wasmEnableThreadsArg }} - displayName: Build runtime tests - - ${{ else }}: - - ${{ if eq(parameters.osGroup, 'windows') }}: - - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) nativeaot $(buildConfigUpper) ${{ parameters.archType }} $(crossArg) $(_officialBuildParameter) ci tree nativeaot /p:LibrariesConfiguration=${{ parameters.librariesConfiguration }} + # Full validation with ILC that we can run on the build machine. + - ${{ if ne(parameters.nameSuffix, 'arm64') }}: + - ${{ if or(eq(parameters.osGroup, 'windows'), eq(parameters.hostedOs, 'windows')) }}: + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) nativeaot $(buildConfigUpper) os ${{ parameters.osGroup }} ${{ parameters.archType }} $(crossArg) $(_officialBuildParameter) ci tree nativeaot /p:LibrariesConfiguration=${{ parameters.librariesConfiguration }} ${{ parameters.wasmEnableThreadsArg }} displayName: Build runtime tests - ${{ else }}: - - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) nativeaot $(buildConfigUpper) ${{ parameters.archType }} $(crossArg) $(_officialBuildParameter) ci 'tree nativeaot' /p:LibrariesConfiguration=${{ parameters.librariesConfiguration }} + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) nativeaot $(buildConfigUpper) -os ${{ parameters.osGroup }} ${{ parameters.archType }} $(crossArg) $(_officialBuildParameter) ci 'tree nativeaot' /p:LibrariesConfiguration=${{ parameters.librariesConfiguration }} ${{ parameters.wasmEnableThreadsArg }} displayName: Build runtime tests - - ${{ if contains(parameters.platform, 'win') }}: - ${{ if eq(parameters.wasmEnableThreadsArg, '') }}: - - script: $(Build.SourcesDirectory)/src/tests/run$(scriptExt) runnativeaottests $(buildConfigUpper) ${{ parameters.archType }} ${{ parameters.osGroup }} - displayName: Run runtime tests - - ${{ else }}: - - script: $(Build.SourcesDirectory)/src/tests/run$(scriptExt) --runnativeaottests $(buildConfigUpper) ${{ parameters.archType }} ${{ parameters.osGroup }} - displayName: Run runtime tests + - ${{ if or(eq(parameters.osGroup, 'windows'), eq(parameters.hostedOs, 'windows')) }}: + - script: $(Build.SourcesDirectory)/src/tests/run$(scriptExt) runnativeaottests $(buildConfigUpper) ${{ parameters.archType }} os ${{ parameters.osGroup }} + displayName: Run runtime tests + - ${{ else }}: + - script: $(Build.SourcesDirectory)/src/tests/run$(scriptExt) --runnativeaottests $(buildConfigUpper) ${{ parameters.archType }} -os=${{ parameters.osGroup }} + displayName: Run runtime tests - # Don't compile/run the libraries tests with emulated ILC to save CI time/resources. - - ${{ if and(eq(parameters.archType, 'wasm'), eq(parameters.nameSuffix, ''), eq(parameters.wasmEnableThreadsArg, '')) }}: - - script: $(Build.SourcesDirectory)/build$(scriptExt) libs.tests -test -a ${{ parameters.archType }} -os ${{ parameters.osGroup }} -lc ${{ parameters.librariesConfiguration }} -rc $(buildConfigUpper) /p:TestNativeAot=true /p:RunSmokeTestsOnly=true - displayName: Build and run WebAssembly libraries tests + - ${{ if eq(parameters.archType, 'wasm') }}: + - script: $(Build.SourcesDirectory)/build$(scriptExt) libs.tests -test -a ${{ parameters.archType }} -os ${{ parameters.osGroup }} -lc ${{ parameters.librariesConfiguration }} -rc $(buildConfigUpper) /p:TestNativeAot=true /p:RunSmokeTestsOnly=true + displayName: Build and run WebAssembly libraries tests + # Minimal Helix-based validation for cross-compiled ILC. + - ${{ elseif eq(parameters.osGroup, 'wasi') }}: + - template: /eng/pipelines/common/templates/runtimes/send-to-helix-step.yml + parameters: + displayName: Test cross-compiled ILC on Helix + buildConfig: $(buildConfigUpper) + archType: $(hostedTargetArch) + osGroup: ${{ parameters.hostedOs }} + creator: $(Build.DefinitionName) + helixBuild: $(Build.BuildNumber) + helixSource: $(_HelixSource) + helixType: 'test/functional/ilc/' + helixQueues: ${{ parameters.helixQueues }} + helixProjectArguments: '$(Build.SourcesDirectory)/eng/pipelines/runtimelab/sendtohelix-naot-llvm.proj /p:TestTargetOS=${{ parameters.osGroup }}' - script: pwsh $(Build.SourcesDirectory)/eng/pipelines/runtimelab/remove-duplicate-packages.ps1 -Config $(_BuildConfig) -HostArch $(hostedTargetArch) -TargetOS ${{ parameters.osGroup }} -TargetArch ${{ parameters.archType }} displayName: Remove duplicate packages before publishing diff --git a/eng/pipelines/runtimelab/sendtohelix-naot-llvm.proj b/eng/pipelines/runtimelab/sendtohelix-naot-llvm.proj new file mode 100644 index 000000000000..e2eebaefb609 --- /dev/null +++ b/eng/pipelines/runtimelab/sendtohelix-naot-llvm.proj @@ -0,0 +1,98 @@ + + + + + $(_Creator) + $(_HelixAccessToken) + $(_HelixBuild) + $(_HelixSource) + $(_HelixTargetQueues) + $(_HelixType) + + $([System.IO.File]::ReadAllText('$(RepoRoot)global.json')) + true + sdk + $([System.Text.RegularExpressions.Regex]::Match($(GlobalJsonContent), '(%3F<="dotnet": ").*(%3F=")')) + + + + + wasi + $(TestTargetOS)-wasm + $(TargetOS)-$(TargetArchitecture) + true + .exe + $([MSBuild]::NormalizeDirectory('$(ArtifactsObjDir)', '$(IlcHostPlatform)-$(Configuration)-NativeAOT-LLVM-HelixTestPayload')) + + + + + + + + + + + + + + + + + + + set RestoreAdditionalProjectSources=%HELIX_WORKITEM_PAYLOAD%\pkg-src + $(HelixPreCommands);set WASI_SDK_PATH=%HELIX_WORKITEM_PAYLOAD%\wasi-sdk + +dotnet publish %HELIX_WORKITEM_PAYLOAD%\samples\HelloWorld\HelloWorld.csproj -c $(Configuration) -r $(TestTargetRid) &&^ +dotnet publish %HELIX_WORKITEM_PAYLOAD%\samples\NativeLibrary\NativeLibrary.csproj -c $(Configuration) -r $(TestTargetRid) + + + + + export RestoreAdditionalProjectSources=$HELIX_WORKITEM_PAYLOAD/pkg-src + $(HelixPreCommands);export WASI_SDK_PATH=$HELIX_WORKITEM_PAYLOAD/wasi-sdk + $(HelixPreCommands);chmod +x $WASI_SDK_PATH/bin/* + +dotnet publish $HELIX_WORKITEM_PAYLOAD/samples/HelloWorld/HelloWorld.csproj -c $(Configuration) -r $(TestTargetRid) &&\ +dotnet publish $HELIX_WORKITEM_PAYLOAD/samples/NativeLibrary/NativeLibrary.csproj -c $(Configuration) -r $(TestTargetRid) + + + + + + $(HelixCommand) + $(WorkItemDirectory) + 01:00:00 + + + + + + + + + diff --git a/eng/pipelines/runtimelab/install-build-and-test-tools.sh b/eng/pipelines/runtimelab/set-emsdk-python.sh similarity index 64% rename from eng/pipelines/runtimelab/install-build-and-test-tools.sh rename to eng/pipelines/runtimelab/set-emsdk-python.sh index 7955c167c1bf..ddedb4b46a0a 100755 --- a/eng/pipelines/runtimelab/install-build-and-test-tools.sh +++ b/eng/pipelines/runtimelab/set-emsdk-python.sh @@ -4,7 +4,3 @@ set -e echo Setting EMSDK_PYTHON to /usr/bin/python3 echo '##vso[task.setvariable variable=EMSDK_PYTHON]'/usr/bin/python3 echo - -echo Installing LLDB, QEMU -sudo tdnf install -y lldb python3-lldb qemu-user -echo diff --git a/eng/pipelines/runtimelab/set-ilc-emulation-environment.ps1 b/eng/pipelines/runtimelab/set-ilc-emulation-environment.ps1 deleted file mode 100644 index 166d07560498..000000000000 --- a/eng/pipelines/runtimelab/set-ilc-emulation-environment.ps1 +++ /dev/null @@ -1,19 +0,0 @@ -[CmdletBinding(PositionalBinding=$false)] -param( - [string]$Arch -) -$ErrorActionPreference="Stop" - -if ($IsWindows) -{ - Write-Error "Windows ILC emulation not implemented" -} -else -{ - $QemuArch = $Arch -eq "arm64" ? "aarch64" : $Arch - $IlcLauncher = "qemu-$QemuArch -L $env:ROOTFS_DIR" - Write-Host "Setting `$(IlcLauncher) to '$IlcLauncher'" - Write-Host "Setting `$(IlcHostArch) to '$Arch'" - Write-Host "##vso[task.setvariable variable=IlcLauncher]$IlcLauncher" - Write-Host "##vso[task.setvariable variable=IlcHostArch]$Arch" -} diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets index 3b06dceaeac0..aaa0c965696b 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets @@ -370,7 +370,7 @@ The .NET Foundation licenses this file to you under the MIT license. <_IlcEnvironmentVariables Condition="'$(IlcUseServerGc)' == 'false'">DOTNET_gcServer=0;$(_IlcEnvironmentVariables) - diff --git a/src/tests/build.cmd b/src/tests/build.cmd index 6834f3102bfb..baa4cc52608f 100644 --- a/src/tests/build.cmd +++ b/src/tests/build.cmd @@ -73,8 +73,10 @@ if /i "%1" == "x64" (set __BuildArch=x64&set processedArgs= if /i "%1" == "x86" (set __BuildArch=x86&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "arm64" (set __BuildArch=arm64&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "wasm" (set __BuildArch=wasm&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) -if /i "%1" == "wasi" (set __TargetOS=wasi&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) + +if /i "%1" == "os" (set __TargetOS=%2&set processedArgs=!processedArgs! %1&shift&shift&goto Arg_Loop) if /i "%1" == "browser" (set __TargetOS=browser&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) +if /i "%1" == "wasi" (set __TargetOS=wasi&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "debug" (set __BuildType=Debug&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "release" (set __BuildType=Release&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) diff --git a/src/tests/build.sh b/src/tests/build.sh index 953ad230f167..1a556196b249 100755 --- a/src/tests/build.sh +++ b/src/tests/build.sh @@ -167,8 +167,6 @@ usage_list+=("-test:xxx - Only build the specified test project ^(relative or ab usage_list+=("-dir:xxx - Build all test projects in the given directory ^(relative or absolute directory under src\tests^)."); usage_list+=("-tree:xxx - Build all test projects in the given subtree ^(relative or absolute directory under src\tests^)."); usage_list+=("-log:xxx - Base file name to use for log files (used in lab pipelines that build tests in multiple steps to retain logs for each step).") -usage_list+=("-browser - Target Wasm/browser.") -usage_list+=("-wasi - Target Wasm/WASI.") usage_list+=("") usage_list+=("Any unrecognized arguments will be passed directly to MSBuild.") @@ -322,16 +320,6 @@ handle_arguments_local() { fi ;; - browser|-browser) - __TargetOS=browser - __TargetArch=wasm - ;; - - wasi|-wasi) - __TargetOS=wasi - __TargetArch=wasm - ;; - *) __UnprocessedBuildArgs+=("$1") ;; diff --git a/src/tests/run.cmd b/src/tests/run.cmd index 4133e947f7a6..089cecd12d7c 100644 --- a/src/tests/run.cmd +++ b/src/tests/run.cmd @@ -46,6 +46,8 @@ if /i "%1" == "x64" (set __BuildArch=x64&shi if /i "%1" == "x86" (set __BuildArch=x86&shift&goto Arg_Loop) if /i "%1" == "arm64" (set __BuildArch=arm64&shift&goto Arg_Loop) if /i "%1" == "wasm" (set __BuildArch=wasm&shift&goto Arg_Loop) + +if /i "%1" == "os" (set __TargetOS=%2&shift&shift&goto Arg_Loop) if /i "%1" == "wasi" (set __TargetOS=wasi&shift&goto Arg_Loop) if /i "%1" == "browser" (set __TargetOS=browser&shift&goto Arg_Loop) @@ -99,12 +101,6 @@ if defined __TestEnv (if not exist %__TestEnv% echo %__MsgPrefix%Error: Test Env :: Set the remaining variables based upon the determined configuration set __MSBuildBuildArch=%__BuildArch% -if "%__BuildArch%" == "wasm" ( - if "%__TargetOS%" == "windows" ( - set __TargetOS=browser - ) -) - set "__BinDir=%__RootBinDir%\bin\coreclr\%__TargetOS%.%__BuildArch%.%__BuildType%" set "__TestWorkingDir=%__RootBinDir%\tests\coreclr\%__TargetOS%.%__BuildArch%.%__BuildType%" diff --git a/src/tests/run.sh b/src/tests/run.sh index 0062a49bc1e6..8314b6d9a8b6 100755 --- a/src/tests/run.sh +++ b/src/tests/run.sh @@ -103,6 +103,9 @@ do wasm) buildArch="wasm" ;; + -os=*) + buildOS=${i#*=} + ;; android) buildOS="android" ;;