Skip to content

Update libkrun build to usenerdbox variant#210

Open
dmcgowan wants to merge 1 commit into
containerd:mainfrom
dmcgowan:libkrun-nerdbox
Open

Update libkrun build to usenerdbox variant#210
dmcgowan wants to merge 1 commit into
containerd:mainfrom
dmcgowan:libkrun-nerdbox

Conversation

@dmcgowan
Copy link
Copy Markdown
Member

Add variant name to our build of libkrun to prevent conflicting with libkrun that may be on the system.

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>
Copilot AI review requested due to automatic review settings May 30, 2026 07:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.go to search for libkrun-nerdbox-* names first, then fall back to upstream libkrun names.
  • 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 thread Dockerfile
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 thread Dockerfile
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
Comment thread Dockerfile
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
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.

2 participants