fix(ci): resolve macOS aarch64 build (gexiv2/gobject linking)#2
Merged
Conversation
The gexiv2_metadata_free shim must live in lib.rs, not main.rs, because Cargo builds all declared crate types (staticlib, cdylib, rlib) and macOS's linker rejects undefined symbols in cdylib targets. Placing the shim in main.rs only satisfied the final binary link, not the cdylib step. Drop macos-13 from the build matrix: Intel GitHub-hosted runners are deprecated and removed on 2026-06-16; the last run queued 24h without ever getting a runner. ARM64 binaries run on Intel Macs via Rosetta 2. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The gexiv2_metadata_free shim in lib.rs calls g_object_unref, which lives in libgobject-2.0. gexiv2 lists gobject only under Requires.private, so pkg-config omits it from the dynamic link line and the symbol is left undefined at link time on macOS. Probe gobject-2.0 via pkg-config in build.rs and emit an explicit link directive, gated on the target OS. Co-Authored-By: Claude Opus 4.8 <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.
Summary
Fixes the macOS
aarch64-apple-darwinPublish Release build, which was failing at the final link step.Root cause
A chain of gexiv2 workarounds left an unresolved symbol:
gexiv2_metadata_free, which rexiv2 0.10 still calls → a shim was added inlib.rs.g_object_unref(fromlibgobject-2.0), but gexiv2 lists gobject only underRequires.private. pkg-config omits private requires from the dynamic link line, so_g_object_unrefwas left undefined:Fix
build.rsnow probesgobject-2.0via pkg-config and emits an explicitcargo:rustc-link-lib=dylib=gobject-2.0plus its link search path, gated onCARGO_CFG_TARGET_OS == "macos"(the correct target-based gate for a build script).Verification
cargo checkpasses locally.publish-tauri (macos-latest, aarch64-apple-darwin)job succeeded on run 27097262084 — the link error is gone.🤖 Generated with Claude Code