Skip to content

fix(ci): resolve macOS aarch64 build (gexiv2/gobject linking)#2

Merged
lagosproject merged 4 commits into
mainfrom
ci-diagnostics
Jun 7, 2026
Merged

fix(ci): resolve macOS aarch64 build (gexiv2/gobject linking)#2
lagosproject merged 4 commits into
mainfrom
ci-diagnostics

Conversation

@lagosproject

Copy link
Copy Markdown
Owner

Summary

Fixes the macOS aarch64-apple-darwin Publish Release build, which was failing at the final link step.

Root cause

A chain of gexiv2 workarounds left an unresolved symbol:

  • Homebrew's gexiv2 0.16 dropped gexiv2_metadata_free, which rexiv2 0.10 still calls → a shim was added in lib.rs.
  • That shim calls g_object_unref (from libgobject-2.0), but gexiv2 lists gobject only under Requires.private. pkg-config omits private requires from the dynamic link line, so _g_object_unref was left undefined:
Undefined symbols for architecture arm64:
  "_g_object_unref", referenced from:
      _gexiv2_metadata_free in tauri_app_lib...
ld: symbol(s) not found for architecture arm64

Fix

build.rs now probes gobject-2.0 via pkg-config and emits an explicit cargo:rustc-link-lib=dylib=gobject-2.0 plus its link search path, gated on CARGO_CFG_TARGET_OS == "macos" (the correct target-based gate for a build script).

Verification

  • cargo check passes locally.
  • The publish-tauri (macos-latest, aarch64-apple-darwin) job succeeded on run 27097262084 — the link error is gone.

🤖 Generated with Claude Code

g5fighter and others added 4 commits June 2, 2026 11:30
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>
@lagosproject lagosproject merged commit b939c96 into main Jun 7, 2026
5 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.

2 participants