Skip to content

Conversation

@slp
Copy link
Collaborator

@slp slp commented Sep 18, 2025

After libkrun stopped linking directly against libkrunfw, we depend on dlopen() and the system's linker to do a sane job at looking for the library. This poses a problem on macOS, since the library path from the brew prefix is not used for looking up libraries by default.

So work around this limitation, look if the DYLD_LIBRARY_PATH environment variable is present. If it isn't, obtain the brew prefix and re-execute krunvm with pushing that variable with brew's library path into the list of environment variables.

Fixes: #70

After libkrun stopped linking directly against libkrunfw, we depend on
dlopen() and the system's linker to do a sane job at looking for the
library. This poses a problem on macOS, since the library path from
the brew prefix is not used for looking up libraries by default.

So work around this limitation, look if the DYLD_LIBRARY_PATH
environment variable is present. If it isn't, obtain the brew prefix and
re-execute krunvm with pushing that variable with brew's library path
into the list of environment variables.

Fixes: containers#70
Signed-off-by: Sergio Lopez <slp@redhat.com>
@slp slp force-pushed the macos-workaround-dyld branch from 9da3368 to 8ad6319 Compare September 18, 2025 13:22
@slp slp merged commit 330935b into containers:main Sep 24, 2025
2 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.

Krunvm does not find /opt/homebrew/lib/libkrunfw.4.dylib

1 participant