From e526bc3e58d0a8f6113a753fa4798b4ee2baeea0 Mon Sep 17 00:00:00 2001 From: Archipelago Date: Fri, 13 Nov 2026 20:16:38 +0300 Subject: [PATCH] Resume: rebuild every variant when the CLI binary changed --- pipeline/release-cycle.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/pipeline/release-cycle.py b/pipeline/release-cycle.py index 51c4822..52c1292 100644 --- a/pipeline/release-cycle.py +++ b/pipeline/release-cycle.py @@ -142,6 +142,10 @@ def main(): shlex.join(['systemd-run', '--wait', '--pipe', '--unit=' + unit, '--property=RuntimeMaxSec=' + str(timeout), 'bash', '-euo', 'pipefail', '-c', script])], timeout + 60) + def remote_text(script): + result = subprocess.run(['ssh', '-o', 'BatchMode=yes', '-o', 'ConnectTimeout=20', worker, script], + capture_output=True, text=True) + return result.stdout.strip() if result.returncode == 0 else '' def tools(argv, signing=False): mounts = ['--mount', f'type=bind,src={base}/data,dst={base}/data', '--mount', f'type=bind,src={run}/pipeline,dst=/pipeline,readonly'] @@ -216,6 +220,10 @@ def main(): + views[-1] + '/$repo/os/$arch') state['snapshot_url'] = snapshot_url # Compile from the frozen source tree, not a possibly stale deployed CLI. + previous_binary = '' + if resume: + previous_binary = remote_text('sha256sum ' + shlex.quote(remote_root + '/archipelago') + + " | cut -d' ' -f1") phase('freezing-and-compiling-source') remote(f'''tar --exclude=.git --exclude=target --exclude=__pycache__ -C {shlex.quote(config['worker_source_root'])} -cf {remote_root}/source.tar src mkdir -p {remote_root}/source @@ -231,6 +239,14 @@ sha256sum {remote_root}/archipelago > {remote_root}/inputs.sha256 sha256sum {remote_root}/archipelagod >> {remote_root}/inputs.sha256 sha256sum {remote_root}/source.tar >> {remote_root}/inputs.sha256 find {remote_root}/probes -type f -name '*.py' -exec sha256sum {{}} + >> {remote_root}/inputs.sha256''') + binary_changed = False + if resume and previous_binary: + current_binary = remote_text('sha256sum ' + shlex.quote(remote_root + '/archipelago') + + " | cut -d' ' -f1") + binary_changed = bool(current_binary) and current_binary != previous_binary + if binary_changed: + print(json.dumps({'event': 'core-rebuild-required', + 'reason': 'CLI binary changed since the previous attempt'}), flush=True) call(['rsync', '-a', f'{worker}:{remote_root}/service-contract-checks.log', str(run / 'service-contract-checks.log')]) call(['rsync', '-a', f'{worker}:{remote_root}/control-portal-checks.log', str(run / 'control-portal-checks.log')]) # D-098 amendment (2026-11-10): Flatpak seeds change only with the monthly @@ -303,7 +319,9 @@ find {remote_root}/probes -type f -name '*.py' -exec sha256sum {{}} + >> {remote env = 'env ' + ' '.join(shlex.quote(k + '=' + v) for k, v in build_env.items()) def variant_done(variant): - if not resume: + # A changed CLI invalidates every existing variant: the purpose layer + # asserts byte identity between the Core payload and this binary. + if not resume or binary_changed: return False probe = ('test -d ' + shlex.quote(builds[variant]) + '/output && test -d ' + shlex.quote(builds[variant]) + '/repo')