@@ -5,6 +5,11 @@ name: Release VM Kernel
55# "vm-dev" GitHub Release and consumed by release-vm-dev.yml when building the
66# openshell-vm binary.
77#
8+ # The Linux kernel is compiled once on aarch64 Linux. The resulting kernel.c
9+ # (a C source file containing the kernel as a byte array) is shared with the
10+ # macOS job, which only needs to compile it into a .dylib — no krunvm, no
11+ # Fedora VM, no kernel rebuild. This cuts macOS CI from ~45 min to ~5 min.
12+ #
813# This workflow runs on-demand (or when kernel config / pins change). It is
914# intentionally decoupled from the per-commit VM binary build because the
1015# kernel rarely changes and takes 15-45 minutes to compile.
1419
1520permissions :
1621 contents : write
22+ packages : read
1723
1824# Serialize with release-vm-dev.yml — both update the vm-dev release.
1925concurrency :
@@ -26,7 +32,7 @@ defaults:
2632
2733jobs :
2834 # ---------------------------------------------------------------------------
29- # Linux ARM64 — native kernel + libkrun build
35+ # Linux ARM64 — native kernel + libkrun build (also exports kernel.c)
3036 # ---------------------------------------------------------------------------
3137 build-runtime-linux-arm64 :
3238 name : Build Runtime (Linux ARM64)
@@ -56,13 +62,25 @@ jobs:
5662 --build-dir target/libkrun-build \
5763 --output artifacts/vm-runtime-linux-aarch64.tar.zst
5864
59- - name : Upload artifact
65+ - name : Upload runtime artifact
6066 uses : actions/upload-artifact@v4
6167 with :
6268 name : vm-runtime-linux-arm64
6369 path : artifacts/vm-runtime-linux-aarch64.tar.zst
6470 retention-days : 5
6571
72+ # Export kernel.c + ABI_VERSION for the macOS job. kernel.c contains
73+ # the aarch64 Linux kernel as a byte array — it is OS-agnostic and can
74+ # be compiled into a .dylib by Apple's cc without rebuilding the kernel.
75+ - name : Upload kernel.c for macOS build
76+ uses : actions/upload-artifact@v4
77+ with :
78+ name : kernel-c-arm64
79+ path : |
80+ target/libkrun-build/kernel.c
81+ target/libkrun-build/ABI_VERSION
82+ retention-days : 1
83+
6684 # ---------------------------------------------------------------------------
6785 # Linux AMD64 — native kernel + libkrun build
6886 # ---------------------------------------------------------------------------
@@ -102,34 +120,35 @@ jobs:
102120 retention-days : 5
103121
104122 # ---------------------------------------------------------------------------
105- # macOS ARM64 — kernel built via krunvm, libkrun built natively
123+ # macOS ARM64 — uses pre- built kernel.c from Linux ARM64 job
106124 # ---------------------------------------------------------------------------
107125 build-runtime-macos-arm64 :
108126 name : Build Runtime (macOS ARM64)
127+ needs : [build-runtime-linux-arm64]
109128 runs-on : macos-latest-xlarge
110- timeout-minutes : 90
129+ timeout-minutes : 30
130+ env :
131+ RUSTC_WRAPPER : " "
111132 steps :
112133 - uses : actions/checkout@v4
113134
114135 - name : Install dependencies
115136 run : |
116137 set -euo pipefail
117- brew install rust lld dtc xz
118- # libkrunfw from Homebrew (used as a fallback/reference by build scripts)
119- brew install libkrunfw
120- # krunvm is needed to build the Linux kernel inside a Fedora VM
121- brew tap slp/krun
122- brew install krunvm
138+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
139+ echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
140+ brew install lld dtc xz
123141
124- - name : Build custom libkrunfw (kernel)
125- run : crates/openshell-vm/runtime/build-custom-libkrunfw.sh
142+ - name : Download pre-built kernel.c
143+ uses : actions/download-artifact@v4
144+ with :
145+ name : kernel-c-arm64
146+ path : target/kernel-artifact
126147
127- - name : Build portable libkrun
128- run : tasks/scripts/vm/build-libkrun-macos.sh
148+ - name : Build libkrunfw + libkrun from pre-built kernel
149+ run : tasks/scripts/vm/build-libkrun-macos.sh --kernel-dir target/kernel-artifact
129150
130151 - name : Package runtime tarball
131- env :
132- CUSTOM_PROVENANCE_DIR : target/custom-runtime
133152 run : |
134153 tasks/scripts/vm/package-vm-runtime.sh \
135154 --platform darwin-aarch64 \
@@ -235,10 +254,13 @@ jobs:
235254 | Linux x86_64 | `openshell-vm-x86_64-unknown-linux-gnu.tar.gz` |
236255 | macOS ARM64 | `openshell-vm-aarch64-apple-darwin.tar.gz` |
237256
238- **macOS users:** The binary must be codesigned with the Hypervisor entitlement:
239- ```bash
240- codesign --entitlements crates/openshell-vm/entitlements.plist --force -s - ./openshell-vm
257+ ### Quick install
258+
241259 ```
260+ curl -fsSL https://raw.githubusercontent.com/NVIDIA/OpenShell/main/install-vm.sh | sh
261+ ```
262+
263+ Auto-detects your platform, verifies checksums, and codesigns on macOS.
242264
243265 files : |
244266 release/vm-runtime-linux-aarch64.tar.zst
0 commit comments