Update libkrun build to use nerdbox variant#210
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates how nerdbox locates and packages libkrun so that a nerdbox-specific build (libkrun-nerdbox*) is preferred over any system-installed libkrun, avoiding accidental ABI/patchset conflicts at runtime.
Changes:
- Update
internal/vm/libkrun/instance.goto search forlibkrun-nerdbox-*names first, then fall back to upstreamlibkrunnames. - Update the Docker build to rename the produced libkrun artifact to a nerdbox-specific filename and install it into the dev image.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
internal/vm/libkrun/instance.go |
Adjusts libkrun discovery logic to prefer nerdbox-variant library names over upstream names. |
Dockerfile |
Renames and installs the libkrun build artifact using a nerdbox-specific filename to avoid collisions with system libkrun. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| arch := kernelArch() | ||
| sharedNames := []string{fmt.Sprintf("libkrun-%s.so", arch), "libkrun.so"} | ||
|
|
||
| // variants lists distinct library families in priority order. Each family |
There was a problem hiding this comment.
This code path has been a pain point up the stack historically. I wonder if it'd make sense to write a small lookup plugin that we can easily swap out. WDYT?
There was a problem hiding this comment.
I'll have to think a bit more about how we would want to do that. We could certainly put the resolution logic in a library, I'm not sure how it would be pluggable though. Since this is specific to the libkrun plugin itself, its reasonable that other backends may have slightly different resolution logic or not have a "nerdbox" specific build at all.
Add variant name to our build of libkrun to prevent conflicting with libkrun that may be on the system. Signed-off-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Derek McGowan <derek@mcg.dev>
0053533 to
bf01497
Compare
Add variant name to our build of libkrun to prevent conflicting with libkrun that may be on the system.