From a448a65a92ec6a945e4451e1e1c5c08a1b5403ac Mon Sep 17 00:00:00 2001 From: Archipelago Date: Sat, 21 Nov 2026 12:01:09 +0300 Subject: [PATCH] Build the GSConnect package inside the release cycle --- STATUS.md | 31 ++++++++- pipeline/build-gnome-extension.sh | 100 ++++++++++++++++++++++++++++++ pipeline/release-cycle.py | 19 ++++++ tests/cycle-recovery.py | 7 +++ 4 files changed, 156 insertions(+), 1 deletion(-) create mode 100755 pipeline/build-gnome-extension.sh diff --git a/STATUS.md b/STATUS.md index 536905e..dfb214a 100644 --- a/STATUS.md +++ b/STATUS.md @@ -1,6 +1,35 @@ # Infrastructure implementation status -Updated 2026-11-20. Architectural acceptance is separate from implementation. +Updated 2026-11-21. Architectural acceptance is separate from implementation. + +## Phone integration in both Desktops (2026-11-21) + +D-121 adds `kdeconnect` to the KDE Purpose from the pinned repositories. GNOME +gets `gnome-shell-extension-gsconnect`, which Arch does not ship: the new +`infrastructure/pipeline/build-gnome-extension.sh` builds the reviewed recipe +`builder/packages/gsconnect/PKGBUILD` (v74, pinned sha256) inside the isolated +adapter root, installs the declared dependencies from the same snapshot, +rejects an extension that does not declare the snapshot's `gnome-shell` major, +and caches the result by recipe checksum. `release-cycle.py` runs it when GNOME +is part of the cycle and passes `ARCHIPELAGO_GS_CONNECT_PACKAGE` to the build; +`build-iso.sh` records the archive checksum, and `package.sh` now admits local +packages through one `add_local_package` path (name, `.PKGINFO` version, arch) +instead of a plasma-setup-only block, signing the extension into the same local +repository. + +The GNOME package step ships +`/usr/share/glib-2.0/schemas/60-archipelago-gnome.gschema.override` with +`org.gnome.shell enabled-extensions=['gsconnect@andyholmes.github.io']`, and the +finalizer verifies the compiled default with +`GSETTINGS_BACKEND=memory gsettings get` after `glib-compile-schemas`, so a +missing package or override fails the build instead of shipping a desktop that +silently lacks the extension. `python-nautilus` is absent from the pinned +repositories, so Nautilus integration is installed but inert. + +Verified: the adapter build produced +`gnome-shell-extension-gsconnect-74-1-any.pkg.tar.zst` (413 KB, `.PKGINFO` arch +`any`, dependency `gnome-shell`) against `gnome-shell 51.1-1`; builder/contracts/ +composer Rust tests (39) and `control_portal`/`cycle-recovery` checks pass. ## Snapshot retention detaches mounted snapshots (2026-11-20) diff --git a/pipeline/build-gnome-extension.sh b/pipeline/build-gnome-extension.sh new file mode 100755 index 0000000..bd58a95 --- /dev/null +++ b/pipeline/build-gnome-extension.sh @@ -0,0 +1,100 @@ +#!/bin/bash +# Build the GSConnect extension package in isolation. The Arch repositories ship +# no binary package for it, so Archipelago builds the pinned upstream tag itself +# and hands the archive to the Core package step, which adds it to the local +# signed repository every Purpose installs from. +set -euo pipefail +source_root=$1 +tools=$2 +cache=$3 +output=$4 +mirror=${ARCHIPELAGO_MIRROR_URL:-'https://mirror.nw-sys.ru/archlinux/$repo/os/$arch'} +mkdir -p "$output" +sources="$(dirname "$cache")/desktop-sources" +mkdir -p "$sources" + +key=$( { sha256sum < "$0"; printf '%s\n' "$mirror"; + ( cd "$source_root" && find builder/packages/gsconnect -type f -print0 | + LC_ALL=C sort -z | xargs -0 sha256sum ); } | sha256sum | cut -d' ' -f1 ) +cached=$(dirname "$cache")/adapters/gnome-extension-$key +if [[ -f $cached/SHA256SUMS ]]; then + cp -a "$cached"/. "$output"/ + printf 'gnome extension cache hit %s\n' "$key" + exit 0 +fi + +root=$(dirname "$cache")/adapter-tools/gnome-extension/root.x86_64 +if [[ ! -d $root ]]; then + mkdir -p "$(dirname "$root")" + cp -a --reflink=auto "$tools" "$root" +fi +printf 'Server = %s\n' "$mirror" > "$root/etc/pacman.d/mirrorlist" + +systemd-nspawn --quiet --settings=no --register=no \ + --machine="archipelago-gnome-extension-build-$$" -D "$root" \ + --bind-ro="$source_root/builder/packages/gsconnect:/recipe" \ + --bind="$sources:/sources" \ + --bind="$cache:/var/cache/pacman/pkg" --bind="$output:/output" \ + /bin/bash -euo pipefail -c ' +export LC_ALL=C +pacman-key --init +pacman-key --populate archlinux +pacman -Syu --needed --noconfirm base-devel meson ninja gettext +pkgname=gnome-shell-extension-gsconnect +# Read the pinned identity from the reviewed recipe itself; nothing here may +# invent a version or a checksum at build time. +recipe=/recipe/PKGBUILD +source "$recipe" +[[ $pkgname == gnome-shell-extension-gsconnect ]] || { echo "Unexpected recipe name: $pkgname" >&2; exit 1; } +version=$pkgver +checksum=${sha256sums[0]} +[[ $version =~ ^[0-9]+$ ]] || { echo "Invalid GSConnect version: $version" >&2; exit 1; } +[[ $checksum =~ ^[0-9a-f]{64}$ ]] || { echo "Invalid GSConnect checksum: $checksum" >&2; exit 1; } +exec 9>/sources/download.lock +flock 9 +tarball="v$version.tar.gz" +if [[ -f /sources/$tarball ]]; then + printf "%s %s\n" "$checksum" "/sources/$tarball" | 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://github.com/GSConnect/$pkgname/archive/$tarball" -o "/sources/$tarball.partial" + printf "%s %s\n" "$checksum" "/sources/$tarball.partial" | sha256sum -c - + mv "/sources/$tarball.partial" "/sources/$tarball" +fi +flock -u 9 +mkdir -p /tmp/gsconnect-build +useradd -m package-builder 2>/dev/null || true +install -d -o package-builder -g package-builder /tmp/gsconnect-build +cp "$recipe" /tmp/gsconnect-build/PKGBUILD +cp "/sources/$tarball" /tmp/gsconnect-build/ +# Runtime and build dependencies come from the pinned snapshot, exactly like +# makepkg would resolve them; the installed gnome-shell then states which shell +# major this image really has. +pacman -S --needed --noconfirm "${depends[@]}" "${makedepends[@]}" +shell_version=$(pacman -Q gnome-shell | awk "{print \$2}") +shell_version=${shell_version#*:} +shell_major=${shell_version%%.*} +[[ $shell_major =~ ^[0-9]+$ ]] || { echo "Cannot resolve gnome-shell from the snapshot" >&2; exit 1; } +printf "%s\n" "$shell_version" > /output/gnome-shell-version.txt +chown -R package-builder:package-builder /tmp/gsconnect-build +runuser -u package-builder -- env SOURCE_DATE_EPOCH=1793145600 bash -ec "cd /tmp/gsconnect-build; makepkg --noconfirm" +archive=$(find /tmp/gsconnect-build -maxdepth 1 -type f -name "$pkgname-$version-1-any.pkg.tar.zst") +[[ -n $archive && -f $archive ]] || { echo "makepkg produced no package" >&2; exit 1; } +metadata=$(bsdtar -xOf "$archive" "usr/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/metadata.json") +printf "%s\n" "$metadata" > /output/gsconnect-metadata.json +if ! printf "%s\n" "$metadata" | grep -q "\"$shell_major\""; then + echo "GSConnect $version does not declare gnome-shell $shell_major support" >&2 + exit 1 +fi +install -m644 "$archive" /output/ +cp /tmp/gsconnect-build/PKGBUILD /output/gsconnect.PKGBUILD +cp "/sources/$tarball" /output/ +sha256sum /output/gsconnect* /output/"$pkgname-$version-1-any.pkg.tar.zst" > /output/SHA256SUMS +pacman -Q > /output/packages.txt +' + +mkdir -p "$(dirname "$cached")" +test -f "$output/SHA256SUMS" +cp -a "$output" "$cached" +printf 'gnome extension built %s\n' "$key" diff --git a/pipeline/release-cycle.py b/pipeline/release-cycle.py index 4ef1e8c..bd242e9 100644 --- a/pipeline/release-cycle.py +++ b/pipeline/release-cycle.py @@ -414,11 +414,29 @@ find {remote_root}/probes -type f -name '*.py' -exec sha256sum {{}} + >> {remote 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) + # GSConnect is not in the Arch repositories, so the GNOME cycle builds the + # pinned upstream tag and the Core package step adds it to the local + # signed repository every Purpose installs from (D-121). + if 'gnome' in desktops: + if not config.get('flatpak_cache'): + raise ValueError('GSConnect build requires the prepared tools root from flatpak_cache') + phase('building-gnome-extension') + remote(shlex.join(['bash', remote_root + '/source/src/infrastructure/pipeline/build-gnome-extension.sh', + remote_root + '/source/src', config['flatpak_cache'] + '/tools/root.x86_64', + config['build_environment']['ARCHIPELAGO_PACKAGE_CACHE'], remote_root + '/gnome-extension']) + + ' > ' + shlex.quote(remote_root + '/gnome-extension.log') + ' 2>&1', 7200) + call(['rsync', '-a', f'{worker}:{remote_root}/gnome-extension/', str(run / 'gnome-extension') + '/']) 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 'gnome' in desktops: + packages = sorted(Path(remote_root + '/gnome-extension').glob('gnome-shell-extension-gsconnect-*.pkg.tar.zst')) + if len(packages) != 1: + raise RuntimeError('expected exactly one GSConnect package in gnome-extension, found ' + + str(len(packages))) + build_env['ARCHIPELAGO_GS_CONNECT_PACKAGE'] = str(packages[0]) if 'kde' in desktops: packages = sorted(Path(remote_root + '/discover-adapter').glob('plasma-setup-*.pkg.tar.zst')) if len(packages) != 1: @@ -480,6 +498,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_GS_CONNECT_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', diff --git a/tests/cycle-recovery.py b/tests/cycle-recovery.py index 2c53f26..460f31c 100644 --- a/tests/cycle-recovery.py +++ b/tests/cycle-recovery.py @@ -103,4 +103,11 @@ assert 'software-adapter/libgs_plugin_archipelago.so' in probe assert 'discover-adapter' not in probe kde_probe = cycle.adapter_probe('/work/20260101T000000Z', ['gnome', 'kde']) assert 'discover-adapter' in kde_probe and 'plasma-setup-' in kde_probe + +# D-121: the GNOME cycle builds GSConnect from the pinned recipe and hands the +# archive to the Core package step, so every resumed run must rebuild or reuse it. +driver = (Path(__file__).parents[1] / 'pipeline/release-cycle.py').read_text() +assert 'build-gnome-extension.sh' in driver +assert 'ARCHIPELAGO_GS_CONNECT_PACKAGE' in driver +assert 'gnome-shell-extension-gsconnect-*.pkg.tar.zst' in driver print('CYCLE_RECOVERY_ORDER_AND_OWNERSHIP_PASS')