fix(release): use built minimald when packing initramfs - #623
Conversation
📝 WalkthroughWalkthroughThe release workflow now fetches guest artifacts separately from initramfs generation, and the helper scripts accept prebuilt ChangesRelease initramfs split and binary reuse
Estimated code review effort: 2 (Simple) | ~12 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
scripts/fetch-artifact.sh (1)
41-49: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueValidation only checks executable bit, not regular-file type.
[ -x "$MIP" ]also returns true for an executable/searchable directory. If$MIPis misconfigured to point at a directory, the check passes and the failure only surfaces later at"$MIP" materialize ...with a less clear error. SinceMIPis CI-controlled input and the downstream failure is still explicit, this is a minor edge case.🛡️ Optional tightening
- [ -x "$MIP" ] || { echo "MIP not an executable file: $MIP" >&2; exit 1; } + [ -f "$MIP" ] && [ -x "$MIP" ] || { echo "MIP not an executable file: $MIP" >&2; exit 1; }🤖 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 `@scripts/fetch-artifact.sh` around lines 41 - 49, The MIP validation in fetch-artifact.sh only checks executability, so a directory can still pass and fail later in the materialize step. Tighten the existing MIP branch by validating that $MIP is a regular executable file before using it, keeping the check near the current [ -x "$MIP" ] guard and preserving the same fallback build-from-source path when MIP is unset.scripts/fetch-libkrun.sh (1)
44-52: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueDuplicated MIP-resolution logic across both fetch scripts.
This block (comment + conditional) is identical to the one in
scripts/fetch-artifact.sh(lines 41-49). Consider extracting a small shared helper (e.g.scripts/lib/resolve-mip.sh, sourced by both) to avoid drift if the fallback/validation logic changes later.♻️ Example extraction
# scripts/lib/resolve-mip.sh resolve_mip() { if [ -n "${MIP:-}" ]; then [ -x "$MIP" ] || { echo "MIP not an executable file: $MIP" >&2; exit 1; } else cargo build -p mip MIP="$ROOT/target/debug/mip" fi }Then in each script:
-if [ -n "${MIP:-}" ]; then - [ -x "$MIP" ] || { echo "MIP not an executable file: $MIP" >&2; exit 1; } -else - cargo build -p mip - MIP="$ROOT/target/debug/mip" -fi +. "$ROOT/scripts/lib/resolve-mip.sh" +resolve_mipSame
-xvs-fnote as flagged infetch-artifact.shalso applies here.🤖 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 `@scripts/fetch-libkrun.sh` around lines 44 - 52, The MIP resolution block in fetch-libkrun.sh duplicates the same fallback/validation logic used by fetch-artifact.sh, so extract it into a shared helper such as resolve_mip in a sourced script under scripts/lib and have both scripts call that helper instead. While refactoring, keep the existing executable check in the MIP branch (the same -x validation used in the current MIP handling) so the behavior stays consistent and doesn’t drift between the two scripts.
🤖 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 `@scripts/fetch-artifact.sh`:
- Around line 41-49: The MIP validation in fetch-artifact.sh only checks
executability, so a directory can still pass and fail later in the materialize
step. Tighten the existing MIP branch by validating that $MIP is a regular
executable file before using it, keeping the check near the current [ -x "$MIP"
] guard and preserving the same fallback build-from-source path when MIP is
unset.
In `@scripts/fetch-libkrun.sh`:
- Around line 44-52: The MIP resolution block in fetch-libkrun.sh duplicates the
same fallback/validation logic used by fetch-artifact.sh, so extract it into a
shared helper such as resolve_mip in a sourced script under scripts/lib and have
both scripts call that helper instead. While refactoring, keep the existing
executable check in the MIP branch (the same -x validation used in the current
MIP handling) so the behavior stays consistent and doesn’t drift between the two
scripts.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1c883f61-040d-487f-9b05-b62ef71de522
📒 Files selected for processing (3)
.github/workflows/release.ymlscripts/fetch-artifact.shscripts/fetch-libkrun.sh
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/release.yml
A naive call to
build-initramfs.shbuilds minimald to embed it in the initramfs, but we've already built it in a different job. Changes the script + wiring to use theminimaldalready built for packing in the initramfs.Summary by CodeRabbit
New Features
Chores