Skip to content

Ship Linux binaries via Homebrew - #1

Merged
voydz merged 2 commits into
mainfrom
linux-homebrew-support
Aug 17, 2026
Merged

voydz merged 2 commits into
mainfrom
linux-homebrew-support

Conversation

@voydz

@voydz voydz commented Aug 17, 2026

Copy link
Copy Markdown
Owner

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. brew install under 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.spectarget_arch=None, so builds follow the host arch. This was the hard blocker.
  • Makefile — detects host os/arch, picks shasum vs sha256sum, names tarballs fithit-cli-<version>-<os>-<arch>.tar.gz. make build now 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_intel url+sha pairs, plus depends_on arch: :arm64 on macOS so Intel Macs get a clear Homebrew error rather than an unrunnable binary.
  • release.yml — matrix over macos-14, ubuntu-22.04, ubuntu-22.04-arm. Each builds, smoke-tests, uploads its asset, and passes its checksum as an artifact; a bump-tap job renders the template with all three checksums and opens a tap PR. This 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 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

Platform Architecture
macOS arm64
Linux x86_64, arm64

No Intel macOS.

Verification

  • PyInstaller build + smoke test pass on Linux x86_64 and arm64 (real containers).
  • Full brew install on Linuxbrew from the rendered formula: installs, brew test passes, fithit --help and fithit info work, DB resolves to ~/.local/share/fithit/workouts.json.
  • Formula resolves the correct URL under macOS arm64, linux/amd64 and linux/arm64; the arch requirement applies only on macOS.
  • Makefile tarball naming matches the formula URLs on all three platforms.
  • Binary runs on glibc 2.28+ (Rocky 8, Debian 11, Ubuntu 20.04/22.04).
  • Test suite passes on Linux and macOS.

Notes

  • The first commit is a standalone ruff format fix for pre-existing drift in parse.py that was failing make lint on main. Whitespace only.
  • pyproject.toml version was stale at 0.1.0 despite releases up to v0.1.5; bumped to 0.2.0 so local make package names artifacts correctly.

🤖 Generated with Claude Code

voydz and others added 2 commits August 17, 2026 19:17
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>
@voydz
voydz merged commit 4cabe5f into main Aug 17, 2026
4 checks passed
@voydz
voydz deleted the linux-homebrew-support branch August 17, 2026 17:22
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