Update libkrun build to usenerdbox variant#210
Open
dmcgowan wants to merge 1 commit into
Open
Conversation
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>
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.
Comment on lines
268
to
+271
| RUN git clone --depth 1 --branch ${LIBKRUN_VERSION} https://github.com/containers/libkrun.git && \ | ||
| cd libkrun && \ | ||
| make -j$(nproc) BLK=1 NET=1 | ||
| make -j$(nproc) BLK=1 NET=1 && \ | ||
| cp /libkrun/target/release/libkrun.so /libkrun/target/release/libkrun-nerdbox-${KERNEL_ARCH}.so |
Comment on lines
273
to
+275
| FROM scratch AS libkrun | ||
| COPY --from=libkrun-build /libkrun/target/release/libkrun.so /libkrun.so | ||
| ARG KERNEL_ARCH="x86_64" | ||
| COPY --from=libkrun-build /libkrun/target/release/libkrun-nerdbox-${KERNEL_ARCH}.so /libkrun-nerdbox-${KERNEL_ARCH}.so |
| COPY --from=dlv /go/bin/dlv /usr/local/bin/dlv | ||
|
|
||
| COPY --from=libkrun /libkrun.so /usr/local/lib64/libkrun.so | ||
| COPY --from=libkrun /libkrun-nerdbox-${KERNEL_ARCH}.so /usr/local/lib64/libkrun-nerdbox-${KERNEL_ARCH}.so |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add variant name to our build of libkrun to prevent conflicting with libkrun that may be on the system.