Repository navigation
perf(ci): build every product's binaries once per target - #4763
Conversation
Every Rust product binary now builds through build/build-rust-bins.sh, which takes <package>:<bin> pairs for one target and runs a single cargo invocation, replacing five copies of the same profile/arch/feature logic (and the startbox script's broken debug fallback test). make rust-products builds every product in RUST_PRODUCTS at once, so shared crates compile once per target. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
…spatched run build-products.yaml replaces the start-cli, start-registry, start-tunnel and StartOS build workflows. A changes job classifies the push or pull request against each product's build inputs (the old path filters, now in .github/scripts/changed-products.mjs); one job per target compiles every affected product binary in a single cargo invocation and packages the StartOS tarball and the debs. A publishing build dispatches startos-iso.yaml, which registers the version and builds and deploys each platform under the per-channel lock, pinned to the build's commit. apt-publish-alpha collects each product's latest build that produced all of its debs. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
…apt selection The publisher tests now execute build-products.yaml's changes and publishing steps and startos-iso.yaml's build-run check against stubbed gh/git, check the CLI artifacts against the triples a release attaches, and drop the retired per-product workflows. New tests cover the apt publisher's per-product run selection and scripts/gha-run-commit.sh. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
…ct apt collection Helix-Harness: claude-code Helix-Model: claude-opus-5-5
helix-white
left a comment
There was a problem hiding this comment.
Requesting changes on 3f03b5c0c44e8bde92b1d42fd859ee2cf78cb08b:
-
[P1] Preserve product changes from superseded pushes.
build-products.yamlserializes all master pushes together, but its classifier compares onlyevent.beforewith the current commit. While A builds, a CLI-only push B can be queued and then replaced by a tunnel-only push C. C builds only Tunnel; B's CLI change never gets built or published. The proposal classifies the cumulative diff since the preceding successful push build on that branch, retaining selective builds without dropping queued work. -
[P2] Continue apt collection past pages without eligible runs. In
apt-publish-alpha.yml, an empty filtered$runsends pagination even when the API page contains PR/integration runs and a recent complete master build is on the next page. The three-page cap independently excludes still-live artifacts under sufficient PR activity. The proposal stops when the actual API listing is exhausted or every product has been found, with a regression case placing the eligible build beyond 300 PR runs. -
[P2] Preserve existing StartOS run URLs.
gha-run-commit.shinterprets everystartos-iso.yamlrun's title as a commit. Existing runs of that same workflow path have the nameDebian-based ISO and SquashFSand an ordinary commit-message title, so bothupdate-from-gha --runand release artifact retrieval now reject them despite their artifacts remaining usable. The proposal distinguishesStartOS Publishruns from the earlier image-building workflow before reading a title commit. -
[P2] Select an image-bearing run, not merely a successful workflow.
update-from-gha.shfalls back to the newest successful Build Products run without checking its artifacts. On an integration branch, a successful CLI-only or docs-only push hides an older usable image and makes the updater fail downloading the squashfs. Giving any old publish run unconditional precedence also selects expired or wrong-platform artifacts. The proposal selects the newest successful run across both workflows holding an unexpired squashfs for the requested platform, and declares/documents itsjqdependency. -
[P2] Do not mark an old release container binary current after a debug build.
make rust-products PROFILE=debug RUST_PRODUCTS=start-osbuilds both binaries underdebug, butRUST_OUTPUTS_start-osincludesrelease/start-container. Its subsequenttouch -cmarks an existing stale release binary newer than its inputs, so later image packaging can silently reuse it. The proposal keeps the shared invocation for release builds and uses the existing release target for start-container when building a debug startbox; its production contract and regression cases preserve that profile boundary. -
[P2] Install the CLI from the effective profile. The extracted child builder normalizes an unsupported profile to
debug, but that assignment no longer reachesbuild-cli.sh. For example,PROFILE=dev .../build-cli.sh --installsuccessfully builds debug and then copies fromtarget/.../dev/start-cli, failing or installing a stale file there. The proposal shares profile normalization between the builder and installer rather than duplicating its fallback rule.
The proposal also includes rename-source paths when classifying moves out of a product, plus local redundant-comment cleanup and focused regression cases.
Proposed changes: 3f03b5c...proposal/4763
The reviewed head merges cleanly with origin/master. I inspected the current CI results; completed checks have no failures, while builds and other checks remain in progress. I did not run builds, tests, typechecks, lint, formatting, or the proposed code. The proposal's regression cases are unexecuted.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Adopts @helix-white's review proposal: - a push classifies the diff since the branch's last successful push build (searched over at most ten pages), so a queued push replaced by a later one still builds its products; renamed files count for the product they leave - the apt collector pages past PR-only listings - gha-run-commit.sh reads a title commit from StartOS Publish runs only, so earlier startos-iso.yaml runs keep working - update-from-gha.sh picks the newest successful run holding an unexpired squashfs for the platform (scripts/gha-image-run.sh) - a debug rust-products build refreshes the release start-container through its own rule instead of touching a stale one - build-cli.sh installs from the profile the builder normalized Both run searches stop at listings older than the 14-day artifact retention, and the stale-binary test pins its timestamp. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
|
Thanks. All six points are fixed in 3edfe46, which adopts your proposal with three changes.
Verification on this head:
|
Dismissed by Helix: the changes require a substantive PR brief update. The updated implementation adds cumulative push-build recovery with a rebuild-all fallback, changes artifact pagination and age limits, selects platform-specific unexpired images across workflows, adds the updater's jq prerequisite, restores legacy StartOS run handling, and changes debug/container and CLI-install profile behavior. These material facts require the substantive brief to expand beyond the reviewed implementation's explanation.
Helix-Harness: pi Helix-Model: openai-codex/gpt-6.1-sol
helix-white
left a comment
There was a problem hiding this comment.
The six original findings are addressed in 3edfe4611a8e04f40226533451a64a010d30ab1f. The ten-page classifier bound preserves coverage through its rebuild-all fallback, and pinning the stale fixture's timestamp is appropriate. One remaining change is needed:
[P2] Artifact expiry cannot be inferred from workflow-run creation time. Both apt-publish-alpha.yml and gha-image-run.sh now stop when a page contains only runs created more than 15 days ago. Rerunning a 20-day-old build keeps its original run created_at, but can produce fresh artifacts with another 14 days of retention. When that run falls on an older-only page, the collectors stop before checking those unexpired artifacts. Alpha can consequently miss a complete rerun, and the updater can report no image despite one being available. The cutoff regression cases currently assert rejection of this valid state.
The proposal uses GitHub's named-artifact listing instead: a shared primitive discovers runs holding an unexpired artifact on the requested branch, and each caller applies its own workflow/success or trusted-master-push rules. Apt still requires every architecture from one run. This avoids per-run metadata queries for expired artifacts without guessing availability from run age. It includes old-run/fresh-artifact coverage, pagination and failure cases, consolidates the duplicated GitHub fixtures, and removes the stale cutoff comments.
Proposed changes: 3edfe46...proposal/4763
The reviewed head merges cleanly with origin/master. Existing author/CI evidence covers the adopted fixes; current completed checks show no failures, with other checks still running. I did not execute builds, tests, typechecks, lint, formatting, or the proposed code. The proposal's regression cases are unexecuted.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Adopts @helix-white's review proposal: a rerun keeps its run's creation time but gets fresh artifacts, so run age cannot decide availability. scripts/gha-artifact-run-ids.sh lists the runs on a branch holding an unexpired artifact (GitHub drops expired artifacts from that listing); the apt collector and gha-image-run.sh apply their own run rules to those candidates. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
|
Agreed: a rerun keeps the run's creation time but gets fresh artifacts, so run age can't decide availability. I adopted your proposal in 42f3680. Before adopting it I checked the named-artifact listing against this repo. Expired artifacts drop out of it: Two small additions:
Verification on this head:
|
Dismissed by Helix: the changes require a substantive PR brief update. Apt publishing and image lookup replace the 15-day workflow-run creation cutoff with shared discovery of unexpired named artifacts. Older runs with fresh rerun artifacts now remain eligible instead of being skipped. The substantive brief must describe artifact expiry, rather than originating run age, as the availability boundary and explain the resulting rerun support.
helix-white
left a comment
There was a problem hiding this comment.
Approved at 42f36802dd9337f7f427591f27739cbfb2068cff. All previous findings are addressed.
The shared artifact discovery uses actual expiry and branch metadata, preserving fresh artifacts from older reruns. The apt collector retains its trusted-master-push, workflow and complete-architecture checks; image lookup retains its successful-workflow selection. The adoption differs from the proposal only in explanatory comments, usage headers and formatting.
git merge-tree reports a clean merge with origin/master. I reused the author's reported 351 passing tests and actionlint/Prettier evidence for this head. Current completed CI checks have no failures, while other checks remain in progress. I did not run builds, tests, typechecks, lint or formatting during review.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
…products (#4779) * ci(start-wrt): detect changes and upload rerun-safely like the other products StartWRT is a product like every other, so it now uses the CI mechanisms #4763 built for StartOS and the debs instead of older copies of them: - .github/scripts/classify-event.sh holds the event logic build-products.yaml ran inline: a pull request's files, or a push's diff from the workflow's last successful push build. start-wrt.yaml's new changes job runs it in place of its paths: filters, so a superseded queued push's StartWRT changes still build. - changed-products.mjs lists StartWRT and records which workflow builds each product; --workflow limits its output to that workflow's products. - scripts/s3-put-once.sh is StartOS's skip-identical-bytes S3 upload, now shared with StartWRT's deploy, so re-running a StartWRT deploy resumes it. - pr-retarget.yml grants StartWRT's changes job the permissions it needs. Helix-Harness: claude-code Helix-Model: claude-opus-5-5 * fix(ci): propose workflow-pinned upload tooling for #4779 Helix-Harness: claude-code Helix-Model: claude-opus-5-5 --------- Co-authored-by: helix-white <267227783+helix-a@users.noreply.github.com>
Summary
StartOS, start-cli, start-registry and start-tunnel now build in one workflow,
build-products.yaml. Each target's Rust binaries come from a single cargo invocation, so start-core and its roughly 790 dependencies compile once per target instead of once per product per target. On a push that touches shared crates, the heavy jobs drop from 18 to 6:Every job runs on standard runners.
changesjob decides which products a push or pull request rebuilds, from.github/scripts/changed-products.mjs. That table holds each product's build inputs (the old per-workflowpaths:filters) and the StartOS image-assembly inputs.Build (<arch>); aarch64 on ARM runners, riscv64 cross-compiled on x86).make rust-productsbuilds every affected product binary in one cargo invocation. The same job then packagescompiled-<arch>.tarand the three debs, and uploads the per-triplestart-clibinaries. Separate jobs build the two macOS CLIs, the registry Docker image, and the StartOS images for builds that don't publish: pull requests that touch image assembly,integration/*pushes, and dispatches without a channel.deploy: alpha|betagoes to that channel) dispatchesstartos-iso.yaml. That workflow is now the dispatch-only "StartOS Publish".startos-image.yamltakes the compiled tarball from the build run and checks out the build's commit. It now also produces the migration payload per platform, for both callers.apt-publish-alphanow triggers on "Build Products". For each product it takes the newest completed master push build that holds that product's debs for all three arches. It finds candidates through GitHub's list of unexpired artifacts, so a re-run old build with fresh artifacts still counts, and a product whose packaging failed doesn't hold back the other two.start-cli.yaml,start-registry.yaml,start-tunnel.yaml,compile-start-cli.yamland the build half ofstartos-iso.yaml.build/build-rust-bins.shandbuild/rust-build-profile.sh.runner: fastdispatch option."debug"], so its debug fallback never ran.platforminput, so itsarchchoice was ignored.build-cli.sh --installcopied from the profile it was given rather than the one the builder actually used.Implementation diff: +1060 / −1390 lines in 28 files (excludes lockfiles, tests, docs, release notes, and changelog). The retarget checker script counts as a test. Workflow comments count as implementation.
Consequences to know before merging
build-products.yaml(environment, platform, deploy channel, force-overwrite).startos-iso.yamlneeds a build run id and is meant to be dispatched by a build. Aplatformother thanALLnow also limits the debs to that platform's arch and skips the macOS CLI.workflow_dispatchaccepts only branch or tag refs. Every publish step uses thecommitinput instead. The run's title (StartOS <channel> publish of <sha>) carries that commit, andscripts/gha-run-commit.shreads it there. That helper servesmanage-release.sh pull-ghaandupdate-from-gha.sh; earlierstartos-iso.yamlruns keep using their head commit.build-products.yamlrun exists to diff against. Until then, alpha keeps the debs it has.update-from-gha.sh --branchnow picks the newest successful publish or build run that holds an unexpired squashfs for the device's platform, and it needsjq.Approach
make rust-productsruns the same per-product variables in one invocation. Packaging recipes find the binaries current and don't rebuild them. The deploy-leg, registration and prune logic from perf(ci): faster test builds, parallel test jobs and per-platform StartOS deploys #4762 is unchanged apart from taking the commit from an input.unit-testprofile) can't share these compile units.startos-iso.yamlrun links workingstart-containercurrentNeighbors
build/build-rust-bins.sh. Its other edits merge cleanly.Testing
Shared compile, measured locally on the Helix build host:
make rust-products RUST_PRODUCTS="start-cli start-registry"ran one cargo invocation with start-core compiled once (7 min 35 s cold). The per-product make rules then planned no rebuilds, andmake start-cliwas a no-op.startbox,start-container,start-cli,registryboxandtunnelbox.Workflow tests:
node --test .github/actions/tests/*.test.mjs scripts/tests/*-test.mjsruns 351 tests, all passing. They execute the real step scripts against stubbedghandgitand cover:startos-iso.yamlwith its input names checked against that workflowmanage-release.shattachesrust-productsprofile boundary forstart-container, and the CLI install profilecheck-pr-retarget-workflows.py,rust-builder-selection-test.sh, actionlint (clean apart from the existing SC2012 note in the moved migration job) and Prettier also pass.CI on this head (42f3680): the three
Build (<arch>)jobs passed. That is the first complete CI run of the per-target recipe: each built all four products' binaries in one cargo invocation and packagedcompiled-<arch>.tarand the three debs, in 31–34 min. One such job replaces the old 25–31 min StartOS compile plus three separate 22–33 min product jobs. Also passed: both macOS CLI builds, every test job (start-core 16 min, StartWRT 20 min, the Rust crates 12 min, SDK/runtime/scripts 3 min), Generated Bindings & MCP Catalog, change detection, formatting and changelog. The rest of this head's CI also passed:startos-image.yamlwith the tarballs from this run: 11–21 min for x86_64 and ARM, 75–84 min for RISC-V.Publish StartOSdispatch, which never run on a pull request, plus the retarget-only calls and StartWRT's publish jobs.Deploy legs in production: perf(ci): faster test builds, parallel test jobs and per-platform StartOS deploys #4762's first master publish ran the same leg logic this PR keeps, and every job succeeded. All nine platforms deployed to alpha, each in 2.5–11 min once a runner picked it up. The seven non-RISC-V deploys first waited 9–15 min in the runner queue. The prune read every registry, confirmed the run's images were indexed, and found nothing to delete.
Not exercised end to end: the master publishing path in this PR —
build-products.yamldispatchingstartos-iso.yaml, and the apt collector readingbuild-products.yamlruns. Both run only on master pushes, so the first master push after merge is their first real run.Helix-Harness: claude-code
Helix-Model: claude-opus-5-5