This document describes how Xberg bottles are built, distributed, and maintained.
Homebrew bottles are pre-compiled binaries packaged for specific macOS/Linux platforms. They provide:
- Fast installation: ~10 seconds vs. 5-15 minutes compiling from source
- Reduced build dependencies: No need for Rust, CMake, or pkg-config on the user's machine
- Reliable builds: Consistent binary across installations on the same platform
Pre-built bottles are available for:
- macOS ARM64 (Sequoia) - Latest Apple Silicon Macs
- macOS ARM64 (Sonoma) - Apple Silicon Macs (2021+)
- macOS Intel (Ventura) - Intel-based Macs running Ventura or later
- Linux x86_64 - Standard 64-bit Linux systems
To build a bottle for your current platform:
cd homebrew-tap
./scripts/build-bottles.shThis script:
- Installs xberg with
--build-bottleflag (optimized for binary distribution) - Runs
brew bottleto generate the bottle file (.tar.gz) - Outputs the SHA256 hash needed for the formula
Bottles should be built in CI for each target platform:
- Linux x86_64: Build on Ubuntu (GitHub Actions or similar)
- macOS ARM64: Build on GitHub Actions'
macos-latest-largerunner - macOS Intel: Build on GitHub Actions'
macos-13runner (Intel)
Each build should:
brew install --build-bottle xberg
brew bottle xbergThe resulting .tar.gz file and the output from brew bottle will provide the SHA256 hash.
When bottles are ready for release:
-
Get SHA256 hashes from
brew bottleoutput for each platform -
Update
Formula/xberg.rb:bottle do root_url "https://github.com/xberg-io/xberg/releases/download/vX.Y.Z" sha256 cellar: :any_skip_relocation, arm64_sequoia: "actual_hash_here" sha256 cellar: :any_skip_relocation, arm64_sonoma: "actual_hash_here" sha256 cellar: :any_skip_relocation, ventura: "actual_hash_here" sha256 cellar: :any_skip_relocation, x86_64_linux: "actual_hash_here" end
-
Update
root_urlto point to the release version -
Upload bottles to GitHub Releases under the corresponding version tag
-
Test locally:
brew install xbergshould use the bottle, not build from source
When releasing a new version with bottles:
- Build bottles for all 4 platforms
- Verify bottle SHA256 hashes
- Upload
.tar.gzfiles to GitHub Releases - Update
Formula/xberg.rbwith new version, SHA256, and bottle hashes - Update
root_urlin bottle block to new release tag - Test installation:
brew install xberg(should use bottle) - Verify no build dependencies required:
brew deps xberg(should be empty) - Commit and push changes to homebrew-tap repository
- Check macOS/Linux version matches supported platforms
- Verify SHA256 hashes in formula are correct
- Confirm bottles exist at the
root_urlwith correct filenames - Run
brew tap --repair xberg-io/tapto refresh tap cache
Add placeholders to the formula and schedule a CI build for that platform:
sha256 cellar: :any_skip_relocation, arm64_ventura: "will_update_after_build"Then update with real hash after the build completes.
- Increment patch version if fixing a bug
- Or use a release candidate tag (e.g.,
v4.0.0-rc.19) - Rebuild bottles and upload to new release
- Update formula with new version and hashes
homebrew-tap/
├── Formula/
│ └── xberg.rb # Main formula with bottle block
├── scripts/
│ └── build-bottles.sh # Local bottle build script
├── README.md # Installation instructions
├── BOTTLES.md # This file
└── LICENSE