e2fsprogs: defer libblkid/libuuid to util-linux (drop bundled forks) - #366
Merged
Conversation
…tpoint Unblocks Unit 1 of the per-VM writable ext4 volume spec (gominimal/minimal #583, PR #658 R1.7). The guest minimald mounts a per-VM writable volume (/dev/vdb) at /var/lib/minimal, formats it with mkfs.ext4 on first boot, and reclaims space via discard/fstrim. The rootfs was missing all three pieces: - Promote e2fsprogs from a build-only dep (its files were stripped from the image) to the runtime closure, so mkfs.ext4/mke2fs ship in the guest. mke2fs stays on the build PATH via the injected runtime closure, so it still packs the image — the separate build_deps entry is now redundant and removed. - Add util-linux to the runtime closure for fstrim (space reclaim). - Stage /var/lib/minimal as an empty directory. The root is mounted read-only, so minimald cannot mkdir the mountpoint at runtime; it must ship in the image or the mount fails with ENOENT/EROFS. Image stays raw ext4 (rootfs.img); size grows ~26 MiB (from ~444 MB to ~472 MB). Verified in the built image: /var/lib/minimal is empty, mkfs.ext4 -V and fstrim --help resolve, filesystem TYPE=ext4. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ed libs e2fsprogs and util-linux both ship a libblkid.so.1 and libuuid.so.1 with the same soname; the staging composition resolved them to e2fsprogs's older, unversioned forks. util-linux's libmount then loaded those and warned "libblkid.so.1: no version information available" on every fstrim/mount/blkid. Repoint both sonames at util-linux's versioned libs (an ABI superset — e2fsprogs's own mke2fs/e2fsck link them fine, verified by running a real mkfs.ext4 format) and drop the e2fsprogs forks. A guard fails the build if a package bump renames the util-linux targets so this can't silently regress. Verified in the rebuilt image: fstrim --help and mount -V emit zero stderr lines, mkfs.ext4 -V still resolves. Net image size drops ~175 KB. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…le-volume-support # Conflicts: # packages/microvm-rootfs/build.ncl # packages/microvm-rootfs/build.sh
e2fsprogs bundles its own older forks of libblkid and libuuid with the same soname (libblkid.so.1, libuuid.so.1) as util-linux's maintained, symbol- versioned libraries. Any image that ships both — like microvm-rootfs — has the dynamic loader resolve util-linux's libmount against the wrong libblkid, warning "libblkid.so.1: no version information available" on every fstrim/mount/blkid. Configure e2fsprogs with --disable-libblkid --disable-libuuid --disable-uuidd (the standard distro config) so its tools link util-linux's libs — an ABI superset, verified by building and running a real mkfs.ext4 format + fsck.ext4 against them. e2fsprogs now builds no libblkid/libuuid/blkid/findfs/uuidgen; util-linux is the sole provider. pkgconf is added to build_deps because configure locates the system libs via pkg-config, and util-linux to build+ runtime deps. Cycle-safe: microvm-rootfs is the only importer of e2fsprogs, so nothing in util-linux's closure can reach it. This makes the microvm-rootfs libblkid/libuuid symlink-repointing hack from the previous commit redundant, so it's removed — the guest now gets a single, correct libblkid/libuuid and util-linux's modern blkid binary with no build.sh fixups. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@packages/e2fsprogs/build.ncl`:
- Around line 24-34: The `runtime_deps` in `e2fsprogs` are pulling in the full
`util-linux` package even though only `libblkid`, `libuuid`, and `pkgconfig` are
needed. Update the dependency to use `subsetOf` on `util-linux` inside
`build.ncl` so `e2fsprogs` references only the required outputs, and keep the
existing `runtime_deps` list focused on just those subsets rather than the whole
package.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6f3521d0-3af5-47ed-bab6-465423f4a63b
📒 Files selected for processing (3)
packages/e2fsprogs/build.nclpackages/e2fsprogs/build.shpackages/microvm-rootfs/build.sh
💤 Files with no reviewable changes (1)
- packages/microvm-rootfs/build.sh
Address CodeRabbit review on #366: e2fsprogs's tools only DT_NEED libblkid.so.1 and libuuid.so.1 from util-linux at runtime, so pull just those two outputs via subsetOf instead of the whole ~18 MB toolset — consumers of e2fsprogs no longer transitively inherit all of util-linux. build_deps keeps the full util-linux: configure detects the libs via pkg-config and needs the headers + .pc files (OutputData outputs, which subsetOf does not support), and build_deps do not propagate to consumers' runtime closures. Verified: min check missing_runtime_deps passes (DT_NEEDED satisfied by the subset), and the microvm-rootfs guest still has a single util-linux libblkid/libuuid, modern blkid, and a clean mkfs.ext4 + fsck.ext4. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #365 (per Bryan's suggestion to do it now). Stacked on #365 — base this on
mainonce #365 merges.Why
e2fsprogs bundles its own older forks of
libblkidandlibuuidwith the same soname (libblkid.so.1,libuuid.so.1) as util-linux's maintained, symbol-versioned libraries. Any image shipping both — likemicrovm-rootfsafter #365 — has the dynamic loader resolve util-linux'slibmountagainst e2fsprogs's unversionedlibblkid, warninglibblkid.so.1: no version information availableon everyfstrim/mount/blkid.#365 worked around this in the image by repointing symlinks in
microvm-rootfs/build.sh. This fixes it at the source: e2fsprogs stops building its forks and links util-linux's libs instead — the standard distro configuration (Debian/Fedora/Arch all build e2fsprogs--disable-libblkid --disable-libuuid).What
e2fsprogs/build.sh: configure--disable-libblkid --disable-libuuid --disable-uuidd; setPKG_CONFIG_PATHso configure locates util-linux's libs.e2fsprogs/build.ncl: addpkgconf+ fullutil-linuxto build deps (configure needs util-linux's headers and.pcfiles —OutputDataoutputs, whichsubsetOfcan't express — and build deps don't propagate to consumers' runtime closures). AddsubsetOf util-linux ["libblkid", "libuuid"]to runtime deps — only those.sos load at runtime. Drop thelibblkid/libuuid/uuidgenoutputs — no longer built.microvm-rootfs/build.sh: remove the now-redundant libblkid/libuuid symlink-canonicalization block introduced in microvm-rootfs: ship e2fsprogs + util-linux and /var/lib/minimal mountpoint #365.e2fsprogs now builds no
libblkid/libuuid/blkid/findfs/uuidgen; util-linux is the sole provider.Cycle-safe:
microvm-rootfsis the only package in the repo that importse2fsprogs(grep-confirmed), so nothing in util-linux's closure can reach it. Blast radius is exactly these two packages.Verification
minimal package e2fsprogs+minimal patched-build microvm-rootfs, then loopback-mounted the guest image:e2fsprogs artifact:
libblkid*/libuuid*/blkid/findfs/uuidgen; keeps its ownlibext2fs/libe2p/libss/libcom_err.readelf -d mke2fs→NEEDED libblkid.so.1,NEEDED libuuid.so.1(resolved to util-linux's at runtime).min check --packages e2fsprogsall Pass — includingmissing runtime_deps, which confirms every DT_NEEDED lib is satisfied by the declared closure.Guest image:
libblkid.so.1 → libblkid.so.1.1.0and onelibuuid.so.1 → libuuid.so.1.3.0(util-linux); e2fsprogs forks gone.blkid --version→blkid from util-linux 2.42.1(modern binary, not e2fsprogs's 2003-era one).fstrim --help→ exit 0, zero stderr.mkfs.ext4 -qFon a scratch image → exit 0, zero stderr, produces valid ext4 (TYPE="ext4"),fsck.ext4 -fnreports it clean./var/lib/minimalempty;ip+nsenterintact;TYPE="ext4".Downstream
Same handoff as #365 — after this and #365 merge and the artifact publishes,
gominimal/minimalre-pinsmicrovm-rootfsin.minimal/minimal.toml[outputs.minvmd-rootfs]. No separate re-pin needed for e2fsprogs (it has no other consumer).🤖 Generated with Claude Code
Summary by CodeRabbit