Derive the Discover adapter version from the snapshot

This commit is contained in:
Archipelago 2026-11-17 11:04:59 +00:00
parent d21b44cc11
commit ff5876f382
4 changed files with 83 additions and 20 deletions

View file

@ -2,6 +2,28 @@
Updated 2026-11-17. Architectural acceptance is separate from implementation.
## Version-independent Discover adapter (2026-11-17)
The ISO cycle `20261117T101510Z` failed at `building-discover-adapter`. The
snapshot moved Discover to `6.8.3-1`, while `build-discover-adapter.sh` still
asserted `discover 6.8.2-1` with a bare `test`; `set -e` therefore exited 1 before
any diagnostic, and the log ended at `pacman -Syu`.
The version is no longer pinned. The adapter reads `pacman -Q discover`, derives
the source version from it, downloads the matching upstream archive and its
published sha256, and builds the backend against exactly that source. It writes the
full package identity to `discover-version.txt`; KDE staging compares that file
with the Discover package in the target tree. The `plasma-setup` recipe is now a
template (`PKGBUILD.in`) rendered with the same release version and verified
source hash, and the Core package repository derives the package filename from
`.PKGINFO` instead of a hardcoded string. A future Plasma point release no longer
needs an adapter edit; an upstream source or checksum that is missing still fails
with an explicit message. The corrected adapter was built once on terra against
the 2026-11-17 snapshot: it selected `discover 6.8.3-1`, verified the upstream
archive (`cfb851d6...`), produced `archipelago-backend.so` with a clean loader
check, and built `plasma-setup 6.8.3-1` from the rendered template. A full
release-cycle rebuild is still pending.
## Plymouth alpha, GC on older images, Container Runner KVM/Toolbx (2026-11-17)
- The Plymouth watermark was regenerated from `archipelago.svg` with

View file

@ -24,8 +24,9 @@ installation data were retained. This motivated the separate cold-cache budget;
successful initial fill still needs evidence from the next normal cycle.
The source freeze includes both native software adapters. Discover's adapter is
built in an ephemeral Arch environment from the checksummed 6.8.2 source archive;
the runtime package identity is checked again in KDE staging. Only the plugin is
built in an ephemeral Arch environment from the source archive matching the
snapshot's installed Discover version, whose upstream sha256 is verified; the same
package identity is checked again in KDE staging. No point release is pinned. Only the plugin is
installed, not the rebuilt Discover application/common library. The run builds
Core once, then GNOME and KDE against its package inputs and layer commit.

View file

