Skip to content

fix(musl): run static shim without libkrunfw dlopen#937

Merged
DorianZheng merged 1 commit into
boxlite-ai:mainfrom
xhebox:musl
Jul 16, 2026
Merged

fix(musl): run static shim without libkrunfw dlopen#937
DorianZheng merged 1 commit into
boxlite-ai:mainfrom
xhebox:musl

Conversation

@xhebox

@xhebox xhebox commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the static-musl shim build by linking vendored libkrun as a normal Cargo dependency instead of building a nested Rust staticlib. This removes duplicate Rust standard-library symbols and the need for --allow-multiple-definition while keeping the Linux shim statically linked.

Aligns libkrunfw packaging with the final link mode. Dynamic builds package the shared library for libkrun's dlopen path; static-musl builds package the raw libkrunfw.bin kernel and configure it through krun_set_kernel.

Improves native musl support across the shim, guest, runtime assembly, and local SDK development paths.

Ref #927.

Changes

  • Replace the nested cargo rustc --crate-type staticlib libkrun build with a Cargo-managed dependency on the vendored Rust crate.
  • Remove duplicate-symbol linker workarounds and obsolete libkrun logging initialization. The vendored crate now shares the shim's Rust runtime and process-wide logger.
  • Split libkrunfw artifact behavior by link mode:
    • dynamic Linux and macOS builds package libkrunfw.so* or libkrunfw.dylib;
    • static-musl builds always build and package libkrunfw.bin, including when only the base krunfw feature is enabled;
    • krunfw-source builds firmware from the vendored source, with shared libraries omitted for static-musl.
  • Add runtime external-kernel configuration with BOXLITE_KRUNFW_EXTERNAL_KERNEL, BOXLITE_KRUNFW_KERNEL_PATH, and BOXLITE_KRUNFW_KERNEL_FORMAT.
    • External-kernel loading defaults to off for dynamic builds and on for static-musl.
    • An explicit gate value overrides the platform default.
    • Kernel format defaults to ELF on x86_64 and RAW on other architectures; explicit formats are raw, elf, pe-gz, image-bz2, image-gz, and image-zstd.
  • Bundle and copy the selected libkrunfw artifact alongside the shim, and pass the external-kernel controls through the sanitized shim environment.
  • Scope crt-static flags to the shim and guest Cargo configurations so they do not leak into SDK cdylibs or host-built proc macros.
  • Use the native musl Rust target when available, while retaining cross-compilation support for GNU hosts.
  • Centralize build-script path, target-directory, and Cargo-profile handling. Build profiles now flow through BUILD_PROFILE; make runtime and make cli default to release, with BUILD_PROFILE=debug selecting debug builds.
  • Fix related musl portability issues: resource-limit types, GNU-only libresolv search paths, libseccomp cross-build handling, target/profile runtime discovery, and Go/cgo unwind linkage.
  • Temporarily skip publishing libkrun-sys from the release workflow because its vendored path dependency requires a follow-up packaging fix; refactor(deps): split libkrunfw sidecar package #962 will address this.

How to verify

bash -n scripts/build/build-cli.sh
bash -n scripts/build/build-guest.sh
bash -n scripts/build/build-libseccomp.sh
bash -n scripts/build/build-runtime.sh
bash -n scripts/build/build-shim.sh
make fmt:check:rust
git diff --check

BOXLITE_DEPS_STUB=1 cargo check -p boxlite --tests --features krun
BOXLITE_DEPS_STUB=1 cargo check -p libkrun-sys --features krun,krunfw
BOXLITE_DEPS_STUB=1 cargo test -p boxlite --lib vmm::krun::kernel::tests --features krun

For an end-to-end static-musl build after make setup:build:

make runtime
BUILD_PROFILE=debug make runtime

The assembled static-musl runtime should contain libkrunfw.bin and no libkrunfw.so*. Dynamic Linux and macOS runtimes should continue to package the shared libkrunfw artifact.

libkrun-sys is intentionally omitted from the crates.io publish step for this PR; the packaging issue is tracked in #962.

Copilot AI review requested due to automatic review settings July 7, 2026 10:09
@xhebox
xhebox requested a review from a team as a code owner July 7, 2026 10:09
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds krunfw-kernel feature wiring across manifests, build scripts, runtime kernel loading, and libkrun-sys artifact generation, plus musl-specific build flags and Linux rlimit typing changes.

