Skip to content

Commit b559057

Browse files
committed
fix(vm): create libkrunfw.dylib symlink on macOS after extraction
libkrun.dylib references libkrunfw via @loader_path/libkrunfw.dylib (unversioned name set by build-libkrun-macos.sh), but the embedded runtime only extracts libkrunfw.5.dylib (versioned). Create an unversioned symlink so dyld can resolve the dependency.
1 parent 3ffb051 commit b559057

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

crates/openshell-vm/src/embedded.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,18 @@ pub fn ensure_runtime_extracted() -> Result<PathBuf, VmError> {
135135
)?;
136136
extract_resource(resources::GVPROXY, &cache_dir.join("gvproxy"))?;
137137

138+
// On macOS, libkrun.dylib references libkrunfw via @loader_path/libkrunfw.dylib
139+
// (the unversioned name), but we embed as libkrunfw.5.dylib. Create the
140+
// unversioned name so dyld can resolve the dependency.
141+
#[cfg(target_os = "macos")]
142+
{
143+
let unversioned = cache_dir.join("libkrunfw.dylib");
144+
if !unversioned.exists() {
145+
std::os::unix::fs::symlink(resources::LIBKRUNFW_NAME, &unversioned)
146+
.map_err(|e| VmError::HostSetup(format!("symlink libkrunfw.dylib: {e}")))?;
147+
}
148+
}
149+
138150
// Make gvproxy executable
139151
#[cfg(unix)]
140152
{

0 commit comments

Comments
 (0)