From a4227c848aee2da4cfa3c8d9f8cba966a3f9a25c Mon Sep 17 00:00:00 2001 From: diviocity Date: Sun, 29 Nov 2026 23:46:04 +0100 Subject: [PATCH] Inventory pinned base and legacy inputs alongside release index packages --- PROFILES.md | 10 ++++++++ tools/release-closure.v | 52 +++++++++++++++++++++++++++++++++++------ 2 files changed, 55 insertions(+), 7 deletions(-) diff --git a/PROFILES.md b/PROFILES.md index ed21893..334e236 100644 --- a/PROFILES.md +++ b/PROFILES.md @@ -20,3 +20,13 @@ The X11 development sysroot feeds source builds of Xorg/Xvfb 21.1.16 and xf86-vi | `mesa-gl` | `24.0.9-r1` | | `mesa-glapi` | `24.0.9-r1` | | `llvm17-libs` | `17.0.6-r2` | + +For an inventory of the actual base archive and the index-resolved candidates, pass the archive's `lib/apk/db/installed` as the fifth argument to `release-closure`. Keep rows for different versions of the same name. The base archive supplies `busybox-binsh` and `ssl_client`, and the later network layer can refresh libraries already present. Both 3.21.7 archives contain 15 installed package records. + +```sh +tar -xOf "$minirootfs" ./lib/apk/db/installed > "$state/installed" +"$state/release-closure" "$arch" profiles.tsv "$main_index" "$community_index" \ + "$state/installed" > "$state/release-inputs.tsv" +``` + +In this mode, `x11-sidecar` means that the release script requests the package by name. `x11-index-dependency` means the APK metadata pulls it into the dependency calculation. Verify those candidates against the source build or a file used by the image. The final staging commands remove the current Gallium and LLVM 19 libraries and copy the legacy DRI directory, `libGL.so*`, `libglapi.so*` and `libLLVM-17*.so` from the older stack. A packaged sidecar must give each installed path a single owner. [X11 file selection](https://github.com/vlang/vinix/blob/a58255423edea821aef9b2a0d10cb4091d59355a/scripts/build-x11-aarch64.sh#L475-L515) diff --git a/tools/release-closure.v b/tools/release-closure.v index b997e90..9f0b193 100644 --- a/tools/release-closure.v +++ b/tools/release-closure.v @@ -6,7 +6,7 @@ import os // Resolve exactly as the Vinix release builder does, including its provider // preferences. APK's origin field identifies split packages built from a // single source. Source build dependencies come from the native recipes. -fn release_inputs(arch string, profile_file string, indexes []string) ! { +fn release_inputs(arch string, profile_file string, indexes []string, installed string) ! { if arch !in ['x86_64', 'aarch64'] { return error('unknown Vinix release architecture: ${arch}') } @@ -20,6 +20,9 @@ fn release_inputs(arch string, profile_file string, indexes []string) ! { return error('invalid profile row: ${line}') } if fields[0] in ['both', arch] { + if installed != '' && fields[1] == 'minirootfs' { + continue + } profiles[fields[1]] << fields[2] } } @@ -51,22 +54,57 @@ fn release_inputs(arch string, profile_file string, indexes []string) ! { for profile in names { roots << profiles[profile] for pkg in alpinecore.resolve(packages, profiles[profile])! { - applies[pkg.name] << profile + // X11 explicitly fetches the named payloads. Its transitive APK + // requirements are candidates for a source build and ELF audit. + if installed != '' && profile == 'x11-sidecar' && pkg.name !in profiles[profile] { + applies[pkg.name] << 'x11-index-dependency' + } else { + applies[pkg.name] << profile + } } } println('arch\tbinary\tversion\tsource\trepository\tprofiles') for pkg in alpinecore.resolve(packages, roots)! { - println([arch, pkg.name, pkg.version, origins[pkg.name], pkg.repository, - applies[pkg.name].join(',')].join('\t')) + println([arch, pkg.name, pkg.version, origins[pkg.name], pkg.repository, applies[pkg.name].join(',')].join('\t')) + } + if installed == '' { + return + } + // The release unpacks a checksum-pinned tarball before overlaying packages + // from the live branch. Preserve both versions when an overlay updates a file. + mut seen := map[string]bool{} + for record in os.read_file(installed)!.trim_space().split('\n\n') { + mut fields := map[string]string{} + for line in record.split_into_lines() { + if line.len > 2 && line[1] == `:` && line[0] in [`P`, `V`, `A`, `o`] { + fields[line[..1]] = line[2..] + } + } + name := fields['P'] + if name == '' || fields['V'] == '' || name in seen || fields['A'] !in [arch, 'noarch'] { + return error('invalid or duplicate installed package in ${installed}: ${name}') + } + seen[name] = true + println([arch, name, fields['V'], fields['o'] or { name }, 'minirootfs', 'minirootfs'].join('\t')) + } + if 'musl' !in seen || 'busybox' !in seen { + return error('missing bootstrap packages in ${installed}') + } + for name in ['mesa-dri-gallium', 'mesa-gl', 'mesa-glapi', 'llvm17-libs'] { + llvm := name == 'llvm17-libs' + version := if llvm { '17.0.6-r2' } else { '24.0.9-r1' } + origin := if llvm { 'llvm17' } else { 'mesa' } + println([arch, name, version, origin, 'v3.20/main', 'x11-legacy-glx'].join('\t')) } } fn main() { - if os.args.len != 5 { - eprintln('usage: release-closure ARCH PROFILES.tsv MAIN-APKINDEX COMMUNITY-APKINDEX') + if os.args.len !in [5, 6] { + eprintln('usage: release-closure ARCH PROFILES.tsv MAIN-APKINDEX COMMUNITY-APKINDEX [MINIROOTFS-INSTALLED]') exit(2) } - release_inputs(os.args[1], os.args[2], os.args[3..]) or { + installed := if os.args.len == 6 { os.args[5] } else { '' } + release_inputs(os.args[1], os.args[2], os.args[3..5], installed) or { eprintln(err) exit(1) } -- 2.56.1