Skip to content

Update Homebrew formula automation for Linux assets#39

Merged
Kyntrin merged 1 commit into
mainfrom
fix/homebrew-linux-formula-update
Jun 15, 2026
Merged

Update Homebrew formula automation for Linux assets#39
Kyntrin merged 1 commit into
mainfrom
fix/homebrew-linux-formula-update

Conversation

@Kyntrin

@Kyntrin Kyntrin commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • fetch both macOS and Linux release checksum sidecars
  • render the tap formula with platform-specific release assets
  • keep the formula importable on Linux by selecting the active URL during class evaluation

Validation

  • python3 -c 'import yaml; yaml.safe_load(open(".github/workflows/post-release-formula.yml")); print("yaml ok")'
  • swift build --scratch-path .build --cache-path /tmp/swiftpm-cache -Xcc -fmodules-cache-path=/tmp/swift-clang-cache
  • swift test --scratch-path .build --cache-path /tmp/swiftpm-cache -Xcc -fmodules-cache-path=/tmp/swift-clang-cache

Related to #38

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

augur: ✅ PROCEED - risk 30/100

Confidence 70/100 - calibration prior-only (0 incidents / 1 commit).

File Risk Verdict Top signal
.github/workflows/post-release-formula.yml 30 ✅ proceed sensitivity: matches sensitive category 'ci'

@corvid-agent corvid-agent left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve — correct and consistent with the release pipeline

The macOS-only → multi-platform formula switch is sound, and the moving parts line up:

  • The Linux sidecar this depends on already exists. The new step fetches augur-linux-x86_64.sha256 and hard-fails if it's missing; release.yml already builds the static Linux binary and publishes both augur-linux-x86_64 and its .sha256. No gap.
  • Regex-rewrite → full template is the right call. The old in-place patch couldn't express an OS.mac? / else split; regenerating from a fixed template is what makes the formula importable on Linux Homebrew (the stated bug).
  • Security posture preserved. Untrusted values still arrive via env: only and are read through os.environ[...] inside a quoted heredoc — nothing is interpolated into the run-string. Both shas are regex-validated; version derives from the tag.
  • test do block is valid. augur --version emits the configured CLI version (0.4.0), so assert_match version passes.

Two minor, non-blocking notes:

  1. The else branch serves the x86_64 binary to all non-mac platforms, so a Linux arm64 user would receive the x86_64 build. Fine given only x86_64 is built today, but it's an implicit assumption worth a comment.
  2. Regenerating the whole file clobbers any manual edits to Formula/augur.rb in the tap — intended here, just flagging it.

For the record: this change has no impact on fledge-plugin-augur — that plugin links AugurKit via SwiftPM and doesn't use the Homebrew/release-binary path this PR touches.


Generated by Claude Code

@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@Kyntrin Kyntrin force-pushed the fix/homebrew-linux-formula-update branch from d0a8b7f to 4a9698f Compare June 15, 2026 16:06
@Kyntrin

Kyntrin commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

Updated the generated formula template to match the tap changes:

  • declarative on_macos / on_linux blocks
  • Linux URL guarded by on_intel
  • define_method(:install) inside platform/arch blocks so brew audit --strict remains clean
  • shorter Augur desc retained because the previous description exceeds Homebrew's strict audit limit

Reran YAML parsing and validated the generated tap shape via the homebrew-tap PR.

@Kyntrin Kyntrin merged commit 7f9e9a3 into main Jun 15, 2026
11 checks passed
@Kyntrin Kyntrin deleted the fix/homebrew-linux-formula-update branch June 15, 2026 16:28

@corvid-agent corvid-agent left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Post-merge re-review — the final template landed in good shape

Re-reviewed against the merged commit 4a9698f (not the original d0a8b7f I first looked at). The revision is a clear improvement over the initial if OS.mac? / else approach:

  • Declarative on_macos / on_linux + on_arm / on_intel blocks. This resolves the arm64-fallthrough concern from the first pass: Linux is now explicitly guarded by on_intel, so a Linux arm64 host gets no bottle (a clean "unsupported" outcome) rather than being silently handed the x86_64 binary. Correct Homebrew idiom.
  • define_method(:install) inside the platform/arch blocks keeps brew audit --strict clean — def install can't live inside an on_* block. Good catch, and the PR comment documents the why.
  • url "...v#{version}/..." uses Ruby interpolation of the formula's own version rather than re-substituting it from Python — DRY, single source of truth.
  • Security posture intact. Untrusted values still arrive via env: only and are read through os.environ[...] in a quoted heredoc; both shas are regex-validated; version derives from the tag. No run-string interpolation.
  • The Linux sidecar it reads already ships from release.yml (augur-linux-x86_64.sha256), and CI is green (proceed · risk 30/100).

Approving in spirit — already merged. No blocking issues.


Generated by Claude Code

Copy link
Copy Markdown

One small follow-up worth tracking (non-blocking, post-merge): the formula now intentionally has no Linux arm64 branch, so brew install on aarch64 Linux will report augur as unavailable rather than mis-installing the x86_64 build. That's the right call given release.yml only produces augur-linux-x86_64 today — just flagging it in case arm64 Linux support is ever wanted, at which point both release.yml (new asset + sidecar) and this template (an on_arm block under on_linux) would need to grow together.

For the record: confirmed this has no impact on fledge-plugin-augur, which links AugurKit via SwiftPM and never touches the Homebrew/release-binary path.


Generated by Claude Code

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.

2 participants