vinix-ports / BOOTSTRAP.md
36 lines · 23 sloc · 6.25 KB · 47a5c59a61fcff634c73a2faca5d93063357de7b
Raw

Building the Vinix release packages

Build the ports outside the source checkout. Keep a separate SDK and package database for each target. Each SDK contains the target headers, startup objects and libraries installed by vpac from a signed test repository. Build tools such as the bootstrap compiler, Make, Python and Meson execute on the Linux worker. Keep their host libraries out of the target include and linker search paths.

Stage Inputs and outputs Check before advancing
C runtime and headers Build patched musl and the architecture-specific Linux UAPI package independently. Install both into the first SDK. Build BusyBox against that SDK. Check the linker map and header inputs. Boot the installed shell and run a dynamically linked program through the packaged loader.
Base libraries and tools Use musl for zlib, bzip2, XZ, Zstandard, Brotli, Expat, libffi, pkgconf, ncurses and GNU Make. libuuid and libcap also use UAPI headers. PCRE2 uses zlib. Vim uses ncurses. Zsh uses ncurses, PCRE2 and libcap. Install each dependency before its consumers. Exercise its library, CLI or loadable modules.
Native compiler Build GMP, then MPFR, then MPC. Build binutils before GCC. GCC also needs a working build-machine C++ compiler. Build its target C++ runtime with the new compiler. Compile, link and run C and C++ programs in the installed target root. Inspect the runtime libraries and startup object ownership.
Package installation and networking Build OpenSSL against musl and UAPI. Install the Mozilla CA bundle. Build libarchive with the packaged compression libraries. GPGME requires libgpg-error and libassuan. Its OpenPGP operations require a working GnuPG installation. Build vpac with its pinned nspkg, Stutter and Vile sources and the target libraries. Build the c-ares and nghttp2 libraries needed by curl before the network tools. In Vinix, use the target vpac to install by name, reject a tampered package, upgrade a package and query ownership. Exercise TLS with the installed CA store.
Fonts and X clients Build libpng against zlib. Build FreeType with Brotli, bzip2, libpng and zlib, then fontconfig against FreeType and Expat. Build X protocol data, Xau and Xdmcp before XCB, then Xlib and the extension libraries. Add font and keyboard data before the server smoke test. Exercise font selection and an X client against the packaged server.
Graphics and release assembly Resolve the current Mesa and legacy Mesa/LLVM stack for the sidecar layout in PROFILES.md. Install the package-owned base, compiler and desktop packages into fresh roots on both architectures. Boot both images. Exercise the native compiler, desktop and GLX. Compare the shipped files and their owners to the release inputs.

The order above describes dependencies. The signed feed receipt, clean-install log, file-ownership check and guest transcript record how far a particular build got. Keep these records beside the package archives, outside Git.

For the exact order within a source-built feed, run the following on the worker. The checker verifies each archive against the receipt from feed publish, reads its .PKGINFO, and resolves runtime, build and check dependencies including versioned providers. Its inputs are the feed and the indicated target architecture. The worker supplies bsdtar, ALPM's vercmp and Python 3.11 or later.

python3 tools/build-order.py x86_64 "$signed_feed" "$work/order"

order.tsv groups packages that may be built after earlier stages finish. edges.tsv records every declared dependency and the selected provider. Missing providers, ambiguous virtual names and cycles leave a pending row and cause a nonzero exit. Host tools still follow the bootstrap sequence above.

The worker resolved all 81 packages in foundation/xlib-combined-01/repo into seven stages. For example, BusyBox follows musl and Linux headers, Xlib follows XCB and Xtrans, and the bitmap fonts follow mkfontscale. The order is in foundation/xlib-order-01/order.tsv with SHA-256 51d1464a0a994328c40264105f8b95b7b22a8922cad177daef98e593d4a6930c. The first signed ARM feed puts both musl and Linux headers in stage zero. Its signed, installed root passed the ownership and ELF audit for 1,165 files and links, including six target ELFs. The worker keeps that receipt in arm/common/sdk-01-audit.log with SHA-256 b315f8d20f2d4c7737fd2e5078c33e12b6183d2ee86a22a9ba6db6852d68c59b.

Running the shared worker

The Ubuntu build worker runs one build or guest test at a time under its shared compile.lock. Builds may use two compiler jobs under the same 1 GiB memory limit. Set MAKEFLAGS=-j2 and CMAKE_BUILD_PARALLEL_LEVEL=2, or pass -j2 to Ninja or Meson. The systemd service runs as a dynamic user with CPUQuota=200%, MemoryHigh=768M, MemoryMax=1G and MemorySwapMax=0. Keep downloads, build directories, emulators and signing tools in private worker state. Store the cgroup's memory.peak and memory.events with each build and record any single-job retry. The operator laptop needs only source edits and SSH.

Verified x86_64 bootstrap

The November 2026 worker run installed 24 packages by name into a fresh root from a test-signed repository. The ownership and ELF auditor at ports revision 4cc4c14 checked 8,169 files and links and 67 ELF files, including interpreter and shared library resolution. The package set includes BusyBox 1.38.0-4, musl, Linux headers, GNU Make, GMP, OpenSSL, the CA bundle, libpng, nghttp2 and c-ares. The worker retains the package hashes in foundation/feed-01/packages.tsv and the client in foundation/sdk-01.

A separate client upgraded BusyBox 1.38.0-3 to 1.38.0-4 and installed vinix-release. vpac recorded BusyBox as owner of /bin/uname and the identity package as owner of /usr/bin/uname. The installed OS ID was vinix. Signed upgrade commands

On the operator machine, ~/.local/state/vinix/ports/musl-busybox-CqkBEA/foundation/receipts.sha256 records the transaction and audit logs. The clean-root audit log has SHA-256 328fbb76a322e5e61b572ee9e7d6fdd52a5cb37613fbc8de2b07d0290f075f49. The signed upgrade log has SHA-256 802496df0b3da0f5f66f1a12f293c910ebb43c4d19a781b58f88bd8ccbd303c6. Guest boot and display protocol checks have their own serial transcript. XCB guest run