linux-riscv64 dotnet-runtime aot #28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: linux-riscv64 dotnet-runtime aot | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Make space for runtime build # we only need docker on the host | |
| run: | | |
| df -h | |
| sudo rm -rf \ | |
| "$AGENT_TOOLSDIRECTORY" \ | |
| /opt/google/chrome \ | |
| /opt/microsoft/msedge \ | |
| /opt/microsoft/powershell \ | |
| /opt/pipx \ | |
| /usr/lib/mono \ | |
| /usr/local/julia* \ | |
| /usr/local/lib/android \ | |
| /usr/local/lib/node_modules \ | |
| /usr/local/share/chromium \ | |
| /usr/local/share/powershell \ | |
| /usr/share/dotnet \ | |
| /usr/share/swift | |
| df -h | |
| - name: runtime, libs and nativeaot smoke tests build | |
| run: | | |
| git clone https://github.com/dotnet/runtime --single-branch --depth 1 | |
| docker run --rm -v$(pwd)/runtime:/runtime -e ROOTFS_DIR=/crossrootfs/riscv64 \ | |
| mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-cross-riscv64 \ | |
| sh -c ' | |
| curl -sSL https://github.com/dotnet/runtime/pull/113179.patch | git -C /runtime apply - && | |
| echo "Building for target..." && | |
| /runtime/build.sh -ci -arch riscv64 -cross -s clr+libs+host -c Debug -rc Checked --keepnativesymbols true -p:StageOneBuild=true && | |
| /runtime/build.sh -ci -arch riscv64 -cross -s tools+clr.tools+tools.illink -c Debug -rc Checked --keepnativesymbols true -p:StageTwoBuild=true && | |
| echo "Building for host..." && | |
| tdnf install -y cmake llvm lld lldb clang python curl libicu-devel openssl-devel krb5-devel lttng-ust-devel pigz cpio && | |
| /runtime/build.sh -ci -arch x64 -s clr+libs -c Debug -rc Checked --keepnativesymbols true && | |
| echo "Building smoke tests..." && | |
| cp /runtime/artifacts/bin/coreclr/linux.riscv64.Checked/x64/libclrjit_unix_riscv64_x64.so /runtime/artifacts/bin/coreclr/linux.x64.Checked/ilc-published && | |
| cp /runtime/artifacts/bin/coreclr/linux.x64.Checked/ilc-published/ilc /runtime/artifacts/bin/coreclr/linux.riscv64.Checked/x64/ilc/ilc && | |
| SysRoot=$ROOTFS_DIR LinkerFlavor=lld /runtime/src/tests/build.sh -ci -riscv64 -cross -nativeaot -tree:nativeaot -Checked -p:TasksConfiguration=Debug -p:LibrariesConfiguration=Debug -keepnativesymbols -p:UseLocalAppHostPack=true -p:UseNativeAotForComponents=true -p:TestNativeAot=true | |
| ' | |
| - name: run tests in qemu | |
| run: | | |
| docker run --privileged --rm tonistiigi/binfmt --install all | |
| docker run --rm -v$(pwd)/runtime:/runtime -e ROOTFS_DIR=/crossrootfs/riscv64 \ | |
| -e CORE_ROOT=/runtime/artifacts/tests/coreclr/linux.riscv64.Checked/Tests/Core_Root \ | |
| --platform linux/riscv64 ubuntu \ | |
| bash -c ' | |
| apt update && apt install -y file llvm && | |
| mkdir -p $CORE_ROOT/SuperFileCheck/runtimes/linux-riscv64/native && | |
| ln -s /usr/bin/llvm-dwarfdump $CORE_ROOT/SuperFileCheck/runtimes/linux-riscv64/native; | |
| fail=0; | |
| while IFS=: read -r test _; do | |
| echo "Running $test..."; | |
| pushd "$(dirname $test)/.."; | |
| "$test"; | |
| exitcode=$?; | |
| popd; | |
| if [ "$exitcode" -ne 100 ]; then | |
| echo "$test failed with exit code $exitcode"; | |
| fail=1; | |
| fi; | |
| done < <(find /runtime/artifacts/tests/coreclr/linux.riscv64.Checked/nativeaot/SmokeTests -path "*/native/*" -type f -exec file {} \; | grep ELF.*executable); | |
| if [ "$fail" -eq 1 ]; then exit 1; fi | |
| ' |