Changes

krunfw kernel feature

Layer / File(s) Summary
Cargo feature declarations
src/boxlite/Cargo.toml, src/cli/Cargo.toml, src/shim/Cargo.toml, src/deps/libkrun-sys/Cargo.toml
Adds krunfw-kernel and krunfw-kernel-llvm features across the workspace and updates related feature comments.
libkrun-sys build and facade
src/deps/libkrun-sys/Cargo.toml, src/deps/libkrun-sys/build.rs, src/deps/libkrun-sys/src/lib.rs
Adds kernel format constants and krun wrappers, verifies pyelftools, changes native artifact handling, and stops building libkrun.a as a static library.
Build scripts and shim lookup
scripts/common.sh, scripts/build/build-runtime.sh, scripts/build/build-shim.sh, src/boxlite/build.rs, src/boxlite/src/jailer/shim_copy.rs
Adds feature-argument helper plumbing, passes Cargo features into builds, changes prebuilt shim lookup order, removes a Linux test linker arg, and updates libkrunfw copy docs.
Runtime kernel selection and environment forwarding
src/boxlite/src/vmm/krun/engine.rs, src/boxlite/src/util/binary_finder.rs, src/boxlite/src/util/mod.rs, src/boxlite/src/vmm/controller/spawn.rs, src/boxlite/src/jailer/bwrap.rs, src/boxlite/src/jailer/sandbox/bwrap.rs
Adds krunfw kernel discovery and injection, updates runtime directory resolution, and forwards the new BOXLITE_KRUNFW_* environment variables through process and sandbox setup.

Sequence Diagram(s)

sequenceDiagram
  participant KrunCreate
  participant KrunContext
  participant EngineHelpers
  participant RuntimeFS
  KrunCreate->>KrunContext: create()
  KrunCreate->>EngineHelpers: configure_krunfw_kernel(&ctx)
  EngineHelpers->>RuntimeFS: locate libkrunfw.bin
  RuntimeFS-->>EngineHelpers: kernel path or none
  EngineHelpers->>KrunContext: set_kernel(path, format)
  EngineHelpers-->>KrunCreate: continue VM configuration
Loading

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • boxlite-ai/boxlite#846: Both changes touch src/boxlite/src/jailer/sandbox/bwrap.rs and adjust sandbox environment handling at the same integration point.

Suggested reviewers: DorianZheng, law-chain-hot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and matches the main change: fixing the static musl shim to avoid libkrunfw dlopen.
Description check ✅ Passed The description includes Summary, Changes, and How to verify, and it broadly matches the repository template.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes BoxLite’s static-musl runtime path by adding an opt-in krunfw-kernel feature that builds libkrunfw from source, bundles the extracted kernel artifact, and configures libkrun via krun_set_kernel (avoiding libkrun’s dlopen("libkrunfw.so.5") fallback that doesn’t work for the statically linked musl shim).

Changes:

  • Add feature plumbing (krunfw-kernel, krunfw-kernel-llvm) across libkrun-sys, boxlite, boxlite-shim, and boxlite CLI.
  • Under krunfw-kernel, build libkrunfw from source, locate the produced kernel artifact, and expose/bundle it as libkrunfw.bin; update the krun engine to find it and call krun_set_kernel.
  • Improve musl handling by fixing RLIMIT resource argument typing and adjusting runtime asset embedding to prefer the target-specific shim.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/shim/Cargo.toml Exposes krunfw-kernel* features from shim to boxlite.
src/deps/libkrun-sys/src/lib.rs Adds kernel format constants for krun_set_kernel configuration.
src/deps/libkrun-sys/Cargo.toml Introduces krunfw-kernel* feature graph for source/kernel builds.
src/deps/libkrun-sys/build.rs Builds libkrunfw from source (feature-gated), extracts kernel artifact, and exposes it for bundling.
src/cli/Cargo.toml Exposes krunfw-kernel* features from CLI to boxlite.
src/boxlite/src/vmm/krun/engine.rs Adds kernel discovery + krun_set_kernel configuration path (feature-gated).
src/boxlite/src/jailer/shim_copy.rs Updates shim-copy semantics/docs to include libkrunfw.bin alongside libkrunfw.so*.
src/boxlite/src/jailer/common/rlimit.rs Fixes musl typing for RLIMIT resource argument type.
src/boxlite/Cargo.toml Adds top-level krunfw-kernel* features wiring to libkrun-sys.
src/boxlite/build.rs Prefers target-specific shim path when embedding runtime assets.
scripts/common.sh Preserves legacy BOXLITE_BUILD_LIBKRUNFW entrypoint by mapping it to Cargo features.
scripts/build/build-shim.sh Passes feature args through to shim builds.
scripts/build/build-runtime.sh Passes feature args through to runtime collection build.
.cargo/config.toml Adds musl-specific rustflag cfg for a libkrun-related workaround.

