Build Pipeline spk-compile

spk-compile (Project SmechDeployV2) is the sovereign build orchestrator for the entire Smech Labs OS stack. It is a single standalone Python 3 script with zero external dependencies — no pip, no venv, no external build system abstraction. Every build phase is implemented inline. SmechDeploy (the old collection of numbered shell/Python scripts) is retired; spk-compile is the build system.

SmechDeploy is retired The Smech-Labs/SmechDeploy repository is archived. Do not use the old numbered scripts (01_compile_core_system.sh etc.) — they are gone. Use spk-compile.py for all OS builds.

Download

FileVersion
spk-compile.py v2.2.0
curl -fsSL https://github.com/Smech-Labs/spk-compile/releases/download/v2.2.0/spk-compile.py -o spk-compile.py
python3 spk-compile.py --version

Full release notes: github.com/Smech-Labs/spk-compile/releases/tag/v2.2.0

Getting spk-compile

git clone https://github.com/Smech-Labs/spk-compile.git
cd spk-compile

Or call it directly from inside spk (as spk build-image since spk v2.5.0 -- spk compile now means "build one package's source into a .spkg", see spk's README):

spk build-image smechos
spk build-image smechvisor --phase kde
spk build-image --list smechos

spk locates spk-compile.py at /usr/share/spk/spk-compile.py or /opt/smechdeploy/spk-compile.py.

What it builds

OutputProfileCommand
SmechOS root filesystem (glibc/systemd desktop, current) smechos-plasma-live python3 spk-compile.py smechos-plasma-live
SmechOS live ISO (glibc/systemd desktop, current) smechos-plasma-live python3 spk-compile.py smechos-plasma-live --iso live
SmechOS root filesystem (musl/OpenRC, lightweight/legacy) smechos python3 spk-compile.py smechos
SmechOS install ISO (musl/OpenRC, lightweight/legacy) smechos python3 spk-compile.py smechos --iso install
SmechVisor root filesystem smechvisor python3 spk-compile.py smechvisor
SmechVisor install ISO smechvisor python3 spk-compile.py smechvisor --iso install
SmechVisor deploy shim ISO smechvisor python3 spk-compile.py smechvisor --iso shim

Prerequisites

Build in the container, not on bare metal A full smechos-plasma-live build needs an exact set of host packages (a specific GCC version, matching Qt6/KDE build deps, kernel build tools) that is impractical to reproduce by hand. The Dockerfile in the repo builds this environment once, reliably, from a plain ubuntu:24.04 base — see "Building in a container" below. Running spk-compile.py directly against a bare host is only realistic for build-one.sh's single-package builds.

Source tarballs are cached in spk-compile-sources/ (adjacent to --target, bind-mount this as a persistent volume). Re-runs skip already-cached files and already-completed phases via stamp files under spk-compile-sources/.stamps/.

Building in a container

# Build the compile image once (cached after the first run)
podman build -t ghcr.io/smech-labs/smechos-build:latest -f Dockerfile .
# docker build works identically if you have Docker instead of podman

# Run the full build
docker run --rm --privileged --cgroupns=host \
    -v /path/to/spk-compile-sources:/mnt/spk-compile-sources \
    -v /path/to/smechos_build_root:/mnt/smechos_build_root \
    -v /tmp/smechos_build:/tmp/smechos_build \
    ghcr.io/smech-labs/smechos-build:latest smechos-plasma-live
This only builds and bundles the rootfs — it does not produce an ISO Packing is a genuinely separate spk-compile.py invocation (cmd_iso(), triggered by --iso live, runs instead of the phase list, not after it). Phase completion is stamp-file-persisted, so this second run doesn't redo any of the first one's work — it only assembles the ISO from the already-built rootfs.
mkdir -p /path/to/smechos-iso-output
docker run --rm --privileged --cgroupns=host \
    -v /path/to/spk-compile-sources:/mnt/spk-compile-sources \
    -v /path/to/smechos_build_root:/mnt/smechos_build_root \
    -v /tmp/smechos_build:/tmp/smechos_build \
    -v /path/to/smechos-iso-output:/mnt/smechos-iso-output \
    ghcr.io/smech-labs/smechos-build:latest smechos-plasma-live --iso live

The finished ISO lands at smechos-iso-output/smechos-plasma-live.iso.

The container runs as root, so the ISO output directory ends up root-owned on the host. Hashing/signing as a regular user afterward needs a chown first, or sha256sum ... | tee and gpg fail to write their output files silently:

sudo chown -R $(whoami):$(whoami) /path/to/smechos-iso-output
cd /path/to/smechos-iso-output
sha256sum smechos-plasma-live.iso > smechos-plasma-live.iso.sha256
gpg --detach-sign --armor smechos-plasma-live.iso

If a phase fails on a missing package, that's normal — it's a one-line Dockerfile fix, not a real bug. Find the Ubuntu -dev package providing the missing CMake/Meson dependency, add it to the relevant apt-get install block, and rebuild — Docker layer caching keeps this to seconds, and completed phases/packages are skipped via the stamp files, so you only re-pay for the phase that failed. A handful of dependencies aren't in apt at all (KDE-adjacent projects on their own release schedule, or small third-party libraries) — those get built from source inline in phase_kde(); copy the existing pattern there for a new one.

Build Profiles

SmechOS

# Full build
sudo python3 spk-compile.py smechos

# Single phase
sudo python3 spk-compile.py smechos --phase kde

# Custom target path
sudo python3 spk-compile.py smechos --target /mnt/my_build_root

# Build install ISO
sudo python3 spk-compile.py smechos --iso install

SmechVisor

# Full build
sudo python3 spk-compile.py smechvisor

# Deploy shim ISO only
sudo python3 spk-compile.py smechvisor --iso shim

List phases

python3 spk-compile.py --list smechos
python3 spk-compile.py --list smechvisor

Phase Reference

SmechOS phases (24, profile smechos-plasma-live)

#Phase nameWhat it does
1userland-glibcBootstrap GNU userland against host glibc
2etcWrite /etc skeleton: hostname, hosts, fstab, passwd, group, os-release, locale.conf
3systemdInstall systemd from Debian packages
4systemd-configConfigure baseline systemd state
5localeGenerate en_US.UTF-8 locale
6grubCompile GRUB 2.12 EFI (x86_64) + BIOS (i386) from source
7qt-depsCompile Qt6 6.10.3 modules: qtbase, qtdeclarative, qtsvg, qtwayland, qtmultimedia, qt5compat…
8mesaCompile Mesa 24.3.4 with radeonsi, nouveau, swrast gallium + Vulkan AMD/Intel/virtio drivers
9cmake-bootstrapBootstrap CMake 3.31.6
10waylandBuild Wayland 1.24.0
11wayland-protocolsBuild wayland-protocols 1.48
12libinputBuild libinput 1.28.0
13kdeCompile KDE Frameworks 6.24.0 + Plasma 6.6.6
14plasma-configureConfigure display manager (autologin, SDDM fallback)
15kwin-depsCopy KWin compositor runtime deps from the build host
16xwayland-depsFetch Xwayland + xkbcomp + xkb-data
17qt6uitoolsEnsure Qt6UITools .so is present
18kernelCompile Linux 6.12.16: defconfig + KVM, VFIO, IOMMU, RDNA, EFI stub, virtio
19firmwareClone the full upstream linux-firmware tree from git.kernel.org (pinned tag)
20patch-metadataPatch /etc/os-release and KDE .desktop files for SmechOS branding
21discoverCompile AppStream 1.0.4, PackageKit 1.3.0, compile Plasma Discover
22calamaresBuild the Calamares graphical installer
23firefoxInstall Mozilla Firefox stable
24live-initramfsBuild the busybox live initramfs
—bundleBundle output into spk-installable category-level .tar.xz packages
—bundle-spkgEmit one real .spkg per tracked component (currently every KF6/Plasma/Qt6 module) from recorded install manifests

SmechVisor phases (8)

#Phase nameWhat it does
1muslSame as SmechOS musl phase
2userlandSame as SmechOS userland phase
3etcSame as SmechOS etc phase (no desktop entries)
4openrcDeploy OpenRC with hypervisor runlevel config
5inittabWrite inittab (tty1 only, OpenRC)
6kernelCompile Linux 6.12.16 with KVM + VFIO + IOMMU mandatory
7grubCompile GRUB 2.12 EFI + BIOS with intel_iommu=on amd_iommu=on iommu=pt in boot cmdline
8smechvisordFetch smechvisord binary, install to /usr/bin/, write OpenRC init script

Source versions pinned

ComponentVersion
Linux kernel6.12.16
GRUB2.12
Qt66.10.3
KDE Frameworks6.24.0
KDE Plasma6.6.6 (LTS)
Mesa24.3.4
Wayland1.24.0
wayland-protocols1.48
libinput1.28.0
CMake (bootstrap)3.31.6
AppStream1.0.4
PackageKit1.3.0

SmechOS builds against glibc + systemd, not musl/OpenRC — the leaner musl/OpenRC stack is used only by the headless smechos-bitcoin profile (see spk-compile.py's SMECHOS_BITCOIN_PHASES), not the desktop smechos-plasma-live profile this page documents.

Adding a new phase

  1. Write a Python function def phase_myfeature(target): ... in spk-compile.py. Use download(), extract(), cmake_install(), or meson_install() helpers.
  2. Add a tuple ("myfeature", phase_myfeature, "Description") to the relevant phase list — SMECHOS_PLASMA_LIVE_PHASES for the desktop build, or SMECHOS_PHASES / SMECHVISOR_PHASES / SMECHOS_BITCOIN_PHASES for the other profiles — at the correct position.
  3. Run with --phase myfeature to test in isolation before committing to the full build.