From f3e17db2c8176610c871cee321455730dbd89790 Mon Sep 17 00:00:00 2001 From: diviocity Date: Mon, 30 Nov 2026 15:45:52 +0100 Subject: [PATCH] Add the signed build-base metapackage --- BOOTSTRAP.md | 2 ++ build-base/PKGBUILD.vile | 11 +++++++++++ tests/installed-root.v | 29 +++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 build-base/PKGBUILD.vile diff --git a/BOOTSTRAP.md b/BOOTSTRAP.md index 961db26..8182945 100644 --- a/BOOTSTRAP.md +++ b/BOOTSTRAP.md @@ -23,6 +23,8 @@ The x86_64 compiler build then compiled and linked `libitm` with the newly built The retry produced `gcc-14.2.0-1-x86_64.pkg.tar.zst`, SHA-256 `136aeee3c040fcf356e3ff0d3e83150883c6452e4c3de9ea18bac4e60809b22a`. It reused the compiler objects and peaked at 545 MiB. The new signed SDK installed 18 packages and the auditor checked 3,763 owned paths and 101 target ELFs. See `gnu/gcc-package-release-01`, receipt SHA-256 `c7bce72a61d40ab598c25b7171b4f4ba244bc4574e353ba74d091fc6199b24f4`, and `gnu/gcc-final-verification-01/sdk/audit.log`. Running programs built by this compiler remains a separate acceptance check. +Installing `build-base` by name from a signed x86_64 repository brought in 17 packages. The installed-root audit checked 3,196 owned files and links and 95 target ELFs. ALPM gives the metapackage a zero-byte file list. The auditor checked its archive manifest for package metadata and also rejected an empty file list substituted for the installed musl record. See `foundation/installed-root-meta-02`, receipt SHA-256 `0632e6ff628e031080655367caa4aa01df213d328e32c1bae77a82bd766330f2`. + 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. ```sh diff --git a/build-base/PKGBUILD.vile b/build-base/PKGBUILD.vile new file mode 100644 index 0000000..e1198da --- /dev/null +++ b/build-base/PKGBUILD.vile @@ -0,0 +1,11 @@ +defpkgbuild(build-base, + #:pkgname, "build-base", + #:pkgver, "1.0", + #:pkgrel, 1, + #:pkgdesc, "Vinix C and C++ build environment", + #:arch, [#:any], + #:url, "https://github.com/vlang/vinix", + #:license, "0BSD", + ; musl contains the startup objects and libc headers, and gcc includes g++. + #:depends, ["binutils", "file", "gcc", "make", "musl", "linux-headers", "fortify-headers", "patch"], + #:package, fn() {}) diff --git a/tests/installed-root.v b/tests/installed-root.v index 06a607e..448756c 100644 --- a/tests/installed-root.v +++ b/tests/installed-root.v @@ -55,6 +55,31 @@ fn (client &Client) resolve(path string) !string { return parts.join('/') } +fn check_empty_file_list(dir string) ! { + // libalpm writes a zero-byte files record for metadata-only packages. + mtree := os.exec(['gzip', '-dc', '--', os.join_path(dir, 'mtree')]) + if mtree.exit_code != 0 || !mtree.output.starts_with('#mtree\n') { + return error('missing or invalid mtree for ${os.base(dir)}') + } + mut has_pkginfo := false + for line in mtree.output.split_into_lines() { + if line == '' || line.starts_with('#') || line.starts_with('/set ') + || line.starts_with('/unset ') { + continue + } + path := line.all_before(' ') + if path !in ['./.PKGINFO', './.BUILDINFO', './.INSTALL', './.CHANGELOG'] { + return error('empty file list for ${os.base(dir)} with payload path ${path}') + } + if path == './.PKGINFO' { + has_pkginfo = true + } + } + if !has_pkginfo { + return error('missing package metadata in mtree for ${os.base(dir)}') + } +} + fn (mut client Client) load_owners(database string) !int { mut packages := 0 for entry in os.ls(database)! { @@ -70,6 +95,10 @@ fn (mut client Client) load_owners(database string) !int { } packages++ list := os.read_file(os.join_path(dir, 'files'))! + if list == '' { + check_empty_file_list(dir)! + continue + } if !list.starts_with('%FILES%\n') { return error('missing file list for ${entry}') } for file in list.all_after('%FILES%\n').all_before('\n\n').split_into_lines() { if file == '' || file.ends_with('/') { -- 2.56.1