Comment thread src/boxlite/src/vmm/krun/engine.rs Outdated
Comment thread src/deps/libkrun-sys/build.rs Outdated
Comment thread scripts/common.sh Outdated
Copilot AI review requested due to automatic review settings July 7, 2026 10:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Comment thread src/deps/libkrun-sys/build.rs Outdated
Comment thread src/deps/libkrun-sys/build.rs Outdated
Comment thread src/boxlite/src/vmm/krun/engine.rs Outdated
Copilot AI review requested due to automatic review settings July 7, 2026 10:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Comment thread src/deps/libkrun-sys/build.rs Outdated
Copilot AI review requested due to automatic review settings July 7, 2026 11:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Comment thread .cargo/config.toml Outdated
@xhebox xhebox changed the title fix(musl): run static shim without libkrunfw dlopen [WIP] fix(musl): run static shim without libkrunfw dlopen Jul 8, 2026
@xhebox

xhebox commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Some changes are still needed. It is fixing lots of build problems without compromise.

Copilot AI review requested due to automatic review settings July 8, 2026 06:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 20 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

src/boxlite/src/util/binary_finder.rs:86

  • BOXLITE_RUNTIME_DIR parsing uses split(':'), which is less robust than std::env::split_paths (and inconsistent with other new code paths in this PR). Using split_paths avoids hard-coding the separator and handles platform-specific path lists correctly.
        let explicit_runtime = std::env::var("BOXLITE_RUNTIME_DIR").ok();

        // 1. Explicit override (highest priority)
        if let Some(runtime_dir) = &explicit_runtime {
            for path in runtime_dir.split(':').filter(|s| !s.is_empty()) {
                builder = builder.with_path(path);
            }
        }

Comment thread src/boxlite/src/vmm/krun/engine.rs Outdated
Comment thread src/boxlite/src/vmm/krun/engine.rs Outdated
Comment thread src/boxlite/src/util/binary_finder.rs Outdated
Comment thread .cargo/config.toml Outdated

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
src/boxlite/src/vmm/controller/spawn.rs (1)

151-159: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract shared helper for BOXLITE_KRUNFW_* env forwarding.

The same three-variable forwarding loop is duplicated in spawn.rs:151, bwrap.rs:636, and sandbox/bwrap.rs:150. A shared helper would prevent drift when new vars are added.

♻️ Proposed helper extraction
+// In a shared module (e.g., util/mod.rs or a constants module):
+pub const KRUNFW_ENV_VARS: &[&str] = &[
+    "BOXLITE_KRUNFW_EXTERNAL_KERNEL",
+    "BOXLITE_KRUNFW_KERNEL_PATH",
+    "BOXLITE_KRUNFW_KERNEL_FORMAT",
+];
+
+pub fn forward_env_vars(cmd: &mut std::process::Command) {
+    for name in KRUNFW_ENV_VARS {
+        if let Ok(value) = std::env::var(name) {
+            cmd.env(name, value);
+        }
+    }
+}

Then in each of the three call sites:

