Skip to content

Add Bazel verify-release-build job#17705

Merged
bolinfest merged 1 commit intomainfrom
pr17705
Apr 14, 2026
Merged

Add Bazel verify-release-build job#17705
bolinfest merged 1 commit intomainfrom
pr17705

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Apr 13, 2026

Why

main recently needed #17691 because code behind cfg(not(debug_assertions)) was not being compiled by the Bazel PR workflow. Our existing CI only built the fast/debug configuration, so PRs could stay green while release-only Rust code still failed to compile. This PR adds a release-style compile check that is cheap enough to run on every PR.

What Changed

  • Added a verify-release-build job to .github/workflows/bazel.yml.
  • Represented each supported OS once in that job's matrix: x64 Linux, arm64 macOS, and x64 Windows.
  • Kept the build close to fastbuild cost by using --compilation_mode=fastbuild while forcing Rust to compile with -Cdebug-assertions=no, which makes cfg(not(debug_assertions)) true without also turning on release optimizations or debug-info generation.
  • Added comments in .github/workflows/bazel.yml and scripts/list-bazel-release-targets.sh to make the job's intent and target scope explicit.
  • Restored the Bazel repository cache save behavior to run after every non-cancelled job, matching #16926, and removed the now-unused repository-cache-hit output from prepare-bazel-ci.
  • Reused the shared prepare-bazel-ci action from the parent PR so the new job does not duplicate Bazel setup boilerplate.

Verification

  • Used bazel aquery on //codex-rs/tui:codex-tui to confirm the Rust compile still uses opt-level=0 and debuginfo=0 while passing -Cdebug-assertions=no.
  • Parsed .github/workflows/bazel.yml as YAML locally.
  • Ran bash -n scripts/list-bazel-release-targets.sh.

@bolinfest bolinfest changed the base branch from main to pr17704 April 13, 2026 22:26
bolinfest added a commit that referenced this pull request Apr 14, 2026
## Why

This stack adds a new Bazel CI lane that verifies Rust code behind
`cfg(not(debug_assertions))`, but adding that job directly to
`.github/workflows/bazel.yml` would duplicate the same setup in multiple
places. Extracting the shared setup first keeps the follow-up change
easier to review and reduces the chance that future Bazel workflow edits
drift apart.

## What Changed

- Added `.github/actions/prepare-bazel-ci/action.yml` as a composite
action for the Bazel job bootstrap shared by multiple workflow jobs.
- Moved the existing Bazel setup, repository-cache restore, and
execution-log setup behind that action.
- Updated the `test` and `clippy` jobs in `.github/workflows/bazel.yml`
to call `prepare-bazel-ci`.
- Exposed `repository-cache-hit` and `repository-cache-path` outputs so
callers can keep the existing cache-save behavior without duplicating
the restore step.

## Verification

- Parsed `.github/workflows/bazel.yml` as YAML locally after rebasing
the stack.
- CI will exercise the refactored jobs end to end.

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/17704).
* #17705
* __->__ #17704
Base automatically changed from pr17704 to main April 14, 2026 19:37
@bolinfest bolinfest force-pushed the pr17705 branch 2 times, most recently from 0b6df04 to 21f484a Compare April 14, 2026 19:54
@euroelessar
Copy link
Copy Markdown
Collaborator

we may need to separate bazel cache snapshots for release build vs regular build as they produce different artifacts (and there is only one snapshot per key, so first one wins or smth)

@bolinfest bolinfest merged commit 5ecaf09 into main Apr 14, 2026
48 of 61 checks passed
@bolinfest bolinfest deleted the pr17705 branch April 14, 2026 22:36
@github-actions github-actions bot locked and limited conversation to collaborators Apr 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants