Skip to content

Build vminitd and initfs inside the dev container#810

Merged
crosbymichael merged 1 commit into
apple:mainfrom
crosbymichael:build-vminitd-initfs-in-container
Jul 24, 2026
Merged

Build vminitd and initfs inside the dev container#810
crosbymichael merged 1 commit into
apple:mainfrom
crosbymichael:build-vminitd-initfs-in-container

Conversation

@crosbymichael

Copy link
Copy Markdown
Contributor

No description provided.

@crosbymichael
crosbymichael force-pushed the build-vminitd-initfs-in-container branch 2 times, most recently from 6a95333 to 5aeec39 Compare July 23, 2026 15:11
Signed-off-by: michael_crosby <michael_crosby@apple.com>
@crosbymichael
crosbymichael force-pushed the build-vminitd-initfs-in-container branch from 59b35a9 to 5d3a8c6 Compare July 23, 2026 17:33

// write() to a pipe whose read end is closed must not kill the
// `swift test` process with SIGPIPE on Linux. See ignoreSIGPIPEForTests().
init() { ignoreSIGPIPEForTests() }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Naw, we are safe to ignore SIGPIPE for our applications.

Comment thread Makefile
# 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ya, we can both compile vminitd and build the ext4 based initfs inside the container.

@crosbymichael
crosbymichael merged commit 74ace14 into apple:main Jul 24, 2026
7 checks passed
@crosbymichael
crosbymichael deleted the build-vminitd-initfs-in-container branch July 24, 2026 15:04
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.

2 participants