Skip to content

release(linux): validate source artifacts and reproducible Debian packages (#652) - #1399

Merged
godofecht merged 15 commits into
mainfrom
release/linux-local-qualification-652
Oct 7, 2026
Merged

godofecht merged 15 commits into
mainfrom
release/linux-local-qualification-652

Conversation

@godofecht

@godofecht godofecht commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Part of #652 (Linux side only). This does not close the macOS Homebrew or frozen-release acceptance gate.

Policy accepted by the project owner on 2026-10-07: local, checksum-gated qualification; a reproducible source-built .deb from a pinned commit with SOURCE_DATE_EPOCH and root ownership; hosted CI is not qualification authority; Linux arm64 is explicitly unqualified. Two conditions before merge: port the three shell scripts to Flow tools, and record one real qualification run on Linux with the real flowc on the CI VPS.

Status: ready to merge. The port is done, and the Linux parity runs and the VPS qualification passed on 2026-10-07 (recorded in #1399 (comment)).

Scope

  • ./flow tool qualify_linux_archive --archive FILE --sha256 DIGEST [--out DIR] (was packaging/linux/qualify-release.sh). Checks the archive SHA-256 before reading it, rejects absolute paths, traversal and more than one source root, unpacks into a temporary directory, boots the delivered flow CLI, compiles examples/basics/fibonacci.flow with FLOW_HOST=flowc and requires exit 55. Writes qualification-linux.txt.
  • ./flow tool build_deb [--rev COMMIT] [--out DIR] (was packaging/deb/build.sh; replaces the earlier dpkg-buildpackage stub at tools/build_deb). Builds flow_VERSION-1_all.deb from git archive of a pinned commit with SOURCE_DATE_EPOCH (default: commit time), --root-owner-group and gzip. Writes SHA256SUMS.deb.txt and deb-provenance.txt.
  • ./flow tool qualify_deb --package FILE --sha256 DIGEST [--out DIR] (was packaging/linux/qualify-deb.sh). Checks the digest and Package field, extracts without root, checks the payload and the /usr/bin/flow symlink, then runs the same Fibonacci smoke test. Writes qualification-deb.txt.
  • Shared checks: tools/build_deb/linux_pkg.flow. External commands (git, tar, dpkg-deb, sha256sum, cp, ln, find, touch, readlink, cc) run through std.process via tools/flow_cli/sys.flow, with no shell.
  • ./flow tool qualify_release --mode full on Linux now calls ./flow tool qualify_linux_archive with the digest of the archive it just built.
  • Docs (PLATFORMS.md, docs/project/RELEASING.md, docs/project/release-qualification.md, packaging/README.md) name ./flow tool ... for every step. The three .sh files are deleted.

Messages, exit codes (0 pass, 1 artifact check failed, 2 bad arguments or host) and record file contents follow the scripts. Known differences: the usage line names ./flow tool NAME instead of the script path, and the "missing TOOL" preflight lists only the commands the tool runs.

Gates run (macOS arm64, rebased on origin/main d3942f7)

  • ./flow tool shell_ratchet: PASS (2 shell scripts, 12 lines, limit 12)
  • ./flow tool python_ratchet: PASS
  • ./flow tool script_refs: PASS
  • ./flow tool tool_layout: PASS
  • ./flow tool doc_links: PASS
  • ./flow tool tests/scripts/packaging_specs.flow: 5 passed
  • All three tools and qualify_release compile with the Stage-A flowc. On macOS they stop at the host check (exit 2), as the scripts did.

Merge conditions

Linux arm64 remains unqualified.

@godofecht

Copy link
Copy Markdown
Contributor Author

Design decision, 2026-10-07, decided by the project owner: policy accepted.

  • Qualification is local and checksum-gated.
  • The .deb is reproducible and source-built from a pinned commit, with SOURCE_DATE_EPOCH and root ownership.
  • Hosted CI is not qualification authority.
  • Linux arm64 is explicitly unqualified.

Conditions before merge:

  1. Port the three shell scripts (packaging/linux/qualify-release.sh, packaging/deb/build.sh, packaging/linux/qualify-deb.sh) to Flow tools using std.process, since the shell ratchet rejects them. Callers and docs point at ./flow tool .... Show parity, then delete the scripts.
  2. Record in this PR one real qualification run on Linux with the real flowc (not a mock), on the CI VPS (runner vps-linux).

The port and the VPS run are in progress on this branch. Recorded in docs/project/Questions.md by #1422.

godofecht added a commit that referenced this pull request Oct 7, 2026
The project owner decided six open design questions on 2026-10-07:
orchestration starts as a std.orchestrate library (#723, #1393 closed),
request and persistent lifetime domains (#1369), @Lifetime on struct
fields with LD5 (#1358), last-use moves without a move keyword or COW
(#1354), the type reflection API at Experimental stability (#1365), and
the Linux release qualification policy (#1399).

Questions.md archives each one. The Flow 3.0 tracker records the
library-first rule for orchestration. Follow-up on persistent and
TransportSafe is #1421.
@godofecht
godofecht force-pushed the release/linux-local-qualification-652 branch from 2790988 to 7b54679 Compare October 7, 2026 08:08
godofecht added a commit that referenced this pull request Oct 7, 2026
The project owner decided six open design questions on 2026-10-07:
orchestration starts as a std.orchestrate library (#723, #1393 closed),
request and persistent lifetime domains (#1369), @Lifetime on struct
fields with LD5 (#1358), last-use moves without a move keyword or COW
(#1354), the type reflection API at Experimental stability (#1365), and
the Linux release qualification policy (#1399).

Questions.md archives each one. The Flow 3.0 tracker records the
library-first rule for orchestration. Follow-up on persistent and
TransportSafe is #1421.
godofecht added a commit that referenced this pull request Oct 7, 2026
The project owner decided six open design questions on 2026-10-07:
orchestration starts as a std.orchestrate library (#723, #1393 closed),
request and persistent lifetime domains (#1369), @Lifetime on struct
fields with LD5 (#1358), last-use moves without a move keyword or COW
(#1354), the type reflection API at Experimental stability (#1365), and
the Linux release qualification policy (#1399).

Questions.md archives each one. The Flow 3.0 tracker records the
library-first rule for orchestration. Follow-up on persistent and
TransportSafe is #1421.
@godofecht
godofecht enabled auto-merge October 7, 2026 17:03
@godofecht
godofecht disabled auto-merge October 7, 2026 17:14
@godofecht

Copy link
Copy Markdown
Contributor Author

Auto-merge disabled by the lane E merge agent: the owner's 2026-10-07 decision makes a recorded qualification run on Linux with the real flowc on the CI VPS a condition of merge, and this PR's own status still lists the Linux parity runs and the VPS qualification as outstanding. Re-enable it once that run is recorded here.

…ools

packaging/linux/qualify-release.sh, packaging/deb/build.sh and
packaging/linux/qualify-deb.sh become ./flow tool qualify_linux_archive,
./flow tool build_deb (replacing the earlier dpkg-buildpackage stub) and
./flow tool qualify_deb. They run git, tar, dpkg-deb, sha256sum, cp, ln,
find and touch through std.process with no shell. Shared digest, version,
archive-root and Fibonacci smoke checks live in tools/build_deb/linux_pkg.flow.

qualify_release --mode full on Linux now calls the Flow tool, and the docs
name ./flow tool for every step. The shell ratchet no longer sees the
three scripts.
@godofecht
godofecht force-pushed the release/linux-local-qualification-652 branch from 7b54679 to 4971c75 Compare October 7, 2026 22:20
@godofecht

Copy link
Copy Markdown
Contributor Author

Rebased onto main after #1400 (4971c75). The rebase had no conflicts. Local gates on macOS arm64: qualify_release 13/0, packaging_specs 6/0, tests/tools pass, shell_ratchet, script_refs and doc_links pass, and the three new tools build and answer --help.

I left this PR out of the merge queue because the owner's 2026-10-07 condition is still listed as outstanding here: one recorded qualification run on Linux with the real flowc on the CI VPS (build the .deb twice from one pinned commit and compare SHA-256, then qualify a git archive tarball and the .deb). Once that run is recorded on this PR, gh pr merge 1399 --squash enqueues it.

@godofecht

Copy link
Copy Markdown
Contributor Author

Linux qualification and parity on the CI VPS (2026-10-07)

Result: PASS. The .deb is reproducible and every parity case matches the old scripts.

Host

  • Host: CI VPS srv1519992 (runners flow-vps-1 and flow-vps-2), x86_64, 2 cores
  • OS: Ubuntu 24.04.4 LTS, kernel 6.8.0-139-generic
  • cc: cc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
  • LLVM: 22.1.8 (llvm-config-22); default clang is Ubuntu clang 18.1.3
  • flowc: Stage-A compiler/build/flowc_bootstrap, built by ./flow version from the checked-in compiler/bootstrap/flowc_stage_a.c (sha256 0ad450bef032de957446067016c5d55f5e82a59b7127d469adf9c409fcee8614). ./flow version prints Flow 2.0.0, host: flowc.
  • Run as the unprivileged user ghrunner in a fresh clone under /home/ghrunner, inside flow-runners.slice with Nice=10 and idle IO priority.
  • Commits: PR head 4971c750f5e6c0d34895c633f23ca5c31e2f43d7 (Flow tools); parent 4164ecbb61d8bf2d5291eb96f5765f4bba72a902 (old shell scripts) for parity.

Qualification (Flow tools at 4971c75)

Step Command Exit
Build flowc ./flow version 0
.deb, build A ./flow tool build_deb --rev 4971c750f5e6c0d34895c633f23ca5c31e2f43d7 --out dist/a 0
.deb, build B ./flow tool build_deb --rev 4971c750f5e6c0d34895c633f23ca5c31e2f43d7 --out dist/b 0
Source archive git archive --format=tar.gz --prefix=flow-2.0.0/ -o flow-2.0.0.tar.gz 4971c750f5e6c0d34895c633f23ca5c31e2f43d7 0
Archive ./flow tool qualify_linux_archive --archive flow-2.0.0.tar.gz --sha256 4493226f...63c0 0
.deb ./flow tool qualify_deb --package dist/a/flow_2.0.0-1_all.deb --sha256 9159af62...b0aa 0

Checksums:

9159af62add4e2c61c596245243489dca5aac17a8e1eaf2c8681aa06f232b0aa  dist/a/flow_2.0.0-1_all.deb
9159af62add4e2c61c596245243489dca5aac17a8e1eaf2c8681aa06f232b0aa  dist/b/flow_2.0.0-1_all.deb
4493226f9e83e9966e52cbf6931fabd2c3b041d1f5d9bc896c6dbdde0fef63c0  flow-2.0.0.tar.gz

The two .deb builds are byte-identical (cmp exit 0). deb-provenance.txt: source-commit: 4971c750f5e6c0d34895c633f23ca5c31e2f43d7, source-version: 2.0.0, published: false.

Key output:

PASS: Linux archive qualification (4493226f9e83e9966e52cbf6931fabd2c3b041d1f5d9bc896c6dbdde0fef63c0)
PASS: Linux Debian package qualification (9159af62add4e2c61c596245243489dca5aac17a8e1eaf2c8681aa06f232b0aa)

qualification-linux.txt:

status: PASS
published: false
archive: flow-2.0.0.tar.gz
sha256: 4493226f9e83e9966e52cbf6931fabd2c3b041d1f5d9bc896c6dbdde0fef63c0
source-root: flow-2.0.0
platform: Linux x86_64
cc: cc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
test: flow version; flow compile; fibonacci exit=55

qualification-deb.txt:

status: PASS
published: false
package: flow_2.0.0-1_all.deb
sha256: 9159af62add4e2c61c596245243489dca5aac17a8e1eaf2c8681aa06f232b0aa
version: 2.0.0-1
platform: Linux x86_64
test: extract, version, compile and execute fibonacci (exit 55)

Parity: old script (4164ecb) against Flow tool (4971c75)

Same inputs for both. Output paths were normalized before the diff.

Case Old exit New exit stdout stderr Written files
build_deb --rev 4971c750 vs packaging/deb/build.sh 0 0 same same same: .deb sha256 9159af62...b0aa from both, SHA256SUMS.deb.txt and deb-provenance.txt identical
build_deb --rev 0000000 (bad rev) 1 1 same same (fatal: Needed a single revision) none
qualify_linux_archive vs qualify-release.sh, real digest 0 0 same except the mktemp directory name same qualification-linux.txt identical
same, all-zero digest 1 1 same same (SHA-256 mismatch: actual 4493226f..., expected 0000...) none written by either
qualify_deb vs qualify-deb.sh, real digest 0 0 same except the mktemp directory name same qualification-deb.txt identical
same, all-zero digest 1 1 same same (Debian artifact SHA-256 mismatch) none written by either

The only stdout difference is the random temporary directory in two flow compile lines, for example /tmp/tmp.ubd5N6oeEB/flow-2.0.0/build/fibonacci (script) against /tmp/tmp.XXXXwWK1rD/flow-2.0.0/build/fibonacci (tool). The tool's temp dir name keeps a literal XXXX prefix; this is cosmetic.

Linux arm64 was not run and remains unqualified.

@godofecht
godofecht enabled auto-merge October 7, 2026 22:28
On Linux, GCC in GNU mode predefines `linux` as 1, so the emitted
`StrList* linux = ...` did not compile and qualify_release failed to
build (Dry-run qualify and tests/scripts qualify_release on ubuntu).
Rename the local to linux_gate.
@godofecht

Copy link
Copy Markdown
Contributor Author

Follow-up: Linux build fix for qualify_release (2f70f5f)

Hosted CI on 4971c75 failed Dry-run qualify and Native tools (no Python) on ubuntu. Cause: a local in scripts/tools/qualify_release/main.flow was named linux, which GCC predefines as 1 on Linux, so the emitted StrList* linux = ... did not compile:

qualify_release.tmp.2300.c:3329:12: error: expected identifier or '(' before numeric constant

macOS does not define that macro, so the local gates missed it. Commit 2f70f5f renames the local to linux_gate. The flowc gap is filed as #1442.

Reproduced and re-run on the same CI VPS (Ubuntu 24.04.4, x86_64, as ghrunner in flow-runners.slice, fresh clone):

Commit Command Exit Result
4971c75 ./flow tool tests/scripts/qualify_release.flow 1 13 cases fail with the error above
2f70f5f ./flow tool tests/scripts/qualify_release.flow 0 qualify_release: 13 passed, 0 failed, 0 skipped
2f70f5f ./flow tool qualify_release --mode full --out qr 1 see below

--mode full on Linux, the path this PR adds:

gate sync_version: pass
gate changelog_check: pass
gate stability_manifest: pass
gate doc_examples ... 3 documented Flow block(s) are not compiler-checked
artifact: flow-v2.0.0.tar.gz sha256 90d1159e20d8afda2822f1d1fda6e550e360de0dad2f2efeb32f02c962f96c85
unpack: listed flow-2.0.0/ source archive; required paths present
PASS: Linux archive qualification (90d1159e20d8afda2822f1d1fda6e550e360de0dad2f2efeb32f02c962f96c85)
gate linux_archive: pass
qualify: wrote .../qr published=false tagged=false

The new linux_archive gate passes. The nonzero exit comes from doc_examples strict, which counts three ignore= blocks in docs/language/testing.md (2) and docs/language/mlir-value-semantics.md (1). This PR does not touch those files and the same blocks are on main, so that failure predates this PR. The tool, deb and archive results in the earlier comment are unchanged: 2f70f5f only touches qualify_release.

@godofecht
godofecht added this pull request to the merge queue Oct 7, 2026
Merged via the queue into main with commit 068425f Oct 7, 2026
29 checks passed
@godofecht
godofecht deleted the release/linux-local-qualification-652 branch October 12, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant