Posted on

Table of Contents

How We Fixed macOS GStreamer Library Path Issues in Rust Releases

I spent way too many hours debugging why our Rust app worked fine in development but kept crashing on macOS release builds due to GStreamer library conflicts. Users would see this error when double-clicking the app:

  objc[43583]: Class GstCocoaApplicationDelegate is implemented in both
  /Library/Frameworks/GStreamer.framework/Versions/1.0/lib/libgstreamer-1.0.0.dylib
  and /Users/user/app/gstreamer/lib/libgstreamer-1.0.0.dylib

The Problem

Turns out our GitHub Actions script was trying to fix @rpath entries with install_name_tool, but those commands were just failing silently.

Rust binaries don't have enough header padding by default for install_name_tool to actually work.

The Solution

Add this linker flag to your macOS Rust builds:

export RUSTFLAGS="$RUSTFLAGS -C link-arg=-Wl,-headerpad_max_install_names"

This simple flag reserves enough space in the binary header so the tool can actually do its job.

  • Before: Binary had unfixable @rpath entries → loaded both system and bundled GStreamer → conflicts
  • After: Binary library paths properly fixed → loads only bundled GStreamer → works perfectly

So always verify that your install_name_tool commands actually succeed. Silent failures can waste hours of debugging!


Cite:

Altun, E. (2025, September 02). How We Fixed macOS GStreamer Library Path Issues in Rust Releases. Retrieved from https://altunenes.github.io/posts/gstmac/

CC BY 4.0