You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,11 +4,11 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
4
4
5
5
## Build / Test / Format
6
6
7
-
The project is built via `make`, not directly with `swift build`. Two Swift packages live in this repo: the root package (Containerization libraries + `cctl` + macOS-only integration binary) and `vminitd/` (the Linux guest init system, cross-compiled with the Static Linux SDK).
7
+
The project is built via `make`, not directly with `swift build`. Two Swift packages live in this repo: the root package (Containerization libraries + `cctl` + macOS-only integration binary) and `vminitd/` (the Linux guest init system, compiled as a static musl binary inside the Linux dev container via the apple/`container` CLI — see `make vminitd`).
8
8
9
9
-`make all` — build everything (`containerization` + `vminitd` + `init.ext4` rootfs in `bin/`). Default `BUILD_CONFIGURATION=debug`; pass `release` (or use `make release`) for optimized builds.
10
10
-`make containerization` — build just the host-side Swift package (skips vminitd).
11
-
-`make vminitd` — build vminitd / vmexec only. By default uses `LIBC=musl` via the Static Linux SDK;`make linux-build LIBC=glibc` builds via a Linux dev container.
11
+
-`make vminitd` — build vminitd / vmexec only. On macOS this runs `swift build --swift-sdk …-swift-linux-musl`*inside the Linux dev container*via the `container` CLI (the cloud-hypervisor build model), producing static musl binaries at `vminitd/bin/`; no host Swiftly/SDK needed.`make linux-build LIBC=glibc` builds via a Linux dev container.
12
12
-`make test` — unit tests with code coverage. `make coverage` regenerates the coverage report.
13
13
-`make integration` — runs `bin/containerization-integration`. Requires an in-repo kernel under `bin/` (`bin/vmlinux-arm64` on arm64, `bin/vmlinuz-x86_64` or `bin/vmlinux-x86_64` on x86_64); if absent, run `make fetch-default-kernel` to download the Kata-provided kernel for the host arch.
14
14
- Single test: `swift test --filter ContainerizationOCITests.ReferenceTests/testParsing` (Swift Testing / XCTest filter syntax). Targets are listed in `Package.swift`.
@@ -22,7 +22,7 @@ The project is built via `make`, not directly with `swift build`. Two Swift pack
22
22
-`make check` — formatting + license-header lint (this is what the pre-commit hook runs). Uses `.swift-format-nolint` for stricter linting.
23
23
-`make pre-commit` — installs `scripts/pre-commit.fmt` as a git pre-commit hook.
24
24
-`make protos` — regenerates `Sources/Containerization/SandboxContext/SandboxContext.{pb,grpc}.swift` from the `.proto`. Touch this whenever the proto changes; never hand-edit the generated files.
25
-
-`make cross-prep` — installs Swiftly, the pinned Swift toolchain (see `.swift-version`), and the Static Linux SDK. Run once before the first build.
25
+
-`make init` / `make init-image` — `init` compiles the guest and builds `bin/initfs.ext4` (+ a rootfs tar) inside the dev container via `scripts/build-initfs.sh` (mkfs + loop mount, with a `mke2fs -d` fallback), then `init-image` creates the `vminit:latest` OCI image from the tar with the native `cctl` (`cctl rootfs create --rootfs <tar> --image vminit:latest`). CI splits these: a Linux container job builds the initfs artifact, the macOS job runs `init-image`. Building the guest on macOS requires the apple/`container` CLI — there is no host Swiftly / Static Linux SDK setup step anymore.
26
26
27
27
`WARNINGS_AS_ERRORS=true` is the default for both packages. Don't disable it casually — CI builds with it on.
28
28
@@ -88,4 +88,4 @@ These are independently consumable Swift modules. Keep their dependencies narrow
88
88
89
89
## Requirements
90
90
91
-
Apple silicon Mac, macOS 26, Xcode 26. Swift toolchain version is pinned in `.swift-version` (currently `6.3.0`) and installed via Swiftly during `make cross-prep`. Older macOS releases are not supported.
91
+
Apple silicon Mac, macOS 26, Xcode 26. The host-side build uses Xcode's Swift toolchain (`/usr/bin/swift`); the Linux guest is built inside the dev container, so the apple/`container` CLI is required (see the README). The pinned Swift version (`.swift-version`, currently `6.3.0`) tags the dev image and the CI Swift Linux container. Older macOS releases are not supported.
Copy file name to clipboardExpand all lines: README.md
+9-21Lines changed: 9 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,31 +100,19 @@ Set the active developer directory to the installed Xcode (replace `<PATH_TO_XCO
100
100
sudo xcode-select -s <PATH_TO_XCODE>
101
101
```
102
102
103
-
Install [Swiftly](https://github.com/swiftlang/swiftly), [Swift](https://www.swift.org), and [Static Linux SDK](https://www.swift.org/documentation/articles/static-linux-getting-started.html):
103
+
The Linux guest init (`vminitd`/`vmexec`) is compiled as a static binary
104
+
*inside a Linux container* rather than cross-compiled on your Mac, so no Swift
105
+
toolchain, Swiftly, or Static Linux SDK setup is required on the host. Install
106
+
the [`container`](https://github.com/apple/container) CLI, which the build uses
107
+
to compile the guest:
104
108
105
109
```bash
106
-
make cross-prep
110
+
# Install per https://github.com/apple/container, then verify it is on PATH:
111
+
container --version
107
112
```
108
113
109
-
If you use a custom terminal application, you may need to move this command from `.zprofile` to `.zshrc` (replace `<USERNAME>`):
110
-
111
-
```bash
112
-
# Added by swiftly
113
-
."/Users/<USERNAME>/.swiftly/env.sh"
114
-
```
115
-
116
-
Restart the terminal application. Ensure this command returns `/Users/<USERNAME>/.swiftly/bin/swift` (replace `<USERNAME>`):
117
-
118
-
```bash
119
-
which swift
120
-
```
121
-
122
-
If you've installed or used a Static Linux SDK previously, you may need to remove older SDK versions from the system (replace `<SDK-ID>`):
123
-
124
-
```bash
125
-
swift sdk list
126
-
swift sdk remove <SDK-ID>
127
-
```
114
+
The first build automatically builds the Linux dev image used to compile the
0 commit comments