Skip to content

fix(homebrew): align stable formula with published v1.0.1 archive (#652) - #1395

Merged
godofecht merged 8 commits into
mainfrom
fix/652-homebrew-v101-archive-layout
Oct 6, 2026
Merged

godofecht merged 8 commits into
mainfrom
fix/652-homebrew-v101-archive-layout

Conversation

@godofecht

@godofecht godofecht commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Part of #652, paired with flooooooooooow/homebrew-flow#1.

The current stable v1.0.1 artifact is flow-v1.0.1.tar.gz with GitHub-recorded SHA-256 deb4978f97cb5643c29fcb9d73ab72a8eb121e2e31c60df73ba6870d04f5229b. The published release workflow produced it using git archive v1.0.1.

The v1.0.1 tree includes flow, flow-lsp, src/, lib/, runtime/, compiler/, but no VERSION or flow-driver. The previous in-repo formula required missing VERSION; the previous public-tap formula required missing flow-driver, causing a real source-layout packaging regression despite correct URL/digest.

This PR uses a conditional install path with documented Homebrew build.head?: stable installs the actual v1.0.1 src/ layout; --HEAD installs VERSION/tools and boots the Flow-native CLI for current main (VERSION=2.0.0). The paired proposed formulas are byte-identical.

Evidence so far: the published digest and tag tree were verified via GitHub; both proposed formula files compared byte-for-byte; the updated Ruby parsed with ruby -c (Syntax OK). No real macOS Homebrew install or brew test has been performed. The local Homebrew acceptance criterion remains open. No v1.0.2 release is being published or checksum guessed.

Local macOS validation using fresh checkouts of the two PR branches:

git clone --branch fix/652-homebrew-v101-archive-layout https://github.com/flooooooooooow/flow.git flow-verify
git clone --branch fix/652-homebrew-v101-archive-layout https://github.com/flooooooooooow/homebrew-flow.git homebrew-flow-verify
cmp flow-verify/packaging/homebrew/Formula/flow.rb homebrew-flow-verify/Formula/flow.rb
brew style flow-verify/packaging/homebrew/Formula/flow.rb
brew audit --strict --offline flow-verify/packaging/homebrew/Formula/flow.rb
brew install --build-from-source ./flow-verify/packaging/homebrew/Formula/flow.rb
brew test ./flow-verify/packaging/homebrew/Formula/flow.rb

Do not merge as complete until that local install/test is reported, and coordinate both formula PR merges. Hosted workflows are not release qualification evidence.

@godofecht godofecht added 1.0-stabilisation Workstream for Flow 1.0.0 stabilisation programme release Release process and packaging labels Oct 6, 2026 — with ChatGPT Codex Connector

Copy link
Copy Markdown
Contributor Author

Local macOS Homebrew validation for head 8323daaf: FAILED, so I'm not merging this.

Environment: macOS 26.2 (25C56), Apple Silicon, Homebrew 7.0.8, Xcode 26.2. Formula checked out from this PR into a temporary worktree.

  1. cmp of packaging/homebrew/Formula/flow.rb against homebrew-flow fix/652-homebrew-v101-archive-layout Formula/flow.rb: identical ✅
  2. brew style packaging/homebrew/Formula/flow.rb: 3 offenses ❌ (all autocorrectable)
flow.rb:7:3: C: FormulaAudit/ComponentsOrder: url (line 7) should be put before license (line 6)
flow.rb:35:14: C: Homebrew/FormulaPathMethods: Use formula_opt_bin("[email protected]") instead of Formula["[email protected]"].opt_bin.
flow.rb:40:36: C: Homebrew/FormulaPathMethods: Use formula_opt_libexec("[email protected]") instead of Formula["[email protected]"].opt_libexec.
  1. brew audit --strict --offline ...: this Homebrew no longer has --offline (Error: invalid option: --offline). brew audit --strict through a local tap reports 4 problems ❌: the 3 above plus Stable: version 1.0.1 is redundant with version scanned from URL.
  2. brew install --build-from-source ./packaging/homebrew/Formula/flow.rb: rejected, because current Homebrew needs formulae to be in a tap (Error: Homebrew requires formulae to be in a tap). I retried through a throwaway local tap with brew install --build-from-source localtest/flow1395/flow. The download and the [email protected] dependency worked, but the build failed at venv.pip_install "numpy" ❌:
Failed executing: python3.12 -m pip --python=.../flow/1.0.1/libexec/venv/bin/python install --verbose --no-deps --no-binary=:all: --ignore-installed --no-compile --uploaded-prior-to=P1D numpy (BuildError)
  File ".../pip/_vendor/truststore/_macos.py", line 22, in <module>
    _mac_version_info = tuple(map(int, _mac_version.split(".")))
ValueError: invalid literal for int() with base 10: ''

pip's truststore can't read the macOS version inside the Homebrew build sandbox. The formula also installs numpy with an unpinned pip_install and no resource block, so it builds numpy from source with --no-binary=:all:. A numpy resource (with sha256), or dropping numpy from the stable install, would avoid this.
5. brew test: not reached (Error: Testing requires the latest version of localtest/flow1395/flow) ❌

After the test I uninstalled [email protected] and removed the local tap and worktree. The local brew formula list is the same as before. The #652 local Homebrew acceptance criterion is still open.

Copy link
Copy Markdown
Contributor Author

Local Homebrew check at head 66dc96a7 (macOS arm64, Homebrew 7.0.8, throwaway local tap):

  • brew style: no offenses
  • brew install --build-from-source: passes now ([email protected] bottle poured, flow 1.0.1 installed, 4,470 files). The earlier numpy build failure is gone.
  • flow version from the keg prints Flow 1.0.1.
  • brew test: fails
==> Testing localtest/flow1395b/flow
==> /opt/homebrew/Cellar/flow/1.0.1/bin/flow compile hello.flow
mkdir: /opt/homebrew/Cellar/flow/1.0.1/libexec/build: Operation not permitted
Error: localtest/flow1395b/flow: failed

Cause: the v1.0.1 flow script writes compile output to $SCRIPT_DIR/build (libexec/build, lines 275-276 of libexec/flow), and brew test runs in a sandbox where the keg is read-only. Possible fixes: make the test do block run something that doesn't write into the keg (e.g. flow version, or a check-only command), or have the formula give the script a writable build dir (e.g. a libexec/"build" symlink to a path under var, or an env override if the CLI supports one).

Not merging. The test install, its [email protected] dependency and the local tap were removed afterwards, and the brew formula, cask and tap lists match what was there before.

The v1.0.1 flow script writes compile output to libexec/build, which is
read-only in the brew test sandbox, so the old test always failed there.
The test now asserts that flow version prints Flow <version>.

Copy link
Copy Markdown
Contributor Author

Pushed 07d8b5c0: the formula's test do block no longer runs flow compile. The v1.0.1 script always writes to $SCRIPT_DIR/build (libexec/build) and has no env var or flag to move it, so the test now asserts flow version prints Flow #{version} via shell_output (and Flow X.Y.Z for HEAD builds). The branch was then updated with main (8024822d).

Local re-check on macOS arm64 (Homebrew 7.0.8, throwaway local tap):

  • brew style: no offenses
  • brew install --build-from-source: pass
  • brew test: pass (/opt/homebrew/Cellar/flow/1.0.1/bin/flow version)
  • Cleanup: install, [email protected] and the tap removed; brew formula, cask and tap lists unchanged.

Not merging yet. CI's Dry-run qualify check fails:

./flow tool qualify_release --check-formula
flow tool qualify_release: formula has no version field: packaging/homebrew/Formula/flow.rb

The Jules fix removed version "1.0.1" because brew audit --strict calls it redundant with the URL, but qualify_release --check-formula requires an explicit version line. Either restore the version line (and accept the audit note) or teach qualify_release to read the version from the flow-vX.Y.Z.tar.gz URL.

The homebrew-flow tap's PR #1 needs the same formula as this PR once it's settled.

brew audit --strict calls a version line that repeats the url redundant,
so the formula on this branch dropped it, and qualify_release
--check-formula then failed with "formula has no version field". The
check now takes the version from the flow-vX.Y.Z.tar.gz url when the
formula has no version line, still prefers an explicit one, and fails
only when neither gives a version. Tests cover both cases.
@godofecht
godofecht merged commit 71fd457 into main Oct 6, 2026
37 checks passed

Copy link
Copy Markdown
Contributor Author

Merged (squash 71fd457b) after all checks went green at 5def7ea8.

The last commit changes qualify_release --check-formula: when the formula has no version line, it now reads the version from the flow-vX.Y.Z.tar.gz URL, as Homebrew does. An explicit version line still wins, and the check fails only if neither gives a version. Two new cases in tests/scripts/qualify_release.flow cover this (11/11 pass), and docs/project/release-qualification.md says so.

The homebrew-flow tap's PR #1 still needs the same formula as packaging/homebrew/Formula/flow.rb on main.

@godofecht
godofecht deleted the fix/652-homebrew-v101-archive-layout branch October 12, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.0-stabilisation Workstream for Flow 1.0.0 stabilisation programme release Release process and packaging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant