Skip to content

fix: set PKG_CONFIG_PATH for macOS libarchive and add CI workflow (hotfix/0.5.2) - #31

Merged
yanekyuk merged 4 commits into
mainfrom
hotfix/0.5.2
Apr 3, 2026
Merged

fix: set PKG_CONFIG_PATH for macOS libarchive and add CI workflow (hotfix/0.5.2)#31
yanekyuk merged 4 commits into
mainfrom
hotfix/0.5.2

Conversation

@yanekyuk

@yanekyuk yanekyuk commented Apr 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Sets PKG_CONFIG_PATH for macOS builds so the linker can find Homebrew's keg-only libarchive (fixes macOS release builds broken in v0.5.1)
  • Adds ci.yml workflow that runs release builds on hotfix/** and release/** pushes and on PRs targeting main or next
  • Bumps version to 0.5.2

Test plan

  • CI workflow passes on this branch before merging
  • Tag v0.5.2 on main triggers successful builds across all platforms
  • Merge back into next

yanekyuk added 4 commits April 3, 2026 07:22
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.
@yanekyuk
yanekyuk merged commit 259c1f1 into main Apr 3, 2026
8 checks passed
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