Skip to content

Comments

revert: remove in-VM erofs creation, use host-side umoci extraction#98

Merged
hiroTamada merged 1 commit intomainfrom
revert-erofs-optimization
Feb 13, 2026
Merged

revert: remove in-VM erofs creation, use host-side umoci extraction#98
hiroTamada merged 1 commit intomainfrom
revert-erofs-optimization

Conversation

@hiroTamada
Copy link
Contributor

@hiroTamada hiroTamada commented Feb 13, 2026

Summary

This reverts commit 8f3e617.

The in-VM erofs creation optimization had issues with OCI edge cases that go-containerregistry/umoci handles correctly:

  • Directory symlinks (/bin -> usr/bin) not working through overlay+erofs
  • Manual tar extraction missing edge cases in whiteout handling

The optimization saved ~30% build time but caused fork/exec /bin/sh: no such file or directory errors for images using merged /usr directories (common in modern Debian/Ubuntu-based images like Python).

Root Cause

The manual tar extraction + custom whiteout processing in createErofsFromRegistry doesn't handle all OCI edge cases. Specifically, when /bin is a symlink to usr/bin (standard in Debian 12+, Ubuntu 20.04+), the overlay+erofs combination fails to resolve /bin/sh correctly at runtime.

Solution

Revert to the slower but correct host-side extraction pipeline (umoci + mkfs.erofs) until we can properly integrate go-containerregistry inside the builder VM.

Test plan

  • Deploy to staging
  • Test Python app build (previously failing)
  • Test Node.js app build (was working)
  • Verify both apps start successfully

Made with Cursor


Note

Medium Risk
Touches the build completion contract and image conversion/export defaults, which can impact build latency and runtime boot behavior. While largely a revert to a simpler pipeline, regressions could surface in image readiness timing and rootfs mounting assumptions.

Overview
Build completion now always waits for the host-side image conversion pipeline before marking a build ready, addressing a race where the build finished but the image wasn’t usable yet.

This reverts the in-VM EROFS creation/registration path: drops ErofsDiskPath from build results/types, removes createErofsFromRegistry and prebuilt-image registration plumbing, and removes EROFS tooling from the builder image.

Image export defaults are shifted back to ext4 as DefaultImageFormat, and the init overlay setup mounts /dev/vda explicitly as ext4. Separately, the builder image config now defaults to hypeman/builder:latest, and the embedded builder-image Docker build no longer forces --network=host.

Written by Cursor Bugbot for commit e13a4e0. This will update automatically on new commits. Configure here.

This reverts commit 8f3e617.

The in-VM erofs creation optimization had issues with OCI edge cases
that go-containerregistry/umoci handles correctly:
- Directory symlinks (/bin -> usr/bin) not working through overlay+erofs
- Manual tar extraction missing edge cases in whiteout handling

The optimization saved ~30% build time but caused "fork/exec /bin/sh:
no such file or directory" errors for images using merged /usr directories
(common in modern Debian/Ubuntu-based images).

Reverting to the slower but correct host-side extraction pipeline until
we can properly integrate go-containerregistry inside the builder VM.

Co-authored-by: Cursor <[email protected]>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.


// Mount readonly rootfs from /dev/vda.
// Filesystem type is auto-detected to support both ext4 (legacy) and erofs (default).
if err := mount("/dev/vda", "/lower", "", "ro"); err != nil {
Copy link

Choose a reason for hiding this comment

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

Ext4-only mount breaks existing erofs images

High Severity

setupOverlay now mounts /dev/vda as ext4 only. Previously it relied on kernel autodetection, so cached images built as erofs still booted. After this change, any existing erofs rootfs in the image store fails to mount, causing VM boot failures for reused images.

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is fine.

@hiroTamada hiroTamada merged commit bca7c57 into main Feb 13, 2026
4 of 5 checks passed
@hiroTamada hiroTamada deleted the revert-erofs-optimization branch February 13, 2026 16:46
@rgarcia rgarcia mentioned this pull request Feb 13, 2026
4 tasks
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.

1 participant