fix: set PKG_CONFIG_PATH for macOS libarchive and add CI workflow (hotfix/0.5.2) - #31
Merged
Conversation
Homebrew's libarchive is keg-only and not on the default pkg-config path, causing macOS release builds to fail even after installation. Sets PKG_CONFIG_PATH to cover both Apple Silicon and Intel Homebrew paths. Also adds a CI workflow that runs release builds on hotfix/* and release/* pushes, and on PRs targeting main or next, so failures are caught before merging.
Homebrew only installs arm64 bottles on Apple Silicon runners, so the linker rejects them when cross-compiling to x86_64-apple-darwin. macOS ships a universal libarchive, so for the x86_64 target we create a custom pkg-config file that uses Homebrew headers but links against the system library instead.
The custom .pc file had Version: 3 which failed the compress-tools >= 3.2.0 check. Instead, strip only the arm64 -L path from Homebrew's own .pc file so the version and all other fields are preserved.
…chive
The sed approach failed because Homebrew .pc uses ${libdir} variable,
not a literal path, so the -L flag was never stripped. The linker then
found the arm64-only Homebrew dylib and rejected it for x86_64.
Fix: query the real version via pkg-config before switching paths, then
write a custom .pc with Homebrew headers but no -L path. Without -L,
the linker falls back to /usr/lib/libarchive which is universal.
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.
Summary
PKG_CONFIG_PATHfor macOS builds so the linker can find Homebrew's keg-only libarchive (fixes macOS release builds broken in v0.5.1)ci.ymlworkflow that runs release builds onhotfix/**andrelease/**pushes and on PRs targetingmainornextTest plan
v0.5.2onmaintriggers successful builds across all platformsnext