@ -40,29 +40,52 @@ systemd-nspawn --quiet --settings=no --register=no \
pacman-key --init
pacman-key --populate archlinux
pacman -Syu --needed --noconfirm base-devel cmake ninja extra-cmake-modules discover qt6-tools kitemmodels curl
test "$(pacman -Q discover)" = "discover 6.8.2-1"
# The backend links libdiscovercommon from the installed Discover. Do not pin a
# point release: derive the source version from the snapshot package, build that
# exact version, and hand its identity to the KDE stage for a runtime check.
installed_discover=$(pacman -Q discover)
if [[ ! $installed_discover =~ ^discover\ ([0-9]+\.[0-9]+\.[0-9]+)-[0-9]+$ ]]; then
printf "Unexpected Discover package identity: %s\n" "$installed_discover" >&2
exit 1
fi
discover_version=${BASH_REMATCH[1]}
printf "%s\n" "$installed_discover" > /output/discover-version.txt
printf "Building the Discover backend against %s (source %s)\n" "$installed_discover" "$discover_version"
exec 9>/sources/download.lock
flock 9
fetch_source() {
local name=$1 hash=$2
local name=$1
local checksum_file="/sources/$name.sha256"
local url="https://download.kde.org/stable/plasma/$discover_version/$name"
if [[ ! -f $checksum_file ]]; then
curl --fail --location --silent --show-error --connect-timeout 20 --max-time 180 \
--retry 2 --retry-max-time 600 --retry-all-errors \
"$url.sha256" -o "$checksum_file.partial"
mv "$checksum_file.partial" "$checksum_file"
fi
local checksum
checksum=$(awk "NR == 1 { print \$1 }" "$checksum_file")
if [[ ! $checksum =~ ^[0-9a-f]{64}$ ]]; then
printf "Invalid upstream checksum file for %s: %s\n" "$name" "$checksum_file" >&2
exit 1
fi
if [[ -f /sources/$name ]]; then
printf "%s %s\n" "$hash" "/sources/$name" | sha256sum -c -
printf "%s %s\n" "$checksum" "/sources/$name" | sha256sum -c -
else
curl --fail --location --silent --show-error --connect-timeout 20 --max-time 180 \
--retry 2 --retry-max-time 600 --retry-all-errors \
"https://download.kde.org/stable/plasma/6.8.2/$name" -o "/sources/$name.partial"
printf "%s %s\n" "$hash" "/sources/$name.partial" | sha256sum -c -
"$url" -o "/sources/$name.partial"
printf "%s %s\n" "$checksum" "/sources/$name.partial" | sha256sum -c -
mv "/sources/$name.partial" "/sources/$name"
fi
cp "/sources/$name" "/output/$name"
}
fetch_source discover-6.8.2.tar.xz 2bc7280155adb003498a3b31817be8815673cc665b424b98b8250cc97dff5bc6
fetch_source plasma-setup-6.8.2.tar.xz d10c2d766e2b1a3afaa70c2995f0abc8eb9ff2da19c9a4e794ae9e89859758d7
fetch_source "discover-$discover_version.tar.xz"
fetch_source "plasma-setup-$discover_version.tar.xz"
flock -u 9
printf "%s %s\n" 2bc7280155adb003498a3b31817be8815673cc665b424b98b8250cc97dff5bc6 /output/discover-6.8.2.tar.xz | sha256sum -c -
mkdir /tmp/discover-build
tar -xf /output/discover-6.8.2.tar.xz -C /tmp/discover-build
source=/tmp/discover-build/discover-6.8.2
tar -xf "/output/discover-$discover_version.tar.xz" -C /tmp/discover-build
source="/tmp/discover-build/discover-$discover_version"
cp -a /adapter "$source/libdiscover/backends/ArchipelagoBackend"
cp /contract/org.archipelago.System1.xml "$source/libdiscover/backends/ArchipelagoBackend/"
cp /contract/qt-types.py "$source/libdiscover/backends/ArchipelagoBackend/"
@ -78,22 +101,28 @@ if grep -q "not found" /output/loader-check.txt; then
cat /output/loader-check.txt >&2
exit 1
fi
sha256sum /adapter/ArchipelagoBackend.cpp /adapter/CMakeLists.txt /output/discover-6.8.2.tar.xz /output/archipelago-backend.so > /output/SHA256SUMS
sha256sum /adapter/ArchipelagoBackend.cpp /adapter/CMakeLists.txt \
"/output/discover-$discover_version.tar.xz" /output/archipelago-backend.so \
/output/discover-version.txt > /output/SHA256SUMS
sha256sum /contract/org.archipelago.System1.xml >> /output/SHA256SUMS
sha256sum /contract/qt-types.py >> /output/SHA256SUMS
# Build the missing upstream onboarding package before Core captures its local
# repository universe. Purpose installs it normally from that signed repository.
source /setup-recipe/PKGBUILD
# Plasma components share a release version, so the package follows Discover.
plasma_checksum=$(awk "NR == 1 { print \$1 }" "/sources/plasma-setup-$discover_version.tar.xz.sha256")
mkdir -p /tmp/plasma-setup-build
sed -e "s/@PKGVER@/$discover_version/" -e "s/@SHA256@/$plasma_checksum/" \
/setup-recipe/PKGBUILD.in > /tmp/plasma-setup-build/PKGBUILD
source /tmp/plasma-setup-build/PKGBUILD
pacman -S --needed --noconfirm "${depends[@]}" "${makedepends[@]}"
useradd -m package-builder 2>/dev/null || true
install -d -o package-builder -g package-builder /tmp/plasma-setup-build
cp /setup-recipe/PKGBUILD /tmp/plasma-setup-build/
cp /output/plasma-setup-6.8.2.tar.xz /tmp/plasma-setup-build/
cp "/output/plasma-setup-$discover_version.tar.xz" /tmp/plasma-setup-build/
chown -R package-builder:package-builder /tmp/plasma-setup-build
runuser -u package-builder -- env SOURCE_DATE_EPOCH=1793145600 bash -ec "cd /tmp/plasma-setup-build; makepkg --noconfirm"
install -m644 /tmp/plasma-setup-build/plasma-setup-6.8.2-1-x86_64.pkg.tar.zst /output/
cp /setup-recipe/PKGBUILD /output/plasma-setup.PKGBUILD
cp /tmp/plasma-setup-build/plasma-setup-6.8.2.tar.xz /output/
install -m644 "/tmp/plasma-setup-build/plasma-setup-$discover_version-1-x86_64.pkg.tar.zst" /output/
cp /tmp/plasma-setup-build/PKGBUILD /output/plasma-setup.PKGBUILD
cp "/tmp/plasma-setup-build/plasma-setup-$discover_version.tar.xz" /output/
sha256sum /output/plasma-setup* >> /output/SHA256SUMS
pacman -Q > /output/packages.txt
'

View file

@ -62,6 +62,7 @@ def adapter_probe(remote_root, desktops):
"""
probe = 'test -f ' + shlex.quote(remote_root + '/software-adapter/libgs_plugin_archipelago.so')
if 'kde' in desktops:
probe += (' && test -f ' + shlex.quote(remote_root + '/discover-adapter/discover-version.txt'))
probe += (' && test -n "$(find ' + shlex.quote(remote_root + '/discover-adapter')
+ ' -name "plasma-setup-*.pkg.tar.zst" -print -quit 2>/dev/null)"')
return probe
@ -411,13 +412,22 @@ find {remote_root}/probes -type f -name '*.py' -exec sha256sum {{}} + >> {remote
config['build_environment']['ARCHIPELAGO_PACKAGE_CACHE'], remote_root + '/discover-adapter']) +
' > ' + shlex.quote(remote_root + '/discover-adapter.log') + ' 2>&1', 14400)
call(['rsync', '-a', f'{worker}:{remote_root}/discover-adapter/', str(run / 'discover-adapter') + '/'])
discover_version = ((run / 'discover-adapter' / 'discover-version.txt').read_text().strip()
if 'kde' in desktops else None)
builds = {v: remote_root + '/' + v + '/build' for v in build_variants}
build_env = dict(config['build_environment'], ARCHIPELAGO_SOFTWARE_PLUGIN=remote_root + '/software-adapter/libgs_plugin_archipelago.so',
ARCHIPELAGO_MIRROR_URL=snapshot_url,
ARCHIPELAGO_BUILD_OUTPUT=mode,
ARCHIPELAGO_LOG_DIR=remote_root + '/cli-logs')
if 'kde' in desktops:
build_env['ARCHIPELAGO_PLASMA_SETUP_PACKAGE'] = remote_root + '/discover-adapter/plasma-setup-6.8.2-1-x86_64.pkg.tar.zst'
packages = sorted(Path(remote_root + '/discover-adapter').glob('plasma-setup-*.pkg.tar.zst'))
if len(packages) != 1:
raise RuntimeError('expected exactly one plasma-setup package in discover-adapter, found '
+ str(len(packages)))
build_env['ARCHIPELAGO_PLASMA_SETUP_PACKAGE'] = str(packages[0])
if not discover_version:
raise RuntimeError('missing Discover identity from the adapter build')
build_env['ARCHIPELAGO_DISCOVER_VERSION'] = discover_version
if 'kde' in desktops and build_env.get('ARCHIPELAGO_UPDATE_PROFILE'):
original_profile = build_env['ARCHIPELAGO_UPDATE_PROFILE']
generated_profile = remote_root + '/update.json'
@ -470,6 +480,7 @@ rm -rf {builds['core']}/iso-work {builds['core']}/profile {builds['core']}/extra
container_env = dict(build_env)
container_env.pop('ARCHIPELAGO_SOFTWARE_PLUGIN', None)
container_env.pop('ARCHIPELAGO_PLASMA_SETUP_PACKAGE', None)
container_env.pop('ARCHIPELAGO_DISCOVER_VERSION', None)
container_command = shlex.join(['env', *[k + '=' + v for k, v in container_env.items()],
'ARCHIPELAGO_CORE_BUILD=' + builds['core'], remote_root + '/archipelago',
'build', 'iso', '--purpose', 'container-runner', builds['container'], config['bootstrap']])