-        for name in [
-            "BOXLITE_KRUNFW_EXTERNAL_KERNEL",
-            "BOXLITE_KRUNFW_KERNEL_PATH",
-            "BOXLITE_KRUNFW_KERNEL_FORMAT",
-        ] {
-            if let Ok(value) = std::env::var(name) {
-                cmd.env(name, value);
-            }
-        }
+        crate::util::forward_env_vars(&mut cmd);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/boxlite/src/vmm/controller/spawn.rs` around lines 151 - 159, The
`BOXLITE_KRUNFW_*` environment forwarding loop is duplicated across `spawn`,
`bwrap`, and `sandbox/bwrap`, so extract it into a shared helper and call that
from each site. Create a single reusable function for forwarding the three env
vars, then replace the inline loop in the `spawn` path and the matching call
sites in `bwrap` and `sandbox/bwrap` to keep the set of forwarded variables
consistent and avoid drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/boxlite/src/vmm/controller/spawn.rs`:
- Around line 151-159: The `BOXLITE_KRUNFW_*` environment forwarding loop is
duplicated across `spawn`, `bwrap`, and `sandbox/bwrap`, so extract it into a
shared helper and call that from each site. Create a single reusable function
for forwarding the three env vars, then replace the inline loop in the `spawn`
path and the matching call sites in `bwrap` and `sandbox/bwrap` to keep the set
of forwarded variables consistent and avoid drift.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6db4a059-4b7d-47d2-b471-56fdb2a80726

📥 Commits

Reviewing files that changed from the base of the PR and between 7b621c5 and b8d04c5.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (12)
  • src/boxlite/Cargo.toml
  • src/boxlite/build.rs
  • src/boxlite/src/jailer/bwrap.rs
  • src/boxlite/src/jailer/sandbox/bwrap.rs
  • src/boxlite/src/jailer/shim_copy.rs
  • src/boxlite/src/util/binary_finder.rs
  • src/boxlite/src/util/mod.rs
  • src/boxlite/src/vmm/controller/spawn.rs
  • src/boxlite/src/vmm/krun/engine.rs
  • src/deps/libkrun-sys/Cargo.toml
  • src/deps/libkrun-sys/build.rs
  • src/deps/libkrun-sys/src/lib.rs
💤 Files with no reviewable changes (1)
  • src/boxlite/build.rs
✅ Files skipped from review due to trivial changes (1)
  • src/boxlite/src/jailer/shim_copy.rs
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/boxlite/Cargo.toml
  • src/deps/libkrun-sys/Cargo.toml
  • src/boxlite/src/vmm/krun/engine.rs

Copilot AI review requested due to automatic review settings July 8, 2026 11:37
@boxlite-agent

boxlite-agent Bot commented Jul 8, 2026

Copy link
Copy Markdown

📦 BoxLite review — 2 issues · 54fa166

Review evidence

  • git diff --numstat/diff origin/main...HEAD — 63 files, ~3692 lines; build system + krun vendoring rewrite
  • grep -rn krun_init_log/init_logging src/ — no init-log call remains anywhere; logging init dropped
  • cargo check -p boxlite --lib — no cargo toolchain in sandbox; submodules (vendor/libkrun) not checked out

Risk notes

  • libkrun logging init removed — KrunContext::init_logging + krun_init_log FFI + KRUN_LOG_* consts fully deleted, engine.rs no longer calls any log-init API; verified via grep, no replacement found
  • vendored libkrun linkage — libkrun-sys now depends on path submodule vendor/libkrun (Rust crate) instead of dlopen/extern C; submodules not checked out in this sandbox so build.rs/lib.rs FFI-forwarding correctness (532/126 line rewrites) only read, not compiled or tested
  • jailer env allowlist (process_env.rs, bwrap.rs, sandbox/bwrap.rs) — new shim_process_env() replaces ad-hoc RUST_LOG/RUST_BACKTRACE passthrough with an explicit allowlist incl. BOXLITE_KRUNFW_* vars; values come from the host's own env so no privilege boundary crossed, logic looks correct
  • kernel.rs new module — env parsing (enabled/format/path) has unit tests for parse_enabled/resolve_enabled/parse_format; find_path() candidate search and apply() not unit tested but logic is straightforward
  • sampled/skipped — only skimmed: Cargo.lock (816/41, generated), scripts/build/.sh (~440 lines, shell build orchestration), make/.mk, CI workflow files beyond publish-verification line, src/boxlite/build.rs, libgvproxy-sys/build.rs, util/binary_finder.rs, disk/ext4.rs, rlimit.rs — no correctness checks run on these
src/boxlite/src/vmm/krun/kernel.rs
  KrunfwKernelConfig  +236/-0  new external kernel config, gated by musl-static default
src/boxlite/src/vmm/krun/context.rs
  KrunContext::init_logging  +10/-41  removed logging init function entirely
src/boxlite/src/vmm/krun/engine.rs
  Krun::create  +7/-6  drops init_logging call, adds kernel.apply()
