Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions eng/pipelines/common/global-build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}:
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down
10 changes: 5 additions & 5 deletions eng/pipelines/common/platform-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions eng/pipelines/common/templates/pipeline-with-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/coreclr/templates/helix-queues-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- (Debian.12.Arm32)[email protected]/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)[email protected]/dotnet-buildtools/prereqs:ubuntu-20.04-helix-arm64v8
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
Expand Down
4 changes: 2 additions & 2 deletions eng/pipelines/runtimelab-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions eng/pipelines/runtimelab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
18 changes: 14 additions & 4 deletions eng/pipelines/runtimelab/install-wasi-sdk.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
param(
$InstallDir,
$HostArch = $null,
[switch]$CI
)

Expand All @@ -16,20 +17,29 @@ 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"

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.
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/runtimelab/remove-duplicate-packages.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
53 changes: 30 additions & 23 deletions eng/pipelines/runtimelab/runtimelab-post-build-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
98 changes: 98 additions & 0 deletions eng/pipelines/runtimelab/sendtohelix-naot-llvm.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<Project Sdk="Microsoft.DotNet.Helix.Sdk" DefaultTargets="Test">

<!-- This project uses the Helix SDK, documented at
https://github.com/dotnet/arcade/tree/master/src/Microsoft.DotNet.Helix/Sdk,
to send a small test job that uses ILC to compile a few projects.
This is used to smoke-test ILC compiled for architectures we don't
have native test machines for (not-x64).
-->
<PropertyGroup>
<Creator>$(_Creator)</Creator>
<HelixAccessToken>$(_HelixAccessToken)</HelixAccessToken>
<HelixBuild>$(_HelixBuild)</HelixBuild>
<HelixSource>$(_HelixSource)</HelixSource>
<HelixTargetQueues>$(_HelixTargetQueues)</HelixTargetQueues>
<HelixType>$(_HelixType)</HelixType>

<GlobalJsonContent>$([System.IO.File]::ReadAllText('$(RepoRoot)global.json'))</GlobalJsonContent>
<IncludeDotNetCli>true</IncludeDotNetCli>
<DotNetCliPackageType>sdk</DotNetCliPackageType>
<DotNetCliVersion>$([System.Text.RegularExpressions.Regex]::Match($(GlobalJsonContent), '(%3F&lt;="dotnet": ").*(%3F=")'))</DotNetCliVersion>
</PropertyGroup>

<Target Name="BuildHelixWorkItems" BeforeTargets="CoreTest" Condition="'$(HelixTargetQueue)' != ''">
<PropertyGroup>
<TestTargetOS>wasi</TestTargetOS>
<TestTargetRid>$(TestTargetOS)-wasm</TestTargetRid>
<IlcHostPlatform>$(TargetOS)-$(TargetArchitecture)</IlcHostPlatform>
<WindowsShell Condition="$(HelixTargetQueue.ToLowerInvariant().Contains('windows'))">true</WindowsShell>
<ExeExt Condition="'$(WindowsShell)' == 'true'">.exe</ExeExt>
<WorkItemDirectory>$([MSBuild]::NormalizeDirectory('$(ArtifactsObjDir)', '$(IlcHostPlatform)-$(Configuration)-NativeAOT-LLVM-HelixTestPayload'))</WorkItemDirectory>
</PropertyGroup>

<Error Text="Only WASI SDK supported for $(IlcHostPlatform)" Condition="'$(TestTargetOS)' != 'wasi'" />

<ItemGroup>
<PackageFile Include="$(ArtifactsShippingPackagesDir)*" />
<SampleProjectFile Include="$(RepoRoot)samples/**/*" />
</ItemGroup>

<RemoveDir Directories="$(WorkItemDirectory)" />
<Copy SourceFiles="@(PackageFile)" DestinationFolder="$(WorkItemDirectory)pkg-src" />
<Copy SourceFiles="@(SampleProjectFile)" DestinationFolder="$(WorkItemDirectory)samples/%(RecursiveDir)" Condition="'%(Filename)%(Extension)' != 'nuget.config'" />
<Exec Command="pwsh install-wasi-sdk.ps1 -InstallDir $(WorkItemDirectory) -HostArch $(TargetArchitecture)" Condition="'$(TestTargetOS)' == 'wasi'" />

