feat: add setup_script hook to prepare-release reusable workflow#8
Conversation
The `prepare-release.yml` reusable workflow installs a fixed set of
release tools and then invokes `holochain_release_util prepare`,
which in turn runs `cargo-semver-checks` against the workspace.
Workspaces that contain crates with native build dependencies (an
LLVM toolchain for `llvm-sys`, system libraries pulled in via
`bindgen`, etc.) cannot use this workflow today: the prepare step
fails before semver checks can run because the runner has no LLVM /
no libfoo / no whatever installed, and there is no way to inject a
setup step from the call site of a reusable workflow.
The motivating case is `holochain/holochain-wasmer`, whose host
crate has a `wasmer-sys-llvm` cargo feature that pulls in
`llvm-sys = "211"`. Today the only options for that repo are (a)
fork the entire reusable workflow locally and add an LLVM install
step, taking on permanent drift risk against this upstream, or (b)
pass `--i-am-so-sorry-but-my-features-clash` via
`extra_release_util_args`, which downgrades semver coverage to
default-features-only. Both are workarounds for a missing extension
point in the reusable workflow itself.
Add an optional `setup_script` input. When set, it runs as a bash
step on the runner immediately after checkout and before any of the
release tooling is installed. The script can install system tools,
download toolchains, and write to `$GITHUB_ENV` to set environment
variables that subsequent steps (including the `Prepare release`
step) will see.
Placement is "after checkout, before tool installs" so that the
script can affect the environment that the cargo tool installs see,
and so that callers get a clean repo state to work with. The step
is gated on `inputs.setup_script != ''` so the workflow's behaviour
for callers that don't set it is byte-identical to the previous
version — no risk of regressing existing consumers.
After this lands and a new release of `holochain/actions` is cut,
`holochain/holochain-wasmer` can replace its
`extra_release_util_args` workaround with:
setup_script: |
LLVM_DIR=$PWD/.llvm
mkdir -p "$LLVM_DIR"
curl --proto '=https' --tlsv1.2 -sSf \
"https://github.com/wasmerio/llvm-custom-builds/releases/download/21.x/llvm-linux-amd64.tar.xz" \
-L -o - | tar xJ -C "$LLVM_DIR"
echo "LLVM_SYS_211_PREFIX=$LLVM_DIR" >> "$GITHUB_ENV"
and recover full `--all-features` semver coverage.
|
✔️ 99a0525 - Conventional commits check succeeded. |
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 16 minutes and 8 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bumps the call into `holochain/actions/.github/workflows/prepare-release.yml` from `@v1.6.0` to `@v1.7.0`, which adds an optional `setup_script` input (holochain/actions#8). Use that hook to download the same prebuilt LLVM 21 bundle the Windows test job already uses and export `LLVM_SYS_211_PREFIX` into `$GITHUB_ENV` so the `Prepare release` step can build the host crate with `--all-features` enabled — including `wasmer-sys-llvm`, which transitively pulls in `llvm-sys = "211"` and fails out without an LLVM toolchain on disk. Replaces the previous tactical workaround that passed `--i-am-so-sorry-but-my-features-clash` via `extra_release_util_args` to downgrade `cargo-semver-checks` to `--default-features` only. With the LLVM toolchain available, semver checks now run against the full feature matrix again and we get the coverage that the non-default backends (`wasmer-sys-llvm`, `wasmer-wasmi`, `debug-memory`) deserve. The inline comment in the workflow file documents the why so this doesn't get reverted by accident the next time someone wonders why the release workflow is downloading LLVM.
Bumps the call into `holochain/actions/.github/workflows/prepare-release.yml` from `@v1.6.0` to `@v1.7.0`, which adds an optional `setup_script` input (holochain/actions#8). Use that hook to download the same prebuilt LLVM 21 bundle the Windows test job already uses and export `LLVM_SYS_211_PREFIX` into `$GITHUB_ENV` so the `Prepare release` step can build the host crate with `--all-features` enabled — including `wasmer-sys-llvm`, which transitively pulls in `llvm-sys = "211"` and fails out without an LLVM toolchain on disk. Replaces the previous tactical workaround that passed `--i-am-so-sorry-but-my-features-clash` via `extra_release_util_args` to downgrade `cargo-semver-checks` to `--default-features` only. With the LLVM toolchain available, semver checks now run against the full feature matrix again and we get the coverage that the non-default backends (`wasmer-sys-llvm`, `wasmer-wasmi`, `debug-memory`) deserve. The inline comment in the workflow file documents the why so this doesn't get reverted by accident the next time someone wonders why the release workflow is downloading LLVM.
Summary
Adds an optional `setup_script` input to `prepare-release.yml` that runs as a bash step on the runner immediately after checkout and before any of the release tooling is installed. The script can install system tools, download toolchains, and write to `$GITHUB_ENV` to set environment variables that subsequent steps (including the `Prepare release` step) will see.
Why
The reusable workflow installs a fixed set of release tools and then invokes `holochain_release_util prepare`, which runs `cargo-semver-checks` against the workspace. Workspaces that contain crates with native build dependencies (an LLVM toolchain for `llvm-sys`, system libraries pulled in via bindgen, etc.) cannot use this workflow today: the prepare step fails before semver checks can run because the runner has no LLVM / no libfoo / no whatever installed, and there is no way to inject a setup step from the call site of a reusable workflow — GitHub Actions has no "steps before a reusable workflow" composition mechanism.
The motivating case is `holochain/holochain-wasmer`, whose host crate has a `wasmer-sys-llvm` cargo feature that pulls in `llvm-sys = "211"`. Today the only options for that repo are:
Both are workarounds for a missing extension point in the reusable workflow itself. After this hook lands and a new release of `holochain/actions` is cut, holochain-wasmer can replace its `extra_release_util_args` workaround with:
```yaml
setup_script: |
LLVM_DIR=$PWD/.llvm
mkdir -p "$LLVM_DIR"
curl --proto '=https' --tlsv1.2 -sSf \
"https://github.com/wasmerio/llvm-custom-builds/releases/download/21.x/llvm-linux-amd64.tar.xz\" \
-L -o - | tar xJ -C "$LLVM_DIR"
echo "LLVM_SYS_211_PREFIX=$LLVM_DIR" >> "$GITHUB_ENV"
```
…and recover full `--all-features` semver coverage.
Design notes
Test plan