[macOS] kicad-cli failing in Nightly Builds: Library not loaded @rpath (wxWidgets)

Hi everyone,

I apologize for bringing up an issue regarding the Nightly builds rather than a stable release. I’ve been relying on the Nightly version because the PCB Design Block feature is essential for my current workflow, and I’m very grateful to the team for implementing it.

However, over the past few weeks, I’ve encountered a persistent issue where kicad-cli fails to run. I have been checking the latest builds daily, but the problem seems to persist from version 20251203 through to the most recent 20251224 build.

When I attempt to run kicad-cli, I get the following dyld error related to a missing library:

dyld[44597]: Library not loaded: @rpath/libwx_osx_cocoau_gl-3.2.0.dylib

Referenced from: /Applications/KiCad/KiCad.app/Contents/MacOS/kicad-cli

Reason: tried: ... (no such file)

Abort trap: 6

It appears to be looking for libwx_osx_cocoau_gl in absolute paths that seem specific to the build environment (e.g., /Users/kicad/remoteroot/workspace/...), which suggests an issue with the library linking or the @rpath configuration in the macOS DMG packaging.

Since kicad-cli is a vital part of my automation, I am considering attempting to build KiCad from source myself to see if I can resolve it locally. However, I am aware that Nightly builds are experimental, and I don’t want to overcomplicate things if this is already a known issue.

Before I dive into a manual build, I was wondering if anyone else has encountered this or if there is a known workaround? If a bug report is already being tracked, I’d appreciate it if someone could point me to it.

Thank you for your hard work on such an amazing tool! And Merry Christmas!

BTW:

I have tried the following workaround, but without success.

export DYLD_LIBRARY_PATH=/Applications/KiCad/KiCad.app/Contents/Frameworks:$DYLD_LIBRARY_PATH
/Applications/KiCad/KiCad.app/Contents/MacOS/kicad-cli --help

same?

https://github.com/yaqwsx/PcbDraw/issues/161#issuecomment-1929717665

https://gitlab.com/kicad/packaging/kicad-mac-builder/-/issues/408

That sounds like the issue on the mac builder repo, yes. My workaround was to build from source and run from the build directories.

Once you build (but not install) you can set the KICAD_RUN_FROM_BUILD_DIR environment variable and run the kicad executable (or kicad-cli) directly.