src/deps/libkrun-sys/src/lib.rs
  krun_* wrappers  +206/-126  switched from extern C to vendored krun crate calls
src/deps/libkrun-sys/build.rs
  libkrunfw kernel export/build  +209/-532  large rewrite for static/dynamic artifact packaging
src/boxlite/src/jailer/process_env.rs
  shim_process_env  +35/-0  new centralized env allowlist
src/boxlite/src/jailer/bwrap.rs
  build_shim_command  +6/-21  uses allowlist instead of ad-hoc env copy
src/boxlite/src/jailer/sandbox/bwrap.rs
  BwrapSandbox::apply  +16/-23  uses allowlist, keeps LD_LIBRARY_PATH fallback
src/boxlite/src/jailer/shim_copy.rs
  copy_libkrunfw  +8/-14  comment/prefix update for .bin + .so artifacts
.github/workflows/build-runtime.yml
  publish_crate libkrun-sys  +9/-11  publish verification disabled, follow-up filed
2 findings summary
  • ⚠️ src/boxlite/src/vmm/krun/engine.rs:93-105 libkrun log initialization removed, no replacement — KrunContext::init_logging (mapped RUST_LOG to krun_init_log) and its FFI binding/constants were deleted repo-wide with nothing calling an equivalent init; libkrun/libkrunfw internal debug/trace logs are now unreachable via RUST_LOG, weakening VM-startup diagnosability — confirmed via grep -rn krun_init_log/init_logging across src/, only unrelated boxlite-level init_logging_for/gvproxy logging remain.
  • 🧹 .github/workflows/build-runtime.yml:353-356 libkrun-sys publish verification disabled — publish_crate libkrun-sys --no-verify is commented out entirely (not just --no-verify), so crates.io publishing of libkrun-sys is untested by CI until tracked issue refactor(deps): split libkrunfw sidecar package #962 is resolved.

reviewed 54fa166 in a BoxLite microVM · @boxlite-agent review to re-run · powered by BoxLite

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 20 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

src/boxlite/src/util/binary_finder.rs:86

  • BOXLITE_RUNTIME_DIR is currently parsed by splitting on ':', which breaks on platforms where the path list separator differs (notably Windows ;) and can also mis-handle Windows drive letters. Other parts of this PR use std::env::split_paths, so it’s best to be consistent here as well.

Using var_os + split_paths also avoids silently dropping non-UTF8 values.

        let explicit_runtime = std::env::var("BOXLITE_RUNTIME_DIR").ok();

        // 1. Explicit override (highest priority)
        if let Some(runtime_dir) = &explicit_runtime {
            for path in runtime_dir.split(':').filter(|s| !s.is_empty()) {
                builder = builder.with_path(path);
            }
        }

Comment thread src/boxlite/src/util/mod.rs
Comment thread src/boxlite/src/vmm/krun/engine.rs Outdated
Comment thread src/boxlite/src/util/binary_finder.rs Outdated
Copilot AI review requested due to automatic review settings July 8, 2026 11:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 20 changed files in this pull request and generated 2 comments.

Comment thread src/deps/libkrun-sys/Cargo.toml
Comment thread src/deps/libkrun-sys/src/lib.rs Outdated
Copilot AI review requested due to automatic review settings July 9, 2026 03:17
DorianZheng
DorianZheng previously approved these changes Jul 14, 2026

@DorianZheng DorianZheng left a comment

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.

LGTM

@DorianZheng DorianZheng added the e2e-local Triggers the local (in-process) E2E suite on the self-hosted runner label Jul 14, 2026
Copilot AI review requested due to automatic review settings July 14, 2026 12:36
@xhebox

xhebox commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

LGTM

@DorianZheng should be able to run lint and test now

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 47 out of 48 changed files in this pull request and generated 2 comments.

Comment thread src/deps/libkrun-sys/build.rs Outdated
Comment thread src/deps/libkrun-sys/build.rs Outdated
Copilot AI review requested due to automatic review settings July 14, 2026 12:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 15, 2026 05:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 15, 2026 05:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 15, 2026 10:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@boxlite-agent boxlite-agent Bot 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.

📦 BoxLite review — 1 issue

Comment thread scripts/build/fix-go-symbols.sh
Copilot AI review requested due to automatic review settings July 15, 2026 11:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 16, 2026 06:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Link vendored libkrun through Cargo so the static-musl shim uses one Rust runtime and no duplicate-symbol workaround.

Align libkrunfw artifacts with dynamic and static link modes, centralize runtime assembly and target/profile handling, and configure external firmware kernels for static builds.

Cover native musl portability, Go/cgo unwind linking, and CI setup for vendored libkrun checks.
Copilot AI review requested due to automatic review settings July 16, 2026 08:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@DorianZheng
DorianZheng merged commit 2411669 into boxlite-ai:main Jul 16, 2026
50 checks passed
G4614 pushed a commit that referenced this pull request Jul 17, 2026
Three fixes to build-runner-binary.sh after the #937 build refactor:

- unset inherited RUSTFLAGS: an exported RUSTFLAGS overrides
  .cargo/config.toml wholesale and leaks crt-static into proc-macro
  builds, breaking make dist:c.
- restore the shim link flags (#319): relocation-model=static was lost
  when #937 moved rustflags into src/shim/.cargo/config.toml; crt-static
  alone links a static-pie, and the embedded gvproxy Go c-archive
  segfaults pre-main (fs:[0x28] TLS access) in that layout. Scoped via
  env prefix so the flags stay off host proc-macros.
- smoke-test the shim and bundle libkrunfw.* into the runtime payload:
  refuse to package a shim that cannot start, and mirror the canonical
  build-runtime.sh asset collection so the dlopen fallback finds
  libkrunfw.so.5 (libkrun status=-2 otherwise).

Co-Authored-By: Claude Fable 5 <[email protected]>
DorianZheng pushed a commit that referenced this pull request Jul 23, 2026
Applies all five CodeRabbit findings on #1019:

- embedded.rs: key the extracted-runtime cache by manifest hash on every
  profile (re-applies #937's fix) so a same-version rebuild with changed
  assets cannot reuse a stale directory.
- util/mod.rs: forward BOXLITE_RUNTIME_DIR to the child and add its paths
  to the shim's library search path (re-applies #937's fix) so an explicit
  runtime override resolves its sibling libraries.
- e2e-local.yml: scope the App token to Administration + Variables instead
  of inheriting all installation permissions.
- docs/guides/README.md: name the real scripts (build-guest.sh/build-shim.sh).
- docs/development/cli.md: give the fenced block a language (MD040).

Claude-Session: https://claude.ai/code/session_01TKsDvm6v2jB7ZKDVCSUzMA
DorianZheng added a commit that referenced this pull request Jul 23, 2026
## Summary

Reverts #937 (squash commit 2411669).

Not a byte-exact revert — three conflict resolutions keep post-#937 work
intact:

- `src/boxlite/src/runtime/backend.rs`: `UnsupportedNetworkBackend` was
deleted by #992; it stays deleted rather than resurfacing without the
cfg gates #937 had added.
- `src/boxlite/Cargo.toml`: the `rest` feature keeps the
`hyper-rustls`/`rustls` deps added by the tunnels work.
- `scripts/build/build-runtime.sh`: restored to the pre-#937 script;
#1009's sed-portability tweak only applied to #937's rewritten version.

## How to verify

```bash
cargo metadata --offline
BOXLITE_DEPS_STUB=1 cargo check -p libkrun-sys --features krun,krunfw
BOXLITE_DEPS_STUB=1 cargo check -p boxlite --tests --features krun
BOXLITE_DEPS_STUB=1 cargo check --workspace --exclude boxlite-guest --features boxlite/krun
bash -n scripts/build/*.sh
make fmt:check:rust
```

`boxlite-guest` is excluded on macOS hosts: it is Linux-only by
`compile_error!` guard, unchanged by this PR.

https://claude.ai/code/session_01TKsDvm6v2jB7ZKDVCSUzMA


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added explicit debug and release build options for the runtime and
CLI.
  * Improved embedded runtime cache handling during development builds.
  * Added libkrun logging initialization with configurable log levels.

* **Bug Fixes**
  * Improved static linking and cross-platform runtime packaging.
* Reduced unintended environment-variable propagation in sandboxed
processes.

* **Documentation**
* Updated CLI, runtime, and integration build instructions to reflect
the new commands.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: tester <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e-local Triggers the local (in-process) E2E suite on the self-hosted runner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants