Inventory pinned base and legacy inputs alongside release index packages
@@ -20,3 +20,13 @@ The X11 development sysroot feeds source builds of Xorg/Xvfb 21.1.16 and xf86-vi
2020| `mesa-gl` | `24.0.9-r1` |
2121| `mesa-glapi` | `24.0.9-r1` |
2222| `llvm17-libs` | `17.0.6-r2` |
23+
24+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.
25+
26+```sh
27+tar -xOf "$minirootfs" ./lib/apk/db/installed > "$state/installed"
28+"$state/release-closure" "$arch" profiles.tsv "$main_index" "$community_index" \
29+ "$state/installed" > "$state/release-inputs.tsv"
30+```
31+
32+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)
@@ -6,7 +6,7 @@ import os
66// Resolve exactly as the Vinix release builder does, including its provider
77// preferences. APK's origin field identifies split packages built from a
88// single source. Source build dependencies come from the native recipes.
9-fn release_inputs(arch string, profile_file string, indexes []string) ! {
9+fn release_inputs(arch string, profile_file string, indexes []string, installed string) ! {
1010 if arch !in ['x86_64', 'aarch64'] {
1111 return error('unknown Vinix release architecture: ${arch}')
1212 }
@@ -20,6 +20,9 @@ fn release_inputs(arch string, profile_file string, indexes []string) ! {
2020 return error('invalid profile row: ${line}')
2121 }
2222 if fields[0] in ['both', arch] {
23+ if installed != '' && fields[1] == 'minirootfs' {
24+ continue
25+ }
2326 profiles[fields[1]] << fields[2]
2427 }
2528 }
@@ -51,22 +54,57 @@ fn release_inputs(arch string, profile_file string, indexes []string) ! {
5154 for profile in names {
5255 roots << profiles[profile]
5356 for pkg in alpinecore.resolve(packages, profiles[profile])! {
54- applies[pkg.name] << profile
57+ // X11 explicitly fetches the named payloads. Its transitive APK
58+ // requirements are candidates for a source build and ELF audit.
59+ if installed != '' && profile == 'x11-sidecar' && pkg.name !in profiles[profile] {
60+ applies[pkg.name] << 'x11-index-dependency'
61+ } else {
62+ applies[pkg.name] << profile
63+ }
5564 }
5665 }
5766 println('arch\tbinary\tversion\tsource\trepository\tprofiles')
5867 for pkg in alpinecore.resolve(packages, roots)! {
59- println([arch, pkg.name, pkg.version, origins[pkg.name], pkg.repository,
60- applies[pkg.name].join(',')].join('\t'))
68+ println([arch, pkg.name, pkg.version, origins[pkg.name], pkg.repository, applies[pkg.name].join(',')].join('\t'))
69+ }
70+ if installed == '' {
71+ return
72+ }
73+ // The release unpacks a checksum-pinned tarball before overlaying packages
74+ // from the live branch. Preserve both versions when an overlay updates a file.
75+ mut seen := map[string]bool{}
76+ for record in os.read_file(installed)!.trim_space().split('\n\n') {
77+ mut fields := map[string]string{}
78+ for line in record.split_into_lines() {
79+ if line.len > 2 && line[1] == `:` && line[0] in [`P`, `V`, `A`, `o`] {
80+ fields[line[..1]] = line[2..]
81+ }
82+ }
83+ name := fields['P']
84+ if name == '' || fields['V'] == '' || name in seen || fields['A'] !in [arch, 'noarch'] {
85+ return error('invalid or duplicate installed package in ${installed}: ${name}')
86+ }
87+ seen[name] = true
88+ println([arch, name, fields['V'], fields['o'] or { name }, 'minirootfs', 'minirootfs'].join('\t'))
89+ }
90+ if 'musl' !in seen || 'busybox' !in seen {
91+ return error('missing bootstrap packages in ${installed}')
92+ }
93+ for name in ['mesa-dri-gallium', 'mesa-gl', 'mesa-glapi', 'llvm17-libs'] {
94+ llvm := name == 'llvm17-libs'
95+ version := if llvm { '17.0.6-r2' } else { '24.0.9-r1' }
96+ origin := if llvm { 'llvm17' } else { 'mesa' }
97+ println([arch, name, version, origin, 'v3.20/main', 'x11-legacy-glx'].join('\t'))
6198 }
6299}
63100
64101fn main() {
65- if os.args.len != 5 {
66- eprintln('usage: release-closure ARCH PROFILES.tsv MAIN-APKINDEX COMMUNITY-APKINDEX')
102+ if os.args.len !in [5, 6] {
103+ eprintln('usage: release-closure ARCH PROFILES.tsv MAIN-APKINDEX COMMUNITY-APKINDEX [MINIROOTFS-INSTALLED]')
67104 exit(2)
68105 }
69- release_inputs(os.args[1], os.args[2], os.args[3..]) or {
106+ installed := if os.args.len == 6 { os.args[5] } else { '' }
107+ release_inputs(os.args[1], os.args[2], os.args[3..5], installed) or {
70108 eprintln(err)
71109 exit(1)
72110 }