From 7211c6c09bcaef6bc724a35b1a0dac510c2c1060 Mon Sep 17 00:00:00 2001 From: Rudraksh Joshi Date: Mon, 13 Apr 2026 15:29:49 +0530 Subject: [PATCH 1/4] ci: test upcoming Cranelift release branch --- .../workflows/cranelift-release-branch.yml | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 .github/workflows/cranelift-release-branch.yml diff --git a/.github/workflows/cranelift-release-branch.yml b/.github/workflows/cranelift-release-branch.yml new file mode 100644 index 0000000000..2d597be22a --- /dev/null +++ b/.github/workflows/cranelift-release-branch.yml @@ -0,0 +1,119 @@ +name: Test upcoming Cranelift release branch + +on: + schedule: + # Run daily so we don't miss the release branch cut. + - cron: "0 3 * * *" + workflow_dispatch: {} + +defaults: + run: + shell: bash + +permissions: {} + +env: + CARGO_BUILD_INCREMENTAL: false + RUSTFLAGS: "-Dwarnings" + +jobs: + test_upcoming_cranelift_release: + runs-on: ubuntu-latest + timeout-minutes: 90 + + steps: + - uses: actions/checkout@v6 + + - name: Determine latest Wasmtime release branch + id: wasmtime_release_branch + run: | + set -euo pipefail + branches="$( + git ls-remote --heads https://github.com/bytecodealliance/wasmtime.git "refs/heads/release-*" \ + | awk '{print $2}' \ + | sed 's#refs/heads/##' \ + | sort -V + )" + if [[ -z "${branches}" ]]; then + echo "No wasmtime release branches found" + exit 1 + fi + latest="$(echo "${branches}" | tail -n 1)" + echo "Latest release branch: ${latest}" + echo "branch=${latest}" >> "$GITHUB_OUTPUT" + + - name: Skip if already tested + id: tested_cache + uses: actions/cache@v5 + with: + path: .ci/cranelift-release-tested + key: cranelift-release-tested-${{ steps.wasmtime_release_branch.outputs.branch }} + + - name: Mark tested (cache payload) + if: steps.tested_cache.outputs.cache-hit != 'true' + run: | + mkdir -p .ci/cranelift-release-tested + echo "${{ steps.wasmtime_release_branch.outputs.branch }}" > .ci/cranelift-release-tested/branch.txt + + - name: Patch Cargo.toml to use release branch Cranelift + if: steps.tested_cache.outputs.cache-hit != 'true' + run: | + set -euo pipefail + branch="${{ steps.wasmtime_release_branch.outputs.branch }}" + + python3 - <<'PY' + import pathlib, re, os + cargo_toml = pathlib.Path("Cargo.toml") + s = cargo_toml.read_text(encoding="utf-8") + + branch = os.environ["WASMTIME_RELEASE_BRANCH"] + patch_lines = "\n".join([ + f'cranelift-codegen = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}', + f'cranelift-frontend = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}', + f'cranelift-module = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}', + f'cranelift-native = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}', + f'cranelift-jit = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}', + f'cranelift-object = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}', + ]) + + # Ensure a [patch.crates-io] section exists. + if "[patch.crates-io]" not in s: + s += "\n\n[patch.crates-io]\n" + + # Remove any previous CI-inserted patch block. + s = re.sub( + r"(?ms)^\n?# BEGIN CI WASMTIME RELEASE PATCH\n.*?^\# END CI WASMTIME RELEASE PATCH\n", + "\n", + s, + ) + + # Insert immediately after the [patch.crates-io] header. + s = re.sub( + r"(?m)^\[patch\.crates-io\]\s*$", + "[patch.crates-io]\n" + "# BEGIN CI WASMTIME RELEASE PATCH\n" + f"{patch_lines}\n" + "# END CI WASMTIME RELEASE PATCH", + s, + count=1, + ) + + cargo_toml.write_text(s, encoding="utf-8") + PY + env: + WASMTIME_RELEASE_BRANCH: ${{ steps.wasmtime_release_branch.outputs.branch }} + + - name: Prepare dependencies + if: steps.tested_cache.outputs.cache-hit != 'true' + run: ./y.sh prepare + + - name: Build (sysroot none) + if: steps.tested_cache.outputs.cache-hit != 'true' + run: ./y.sh build --sysroot none + + - name: Test + if: steps.tested_cache.outputs.cache-hit != 'true' + env: + TARGET_TRIPLE: x86_64-unknown-linux-gnu + run: ./y.sh test + From 31911e0769b0e6013a2c37c42f3106e615a9c864 Mon Sep 17 00:00:00 2001 From: Rudraksh Joshi Date: Thu, 16 Apr 2026 16:17:02 +0530 Subject: [PATCH 2/4] address review comments --- .../workflows/cranelift-release-branch.yml | 60 +++---------------- 1 file changed, 9 insertions(+), 51 deletions(-) diff --git a/.github/workflows/cranelift-release-branch.yml b/.github/workflows/cranelift-release-branch.yml index 2d597be22a..d1f19d4b99 100644 --- a/.github/workflows/cranelift-release-branch.yml +++ b/.github/workflows/cranelift-release-branch.yml @@ -2,14 +2,9 @@ name: Test upcoming Cranelift release branch on: schedule: - # Run daily so we don't miss the release branch cut. - - cron: "0 3 * * *" + - cron: "0 3 6 * *" workflow_dispatch: {} -defaults: - run: - shell: bash - permissions: {} env: @@ -42,77 +37,40 @@ jobs: echo "Latest release branch: ${latest}" echo "branch=${latest}" >> "$GITHUB_OUTPUT" - - name: Skip if already tested - id: tested_cache - uses: actions/cache@v5 - with: - path: .ci/cranelift-release-tested - key: cranelift-release-tested-${{ steps.wasmtime_release_branch.outputs.branch }} - - - name: Mark tested (cache payload) - if: steps.tested_cache.outputs.cache-hit != 'true' - run: | - mkdir -p .ci/cranelift-release-tested - echo "${{ steps.wasmtime_release_branch.outputs.branch }}" > .ci/cranelift-release-tested/branch.txt - - name: Patch Cargo.toml to use release branch Cranelift - if: steps.tested_cache.outputs.cache-hit != 'true' run: | set -euo pipefail - branch="${{ steps.wasmtime_release_branch.outputs.branch }}" - python3 - <<'PY' - import pathlib, re, os + import pathlib + import os + cargo_toml = pathlib.Path("Cargo.toml") s = cargo_toml.read_text(encoding="utf-8") branch = os.environ["WASMTIME_RELEASE_BRANCH"] - patch_lines = "\n".join([ + patch_block = "\n".join([ + "", + "[patch.crates-io]", f'cranelift-codegen = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}', f'cranelift-frontend = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}', f'cranelift-module = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}', f'cranelift-native = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}', f'cranelift-jit = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}', f'cranelift-object = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}', + "", ]) - - # Ensure a [patch.crates-io] section exists. - if "[patch.crates-io]" not in s: - s += "\n\n[patch.crates-io]\n" - - # Remove any previous CI-inserted patch block. - s = re.sub( - r"(?ms)^\n?# BEGIN CI WASMTIME RELEASE PATCH\n.*?^\# END CI WASMTIME RELEASE PATCH\n", - "\n", - s, - ) - - # Insert immediately after the [patch.crates-io] header. - s = re.sub( - r"(?m)^\[patch\.crates-io\]\s*$", - "[patch.crates-io]\n" - "# BEGIN CI WASMTIME RELEASE PATCH\n" - f"{patch_lines}\n" - "# END CI WASMTIME RELEASE PATCH", - s, - count=1, - ) - - cargo_toml.write_text(s, encoding="utf-8") + cargo_toml.write_text(s.rstrip() + patch_block, encoding="utf-8") PY env: WASMTIME_RELEASE_BRANCH: ${{ steps.wasmtime_release_branch.outputs.branch }} - name: Prepare dependencies - if: steps.tested_cache.outputs.cache-hit != 'true' run: ./y.sh prepare - name: Build (sysroot none) - if: steps.tested_cache.outputs.cache-hit != 'true' run: ./y.sh build --sysroot none - name: Test - if: steps.tested_cache.outputs.cache-hit != 'true' env: TARGET_TRIPLE: x86_64-unknown-linux-gnu run: ./y.sh test From b763edd6253770900772dad6c3337894d9ddb6dc Mon Sep 17 00:00:00 2001 From: Rudraksh Joshi <127816064+0xmuon@users.noreply.github.com> Date: Tue, 28 Apr 2026 23:59:39 +0530 Subject: [PATCH 3/4] Apply suggestion from @bjorn3 Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com> --- .../workflows/cranelift-release-branch.yml | 31 ++++++------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/.github/workflows/cranelift-release-branch.yml b/.github/workflows/cranelift-release-branch.yml index d1f19d4b99..939877b47d 100644 --- a/.github/workflows/cranelift-release-branch.yml +++ b/.github/workflows/cranelift-release-branch.yml @@ -39,28 +39,15 @@ jobs: - name: Patch Cargo.toml to use release branch Cranelift run: | - set -euo pipefail - python3 - <<'PY' - import pathlib - import os - - cargo_toml = pathlib.Path("Cargo.toml") - s = cargo_toml.read_text(encoding="utf-8") - - branch = os.environ["WASMTIME_RELEASE_BRANCH"] - patch_block = "\n".join([ - "", - "[patch.crates-io]", - f'cranelift-codegen = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}', - f'cranelift-frontend = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}', - f'cranelift-module = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}', - f'cranelift-native = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}', - f'cranelift-jit = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}', - f'cranelift-object = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}', - "", - ]) - cargo_toml.write_text(s.rstrip() + patch_block, encoding="utf-8") - PY + cat >>Cargo.toml < Date: Wed, 29 Apr 2026 00:00:47 +0530 Subject: [PATCH 4/4] Apply suggestion from @bjorn3 Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com> --- .github/workflows/cranelift-release-branch.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cranelift-release-branch.yml b/.github/workflows/cranelift-release-branch.yml index 939877b47d..7c216f0a4d 100644 --- a/.github/workflows/cranelift-release-branch.yml +++ b/.github/workflows/cranelift-release-branch.yml @@ -22,7 +22,6 @@ jobs: - name: Determine latest Wasmtime release branch id: wasmtime_release_branch run: | - set -euo pipefail branches="$( git ls-remote --heads https://github.com/bytecodealliance/wasmtime.git "refs/heads/release-*" \ | awk '{print $2}' \