From e7efa87ba1f31b11c2002128d8faf1136f649893 Mon Sep 17 00:00:00 2001 From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com> Date: Fri, 21 Jun 2024 06:00:27 +0900 Subject: [PATCH 1/6] ci: test with cranelift --- .github/workflows/rust.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 41bbae5f..6f04ec3e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -26,6 +26,10 @@ jobs: - rustc_channel: nightly # renovate: rustc-nightly rustc_version: '2024-06-12' + - rustc_channel: nightly + codegen: default + - rustc_channel: nightly + codegen: cranelift runs-on: ${{ matrix.os }} @@ -42,16 +46,25 @@ jobs: rustup component add clippy --toolchain ${{ matrix.rustc_version }} rustup override set ${{ matrix.rustc_version }} fi - - rustup show shell: bash + - name: Install cranelift if necessary + run: | + rustup component add rustc-codegen-cranelift-preview --toolchain nightly-${{ matrix.rustc_version }} + shell: bash + if: ${{ matrix.codegen == 'cranelift' && matrix.rustc_channel == 'nightly' }} - name: Rust Cache uses: Swatinem/rust-cache@v2.7.3 with: prefix-key: ${{ matrix.os }}-${{ matrix.rustc_version }}-${{ env.CI_RUST_CACHE_VERSION }}-${{ hashFiles('**/Cargo.lock') }} # See rust-wasm.yml for CI details about those package + - name: Setup codegen unstable flag + run: | + printf 'CODEGEN_SELECTION=-Zcodegen-backend=cranelift' >> "$GITHUB_ENV" + if: ${{ matrix.codegen == 'cranelift' && matrix.rustc_channel == 'nightly' }} - name: Build package run: cargo build --workspace --exclude origlang-interop --exclude origlang-interop-frontend-webserver --verbose + env: + RUSTFLAGS: '${{ env.CODEGEN_SELECTION }}' - name: Lint with clippy run: cargo clippy --workspace --exclude origlang-interop --exclude origlang-interop-frontend-webserver --verbose - name: Run tests From 0dfa694e77d64a0d4ed6bcf1c12e973d3a9bdc36 Mon Sep 17 00:00:00 2001 From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com> Date: Fri, 21 Jun 2024 06:05:27 +0900 Subject: [PATCH 2/6] ci: fix --- .github/workflows/rust.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6f04ec3e..88556067 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -26,9 +26,10 @@ jobs: - rustc_channel: nightly # renovate: rustc-nightly rustc_version: '2024-06-12' - - rustc_channel: nightly codegen: default - rustc_channel: nightly + # renovate: rustc-nightly + rustc_version: '2024-06-12' codegen: cranelift runs-on: ${{ matrix.os }} @@ -51,7 +52,7 @@ jobs: run: | rustup component add rustc-codegen-cranelift-preview --toolchain nightly-${{ matrix.rustc_version }} shell: bash - if: ${{ matrix.codegen == 'cranelift' && matrix.rustc_channel == 'nightly' }} + if: ${{ matrix.codegen == 'cranelift' && matrix.rustc_channel == 'nightly' && matrix.os == 'ubuntu-24.04' }} - name: Rust Cache uses: Swatinem/rust-cache@v2.7.3 with: @@ -60,7 +61,7 @@ jobs: - name: Setup codegen unstable flag run: | printf 'CODEGEN_SELECTION=-Zcodegen-backend=cranelift' >> "$GITHUB_ENV" - if: ${{ matrix.codegen == 'cranelift' && matrix.rustc_channel == 'nightly' }} + if: ${{ matrix.codegen == 'cranelift' && matrix.rustc_channel == 'nightly' && matrix.os == 'ubuntu-24.04' }} - name: Build package run: cargo build --workspace --exclude origlang-interop --exclude origlang-interop-frontend-webserver --verbose env: From 2ced1b6dfdc9700b20efe2a3d48f2d8fe439c248 Mon Sep 17 00:00:00 2001 From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com> Date: Fri, 21 Jun 2024 06:10:32 +0900 Subject: [PATCH 3/6] dump context --- .github/workflows/rust.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 88556067..e6059237 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -35,6 +35,9 @@ jobs: runs-on: ${{ matrix.os }} steps: + - name: dump context + run: | + echo '${{ toJSON(matrix) }}' - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 - name: Install compiler ${{ matrix.rustc_channel }} ( ${{ matrix.rustc_version }} ) run: | From f26b1634eb3e95070a9bee8119ad2854c552390c Mon Sep 17 00:00:00 2001 From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com> Date: Fri, 21 Jun 2024 06:31:52 +0900 Subject: [PATCH 4/6] ci: reconstruct matrix to reflect intention --- .github/workflows/rust.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e6059237..f830ca35 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -20,13 +20,17 @@ jobs: os: [ubuntu-24.04, windows-2022] rustc_channel: [stable, nightly] include: + # fix stable version across possible matrix - rustc_channel: stable # renovate: rustc-stable rustc_version: '1.79.0' + # fix nightly version across possible matrix - rustc_channel: nightly # renovate: rustc-nightly rustc_version: '2024-06-12' - codegen: default + # defaults to widely-used classic code generator + - codegen: default + # ... but try cranelift if we're on nightly - rustc_channel: nightly # renovate: rustc-nightly rustc_version: '2024-06-12' From 8f8a6091ed7b1fb5e6dc3581f38a9505d055c263 Mon Sep 17 00:00:00 2001 From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com> Date: Fri, 21 Jun 2024 06:34:30 +0900 Subject: [PATCH 5/6] ci: cause intentional conflict to treat as a separated matrix --- .github/workflows/rust.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f830ca35..7cbdb382 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -19,6 +19,7 @@ jobs: matrix: os: [ubuntu-24.04, windows-2022] rustc_channel: [stable, nightly] + codegen: [default] include: # fix stable version across possible matrix - rustc_channel: stable @@ -28,10 +29,9 @@ jobs: - rustc_channel: nightly # renovate: rustc-nightly rustc_version: '2024-06-12' - # defaults to widely-used classic code generator - - codegen: default - # ... but try cranelift if we're on nightly - - rustc_channel: nightly + # try cranelift if we're on nightly and build for Linux machines + - os: ubuntu-24.04 + rustc_channel: nightly # renovate: rustc-nightly rustc_version: '2024-06-12' codegen: cranelift From ba707520035ce535a345b8f366770a453286c16b Mon Sep 17 00:00:00 2001 From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com> Date: Fri, 21 Jun 2024 06:39:28 +0900 Subject: [PATCH 6/6] ci: update RUSTFLAGS before restoring cache --- .github/workflows/rust.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7cbdb382..ad6b6f87 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -59,20 +59,22 @@ jobs: run: | rustup component add rustc-codegen-cranelift-preview --toolchain nightly-${{ matrix.rustc_version }} shell: bash - if: ${{ matrix.codegen == 'cranelift' && matrix.rustc_channel == 'nightly' && matrix.os == 'ubuntu-24.04' }} + if: ${{ matrix.codegen == 'cranelift' }} + - name: Setup codegen unstable flag + run: | + printf 'CODEGEN_SELECTION=-Zcodegen-backend=cranelift' >> "$GITHUB_ENV" + if: ${{ matrix.codegen == 'cranelift' }} + - name: Build RUSTFLAGS + run: | + printf 'RUSTFLAGS=${{ env.CODEGEN_SELECTION }}' >> "$GITHUB_ENV" + shell: bash - name: Rust Cache uses: Swatinem/rust-cache@v2.7.3 with: prefix-key: ${{ matrix.os }}-${{ matrix.rustc_version }}-${{ env.CI_RUST_CACHE_VERSION }}-${{ hashFiles('**/Cargo.lock') }} # See rust-wasm.yml for CI details about those package - - name: Setup codegen unstable flag - run: | - printf 'CODEGEN_SELECTION=-Zcodegen-backend=cranelift' >> "$GITHUB_ENV" - if: ${{ matrix.codegen == 'cranelift' && matrix.rustc_channel == 'nightly' && matrix.os == 'ubuntu-24.04' }} - name: Build package run: cargo build --workspace --exclude origlang-interop --exclude origlang-interop-frontend-webserver --verbose - env: - RUSTFLAGS: '${{ env.CODEGEN_SELECTION }}' - name: Lint with clippy run: cargo clippy --workspace --exclude origlang-interop --exclude origlang-interop-frontend-webserver --verbose - name: Run tests