Repository navigation
Build vminitd and initfs inside the dev container - #810
Merged
crosbymichael merged 1 commit intoJul 24, 2026
Merged
Conversation
crosbymichael
force-pushed
the
build-vminitd-initfs-in-container
branch
2 times, most recently
from
July 23, 2026 15:11
6a95333 to
5aeec39
Compare
Signed-off-by: michael_crosby <[email protected]>
crosbymichael
force-pushed
the
build-vminitd-initfs-in-container
branch
from
July 23, 2026 17:33
59b35a9 to
5d3a8c6
Compare
noah-thor
reviewed
Jul 23, 2026
|
|
||
| // write() to a pipe whose read end is closed must not kill the | ||
| // `swift test` process with SIGPIPE on Linux. See ignoreSIGPIPEForTests(). | ||
| init() { ignoreSIGPIPEForTests() } |
Contributor
There was a problem hiding this comment.
nit: Are there any tests we don't want to ignore this? Could make this a test trait, but functionality will be the same, just maybe more "idiomatic"
Contributor
Author
There was a problem hiding this comment.
Naw, we are safe to ignore SIGPIPE for our applications.
| # variables so `vminitd` (compile only) and `init` (compile + build the initfs | ||
| # in a single container run) don't duplicate the command. | ||
| VMINITD_BUILD_CMD = make -C vminitd BUILD_CONFIGURATION=$(BUILD_CONFIGURATION) WARNINGS_AS_ERRORS=$(WARNINGS_AS_ERRORS) | ||
| INITFS_BUILD_CMD = ./scripts/build-initfs.sh --vminitd vminitd/bin/vminitd --vmexec vminitd/bin/vmexec --ext4 bin/initfs.ext4 --tar bin/init.rootfs.tar.gz |
Contributor
There was a problem hiding this comment.
Would it be beneficial to make this script a make target?
|
|
||
| @Option(name: .customLong("ext4"), help: "The path to an ext4 image to create.") | ||
| var ext4File: String? | ||
| static let configuration = CommandConfiguration( |
Contributor
There was a problem hiding this comment.
For my understanding, the refactor of this class is because now we don't need to do these operations from a darwin host and thus they can be done "natively" in linux during the build-initfs?
Contributor
Author
There was a problem hiding this comment.
Ya, we can both compile vminitd and build the ext4 based initfs inside the container.
noah-thor
approved these changes
Jul 23, 2026
philipparndt
added a commit
to philipparndt/k3c
that referenced
this pull request
Aug 25, 2026
The v0.26.0 release failed in 17s at `make -C .forks/containerization/vminitd cross-prep` — "No rule to make target". apple/containerization#810 removed the host cross-compile path: vminitd and the initfs are now built inside a Linux dev container that containerization launches via apple/container, and cctl's `rootfs create` no longer builds the ext4 from binaries, only packages a prebuilt tar. A GitHub macOS runner has no nested virtualization, so it cannot launch that container. Upstream split `init-image` out of `init` for exactly this case. Build the initfs on ubuntu-24.04-arm (free for public repos) in a swift:6.3-noble container mirroring images/linux-dev/Dockerfile, create the OCI image there too, and hand the macOS job a finished init.tar as an artifact. build-initfs.sh falls back to `mke2fs -d` when no loop device is available, which is the case in an unprivileged Actions container. To keep the ~30 minute Swift build skippable, the payload-cache probe moves into its own cheap job whose output gates both expensive jobs. Both fork refs are pinned full SHAs, so the key no longer needs the forks checked out. `make build` locally now requires a working `container` on PATH for the same upstream reason; noted on the runtime target. Co-authored-by: Claude Opus 5 <[email protected]>
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.
No description provided.