<!-- Windows WASI SDK is very heavy due to **many** clang copies. Remove them for better upload times. -->
<Delete Files="$(WorkItemDirectory)wasi-sdk/bin/wasm32-wasi-clang$(ExeExt);
$(WorkItemDirectory)wasi-sdk/bin/wasm32-wasi-clang++$(ExeExt);
$(WorkItemDirectory)wasi-sdk/bin/wasm32-wasi-threads-clang$(ExeExt);
$(WorkItemDirectory)wasi-sdk/bin/wasm32-wasi-threads-clang++$(ExeExt);
$(WorkItemDirectory)wasi-sdk/bin/wasm32-wasip1-clang$(ExeExt);
$(WorkItemDirectory)wasi-sdk/bin/wasm32-wasip1-clang++$(ExeExt);
$(WorkItemDirectory)wasi-sdk/bin/wasm32-wasip1-threads-clang$(ExeExt);
$(WorkItemDirectory)wasi-sdk/bin/wasm32-wasip1-threads-clang++$(ExeExt);
$(WorkItemDirectory)wasi-sdk/bin/wasm32-wasip2-clang$(ExeExt);
$(WorkItemDirectory)wasi-sdk/bin/wasm32-wasip2-clang++$(ExeExt);
$(WorkItemDirectory)wasi-sdk/bin/clang-tidy$(ExeExt);
$(WorkItemDirectory)wasi-sdk/bin/clang-cpp$(ExeExt);
$(WorkItemDirectory)wasi-sdk/bin/clang-cl$(ExeExt);
$(WorkItemDirectory)wasi-sdk/bin/ld.lld$(ExeExt);
$(WorkItemDirectory)wasi-sdk/bin/ld64.lld$(ExeExt);
$(WorkItemDirectory)wasi-sdk/bin/lld-link$(ExeExt)" />

<PropertyGroup Condition="'$(WindowsShell)' == 'true'">
<HelixPreCommands>set RestoreAdditionalProjectSources=%HELIX_WORKITEM_PAYLOAD%\pkg-src</HelixPreCommands>
<HelixPreCommands Condition="'$(TestTargetOS)' == 'wasi'">$(HelixPreCommands);set WASI_SDK_PATH=%HELIX_WORKITEM_PAYLOAD%\wasi-sdk</HelixPreCommands>
<HelixCommand>
dotnet publish %HELIX_WORKITEM_PAYLOAD%\samples\HelloWorld\HelloWorld.csproj -c $(Configuration) -r $(TestTargetRid) &amp;&amp;^
dotnet publish %HELIX_WORKITEM_PAYLOAD%\samples\NativeLibrary\NativeLibrary.csproj -c $(Configuration) -r $(TestTargetRid)
</HelixCommand>
</PropertyGroup>

<PropertyGroup Condition="'$(WindowsShell)' != 'true'">
<HelixPreCommands>export RestoreAdditionalProjectSources=$HELIX_WORKITEM_PAYLOAD/pkg-src</HelixPreCommands>
<HelixPreCommands Condition="'$(TestTargetOS)' == 'wasi'">$(HelixPreCommands);export WASI_SDK_PATH=$HELIX_WORKITEM_PAYLOAD/wasi-sdk</HelixPreCommands>
<HelixPreCommands Condition="'$(TestTargetOS)' == 'wasi'">$(HelixPreCommands);chmod +x $WASI_SDK_PATH/bin/*</HelixPreCommands>
<HelixCommand>
dotnet publish $HELIX_WORKITEM_PAYLOAD/samples/HelloWorld/HelloWorld.csproj -c $(Configuration) -r $(TestTargetRid) &amp;&amp;\
dotnet publish $HELIX_WORKITEM_PAYLOAD/samples/NativeLibrary/NativeLibrary.csproj -c $(Configuration) -r $(TestTargetRid)
</HelixCommand>
</PropertyGroup>

<ItemGroup>
<HelixWorkItem Include="NativeAOT-LLVM-$(IlcHostPlatform)-ILC-SmokeTest">
<Command>$(HelixCommand)</Command>
<PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory>
<Timeout>01:00:00</Timeout>
</HelixWorkItem>
</ItemGroup>

<Message Text="HelixWorkItem: %(HelixWorkItem.Identity)
PreCommands: $(HelixPreCommands)
Command: %(HelixWorkItem.Command)
PayloadDirectory: %(HelixWorkItem.PayloadDirectory)" Importance="High" />

<Error Text="Stopping the build for dry run" Condition="'$(HelixDryRun)' == 'true'" />
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 0 additions & 19 deletions eng/pipelines/runtimelab/set-ilc-emulation-environment.ps1

This file was deleted.

Loading