From e6a833783ae7d864e89f06c41ee300680ad46719 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 27 Jan 2025 09:30:56 -0600 Subject: [PATCH] Pin CI runner images to explicit versions (#507) * Pin CI runner images to explicit versions CI is run infrequently enough on this repository that there's a nontrivial chance that GitHub updates the definition of `ubuntu-latest` for example between two CI runs. This can be confusing for contributors as PRs seemingly break CI when in reality they have nothing to do with the breakage and it's due to the image changing. This PR pins all images to the definition of `*-latest` at this time. The one exception is that one builder was pinned to 22.04 and I'm going to update it to 24.04 here and see if I can't fix CI issues that come up. This'll require explicit PRs to update these images in the future, but hopefully that's only once every few ~years so not too much of a burden. * Try not custom-installing clang 18 * Try to fix CI issue * Fix CI again (attempt) * Further try to fix CI * Another fix for CI Surely if I keep making commits that say "another fix" eventually I'll run out of fixes. Surely, right? I'd put this in limerick form to be more amusing if someone comes to read this but I'm not clever enough to do that, so instead I'll just abruptly --- .github/workflows/main.yml | 28 ++++++++++++---------------- cmake/wasi-sdk-sysroot.cmake | 8 +++++++- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 520856aae..b1e3c4d3b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,10 +19,10 @@ jobs: matrix: include: - artifact: x86_64-linux - os: ubuntu-latest + os: ubuntu-24.04 - artifact: arm64-linux - os: ubuntu-latest + os: ubuntu-24.04 rust_target: aarch64-unknown-linux-gnu env: # Don't build a sysroot for this cross-compiled target since it @@ -41,7 +41,7 @@ jobs: -DRUST_TARGET=aarch64-unknown-linux-gnu - artifact: arm64-macos - os: macos-latest + os: macos-14 rust_target: aarch64-apple-darwin env: WASI_SDK_CI_TOOLCHAIN_LLVM_CMAKE_ARGS: >- @@ -49,7 +49,7 @@ jobs: -DCMAKE_OSX_ARCHITECTURES=arm64 - artifact: x86_64-macos - os: macos-latest + os: macos-14 rust_target: x86_64-apple-darwin env: WASI_SDK_CI_SKIP_SYSROOT: 1 @@ -58,7 +58,7 @@ jobs: -DCMAKE_OSX_ARCHITECTURES=x86_64 - artifact: x86_64-windows - os: windows-latest + os: windows-2022 env: ${{ matrix.env || fromJSON('{}') }} steps: @@ -165,25 +165,21 @@ jobs: build-only-sysroot: name: Build only sysroot - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: ./.github/actions/checkout - uses: ./.github/actions/install-deps - - run: | - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - name=$(lsb_release -s -c) - sudo add-apt-repository -y "deb http://apt.llvm.org/$name/ llvm-toolchain-$name-18 main" - sudo add-apt-repository -y "deb-src http://apt.llvm.org/$name/ llvm-toolchain-$name-18 main" - sudo apt-get install -y clang-18 llvm-18 lld-18 - - run: cargo install wasm-component-ld@0.5.5 + - run: cargo install wasm-component-ld@0.5.12 - run: | cmake -G Ninja -B build -S . \ -DCMAKE_C_COMPILER=/usr/lib/llvm-18/bin/clang \ -DCMAKE_SYSTEM_NAME=WASI \ - -DWASI_SDK_INCLUDE_TESTS=ON + -DWASI_SDK_INCLUDE_TESTS=ON \ + -DCMAKE_C_LINKER_DEPFILE_SUPPORTED=OFF \ + -DCMAKE_CXX_LINKER_DEPFILE_SUPPORTED=OFF - run: ninja -C build - run: ctest --output-on-failure --parallel 10 --test-dir build/tests @@ -193,7 +189,7 @@ jobs: finalize: name: Finalize wasi-sdk artifacts needs: build - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 with: @@ -253,7 +249,7 @@ jobs: test-standalone: name: Test standalone toolchain needs: build - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 with: diff --git a/cmake/wasi-sdk-sysroot.cmake b/cmake/wasi-sdk-sysroot.cmake index 127ca62d3..0dd475fff 100644 --- a/cmake/wasi-sdk-sysroot.cmake +++ b/cmake/wasi-sdk-sysroot.cmake @@ -47,7 +47,13 @@ set(default_cmake_args -DCMAKE_C_COMPILER_WORKS=ON -DCMAKE_CXX_COMPILER_WORKS=ON -DCMAKE_SYSROOT=${wasi_sysroot} - -DCMAKE_MODULE_PATH=${CMAKE_CURRENT_SOURCE_DIR}/cmake) + -DCMAKE_MODULE_PATH=${CMAKE_CURRENT_SOURCE_DIR}/cmake + # CMake detects this based on `CMAKE_C_COMPILER` alone and when that compiler + # is just a bare "clang" installation then it can mistakenly deduce that this + # feature is supported when it's not actually supported for WASI targets. + # Currently `wasm-ld` does not support the linker flag for this. + -DCMAKE_C_LINKER_DEPFILE_SUPPORTED=OFF + -DCMAKE_CXX_LINKER_DEPFILE_SUPPORTED=OFF) if(CMAKE_C_COMPILER_LAUNCHER) list(APPEND default_cmake_args -DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER})