build(just): link the dev stack against the static libkrun on Linux - #1108
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 52 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Comment |
f170503 to
d6098d3
Compare
`just up` built minvmd against the DYNAMIC upstream libkrun package and put ~/.krun on LD_LIBRARY_PATH. Linux users receive a static-musl binary, so the dev stack was exercising a linkage nobody ships. Same principle as the CI change: don't develop against a configuration we don't distribute. Aside from the obvious "works locally, breaks in release" risk, it means the merge-and-objcopy-localize pass that produces libkrun.a — the part most likely to misbehave at runtime — was never once hit by day-to-day development. - `libkrun-static` builds libkrun.a from the vendored pin into .scratch/libkrun-static/<triple>, skipping when present. `clean` removes it: the archive is keyed to the pin, so a stale one would silently outlive a pin bump. - `minvmd-build` (Linux) builds for the musl target against it, with MINVMD_REQUIRE_LIBKRUN=static so a missing archive is an error rather than a runtime-bailing stub. - `test-vm` (Linux) does the same, keeping the recipe a true twin of ci-linux-kvm's test job now that lane is static too. - minvmd lands under target/<triple>/debug on Linux, so `minvmd-dir` leads PATH — `min` still autospawns `minvmd` by bare name. - The global LD_LIBRARY_PATH export is gone. A static minvmd dlopens nothing, so there is nothing for the loader to resolve. The `libkrun` fetch recipe stays: nightly-tests.yml still builds against the upstream package, and this is how you reproduce that locally. It is just no longer on the dev stack's path. macOS is untouched — it ships a dylib and keeps the native debug dir. Refs #1065 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A static minvmd dlopens nothing, so dropping the LD_LIBRARY_PATH export was right, but the `env` recipe still expanded $LD_LIBRARY_PATH. just runs recipes under `sh -cu`, so the now-unset variable aborted the recipe with "parameter not set" on Linux and macOS alike, breaking the documented eval "$(just env)" flow. Every other $VAR the justfile's recipes reference is still exported; this was the only orphan. Also correct AGENTS.md's recipe count to 41, which is what `just --summary` reports here (the number was already stale before this branch). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
main dropped AGENTS.md's hand-maintained recipe list in favour of `just
--list`, which cannot drift. That makes each recipe's caption (the last comment
line above it) the actual documentation, and four of the recipes this branch
touches ended their comment block mid-explanation:
clean # would silently outlive a pin bump.
libkrun # you reproduce that locally.
minvmd-build # makes a missing libkrun.a an error rather than a silent ...
Reorder to the convention the justfile already uses elsewhere (`artifacts`,
`minvmd-build` on macOS): rationale first, blank comment line, caption last.
No behaviour change; only the comment blocks move.
ea8c505 to
e1ad56d
Compare
just upbuilt minvmd against the dynamic upstream libkrun package and put~/.krunonLD_LIBRARY_PATH. Linux users receive a static-musl binary. The dev stack was exercising a linkage nobody ships.Same principle as the CI change: don't develop against a configuration we don't distribute. Beyond the obvious "works locally, breaks in release" risk, it meant the merge-and-
objcopy-localize pass that produceslibkrun.a— the part most likely to misbehave at runtime — was never once hit by day-to-day development.Changes
libkrun-staticlibkrun.afrom the vendored pin into.scratch/libkrun-static/<triple>minvmd-build(Linux)LIBKRUN_PREFIX=~/.krunMINVMD_REQUIRE_LIBKRUN=statictest-vm(Linux)ci-linux-kvm's test jobcleanTwo details worth calling out:
cleanremoveslibkrun.a. It is keyed to the vendored pin, so a stale one would silently outlive a pin bump — exactly the failure the CI composite avoids by hashing the pin into its cache key.minvmd moves to
target/<triple>/debugon Linux, sominvmd-dirnow leadsPATH.minstill autospawnsminvmdby bare name, and every other recipe is unchanged.LD_LIBRARY_PATHexport removed. A static minvmd dlopens nothing; there is nothing for the loader to resolve.What stays
The
libkrunfetch recipe remains.nightly-tests.ymlstill builds against the upstream dynamic package, and this is how you reproduce that locally — it is just no longer on the dev stack's path.macOS is untouched: it ships a dylib and keeps the native debug dir.
Verification
just --evaluateresolves the new variables correctly and every recipe parses. AGENTS.md's recipe map is updated (count,libkrun, newlibkrun-static,minvmd-build).Not verified locally: the Linux branch of the
minvmd-dirconditional and the recipes themselves — this is a macOS host, where[linux]recipes don't run.ci-linux-kvmexercises the same script and target via #1104.Refs #1065
🤖 Generated with Claude Code
Note
Link the Linux dev stack against a static libkrun built for the musl target
libkrun-staticrecipe in justfile that buildslibkrun.afor the musl target into.scratch/libkrun-static/<musl-triple>, skipping the build if the artifact already exists.minvmd-buildrecipe to depend onlibkrun-staticand build with--target <musl-triple>, settingMINVMD_REQUIRE_LIBKRUN=staticandLIBKRUN_PREFIXto the static artifact directory.minvmd-dirto resolve totarget/<musl-triple>/debugon Linux andtarget/debugon macOS, and removesLD_LIBRARY_PATHfrom the exported environment.test-vmon Linux to runcargo nextestwith--target <musl-triple>and the static libkrun environment variables instead of the dynamic prefix.LD_LIBRARY_PATHand the producedminvmdbinary is now a musl-linked static executable.Macroscope summarized e1ad56d.