Skip to content

[Homebrew/Security] Keep Formula runtime packages in one verified generation - #1084

Merged
brandonpayton merged 1 commit into
mainfrom
homebrew/formula-runtime-portable-cache-qk044
Jul 24, 2026
Merged

[Homebrew/Security] Keep Formula runtime packages in one verified generation#1084
brandonpayton merged 1 commit into
mainfrom
homebrew/formula-runtime-portable-cache-qk044

Conversation

@brandonpayton

@brandonpayton brandonpayton commented Jul 24, 2026

Copy link
Copy Markdown
Member

Why

Formula tests run as an isolated user against a read-only Kandelo checkout. The publisher was copying only the resolved executable bytes into that checkout. That made the executables readable, but it discarded the package-generation identity used by the resolver to prevent unrelated package builds from being mixed together.

A fresh Asa canary exposed the problem when its test needed /bin/sh: Dash had been fetched, but its flattened mirror was correctly rejected as an identityless source-checkout file.

What changes

  • Copy each complete content-addressed package generation into a portable .ci-test-binary-cache beside binaries/.
  • Keep program mirrors as contained relative symlinks into that cache.
  • Share one staging helper between prepared CI workspaces and isolated Formula tests.
  • Materialize the verifier cache after the browser graph finishes resolving packages, so it is the final writer to binaries/.
  • Preserve the complete replacement if deleting the old link tree fails partway through; restoring a partially deleted backup would be unsafe.
  • Classify this transport as binary-materialization work and document the resolver contract.

Validation

  • bash scripts/test-materialize-resolver-binaries.sh
  • .github/actions/detect-change-scope/test-ci-scope-paths.sh
  • tests/scripts/ci-run-test-suite-groups.test.sh
  • host/test/binary-resolver.test.ts: 68 tests passed, including relocation
  • scripts/check-homebrew-publish-workflow-trust.rb
  • scripts/test-homebrew-publish-workflow.sh
  • shell syntax checks and git diff --check

The rollback suite includes injected original-rename and partial-backup-deletion failures. The trust suite enforces that no package resolver rewrites binaries/ between portable-cache materialization and isolated verification.

Rollout

This is stacked on #1082 because it relies on the root-owned checker and authenticated source-root boundary introduced there. Before changing the tap publisher pin, the exact head still needs the privileged Ubuntu preflight. A fresh Asa canary will then prove source build, Formula test, public bottle/index publication, anonymous pour, and immutable VFS finalization end to end.

…tests

Carry complete content-addressed package generations into the read-only Formula runtime instead of flattening resolver mirrors into identityless files. Share the portable staging helper with prepared CI workspaces, bind tap runners to the authenticated cache root, and make materialization the verifier’s final binaries writer.

Harden the replacement transaction against partial backup deletion and cover noncanonical links, escaping generation content, relocation, order changes, and rollback failures.
Base automatically changed from homebrew/formula-xtask-authority-qk044 to main July 24, 2026 21:16
@brandonpayton
brandonpayton merged commit 4274178 into main Jul 24, 2026
12 of 16 checks passed
@brandonpayton
brandonpayton deleted the homebrew/formula-runtime-portable-cache-qk044 branch July 24, 2026 21:16
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