Skip to content

Update libkrun build to use nerdbox variant#210

Open
dmcgowan wants to merge 2 commits into
containerd:mainfrom
dmcgowan:libkrun-nerdbox
Open

Update libkrun build to use nerdbox variant#210
dmcgowan wants to merge 2 commits 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.

Copilot AI review requested due to automatic review settings May 30, 2026 07:21

Copilot AI left a comment

Copy link
Copy Markdown

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 thread Dockerfile
Comment thread Dockerfile
@dmcgowan dmcgowan changed the title Update libkrun build to usenerdbox variant Update libkrun build to use nerdbox variant Jun 1, 2026
arch := kernelArch()
sharedNames := []string{fmt.Sprintf("libkrun-%s.so", arch), "libkrun.so"}

// variants lists distinct library families in priority order. Each family

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

dmcgowan added 2 commits June 9, 2026 20:46
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>
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.

3 participants