Skip to content

[Homebrew] Keep the sealed Formula checker across Homebrew re-exec - #96

Merged
brandonpayton merged 3 commits into
mainfrom
homebrew/formula-checker-env-bridge-qk044
Jul 24, 2026
Merged

[Homebrew] Keep the sealed Formula checker across Homebrew re-exec#96
brandonpayton merged 3 commits into
mainfrom
homebrew/formula-checker-env-bridge-qk044

Conversation

@brandonpayton

@brandonpayton brandonpayton commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Why

Homebrew removes ordinary environment variables before it runs a Formula's
tests. That removed WASM_POSIX_XTASK_BIN, even though the trusted publisher
had selected an exact checker for Kandelo's transitional source-build
attestation. The Formula then fell back to the developer shell, which is not
available inside the isolated publisher and caused the Asa bottle test to fail.

What changes

  • Accept the checker only through the Homebrew-preserved
    HOMEBREW_KANDELO_XTASK_BIN bridge created by
    Automattic/kandelo#1082.
  • Capture and validate the checker before Formula code runs. It must be a
    canonical, root-owned, read-only, single-link file at the publisher's exact
    target/<host>/release/xtask location under the trusted Kandelo checkout, and
    its opened file must still match the inspected file.
  • Freeze the validated path and pass it explicitly as WASM_POSIX_XTASK_BIN to
    all Kandelo Node and browser test runners. Formula environment settings cannot
    replace it.
  • Keep ordinary consumer installs unchanged when the publisher bridge is absent.
  • Pin all live publish, dry-run, maintenance, and rollout trust references to
    the reviewed publisher commit
    ec586b9b3c22034bbbbbac13631e2c4badcb9898.

The tests cover all eight runner paths, a real child process, post-load
environment changes, Formula-supplied overrides, and rejection of missing,
writable, empty, misplaced, invalid-host, out-of-root, symlinked, hard-linked,
and non-root-owned checkers.

Validation

  • brew ruby Kandelo/formula_support/test/kandelo_formula_support_test.rb
    — 102 runs, 1,658 assertions, no failures or errors
  • brew ruby Kandelo/test-workflow-trust.rb — passed
  • PYTHONDONTWRITEBYTECODE=1 python3 -m unittest scripts/test_abi42_rollout.py
    — 41 tests passed
  • actionlint — passed
  • git diff --check — passed
  • exact live-pin audit — seven expected references and no stale live publisher
    reference

A live bottle publication is intentionally not part of this PR's local
validation. The publisher's full suite and independent security review are
green; its privileged Ubuntu preflight remains the rollout gate.

Homebrew rebuilds the environment before Formula tests and drops the ordinary WASM_POSIX_XTASK_BIN bridge. Capture the Homebrew-prefixed alias before Formula code runs, validate and freeze its sealed filesystem identity, and explicitly restore that exact path for every Node and Chromium runner.

Keep ordinary nonpublisher evaluation inert when the bridge is absent. Cover Homebrew filtering, filesystem tampering, mutable environment poisoning, and every runner API surface.
@brandonpayton
brandonpayton merged commit 8b7bb12 into main Jul 24, 2026
1 of 2 checks passed
@brandonpayton
brandonpayton deleted the homebrew/formula-checker-env-bridge-qk044 branch July 24, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant