Ship Linux binaries via Homebrew - #1
Merged
Merged
Conversation
Pre-existing formatting drift that was failing `make lint` on main. Whitespace and line-wrapping only, no behaviour change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
fithit was macOS-arm64 only, purely because of how it was distributed: the spec pinned target_arch='arm64', release built on a single macOS runner, and the tap formula had one url/sha256 pointing at a Mach-O tarball. Installing via Linuxbrew produced a binary the system could not execute. The Python code itself was already portable (XDG data paths, stdlib urllib), so no source changes were needed. - fithit.spec: target_arch=None, so builds follow the host arch - Makefile: detect host os/arch, pick shasum vs sha256sum, name tarballs fithit-cli-<version>-<os>-<arch>.tar.gz; build via the spec instead of duplicating flags, so the committed spec is no longer dead code - packaging/fithit.rb.tmpl: formula is now generated from this repo rather than hand-edited in the tap. on_macos/on_linux x on_arm/on_intel url+sha pairs, plus depends_on arch: :arm64 on macOS so Intel Macs get a clear Homebrew error instead of an unrunnable binary - release.yml: matrix over macos-14, ubuntu-22.04, ubuntu-22.04-arm; each uploads its asset and passes its checksum as an artifact, then bump-tap renders the template and opens a tap PR. Replaces brew bump-formula-pr, which cannot express three url/sha pairs - ci.yml: build on all three platforms so Linux breakage shows up on PRs Linux is built on 22.04 rather than 24.04 because PyInstaller output is only forward-compatible w.r.t. glibc. The result runs on glibc 2.28+ (verified on Rocky 8, Debian 11, Ubuntu 20.04/22.04). Supported: macOS arm64, Linux x86_64, Linux arm64. No Intel macOS. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fithitwas macOS-arm64 only, purely because of how it was distributed — the spec pinnedtarget_arch='arm64', release built on a single macOS runner, and the tap formula had oneurl/sha256pointing at a Mach-O tarball.brew installunder Linuxbrew produced a binary the system could not execute.The Python code was already portable (XDG data paths, stdlib
urllib), so no source changes were needed.Changes
fithit.spec—target_arch=None, so builds follow the host arch. This was the hard blocker.Makefile— detects host os/arch, picksshasumvssha256sum, names tarballsfithit-cli-<version>-<os>-<arch>.tar.gz.make buildnow runs the committed spec instead of duplicating flags, so the spec is no longer dead code diverging from the real build.packaging/fithit.rb.tmpl— the formula is now generated from this repo rather than hand-edited in the tap.on_macos/on_linux×on_arm/on_intelurl+sha pairs, plusdepends_on arch: :arm64on macOS so Intel Macs get a clear Homebrew error rather than an unrunnable binary.release.yml— matrix overmacos-14,ubuntu-22.04,ubuntu-22.04-arm. Each builds, smoke-tests, uploads its asset, and passes its checksum as an artifact; abump-tapjob renders the template with all three checksums and opens a tap PR. This replacesbrew bump-formula-pr, which cannot express three url/sha pairs.ci.yml— build on all three platforms, so Linux breakage shows up on PRs instead of mid-release.Linux is built on 22.04 rather than 24.04 because PyInstaller output is only forward-compatible w.r.t. glibc.
Supported platforms
arm64x86_64,arm64No Intel macOS.
Verification
brew installon Linuxbrew from the rendered formula: installs,brew testpasses,fithit --helpandfithit infowork, DB resolves to~/.local/share/fithit/workouts.json.Notes
ruff formatfix for pre-existing drift inparse.pythat was failingmake lintonmain. Whitespace only.pyproject.tomlversion was stale at0.1.0despite releases up tov0.1.5; bumped to0.2.0so localmake packagenames artifacts correctly.🤖 Generated with Claude Code