ci: one CI image per job kind and fewer jobs, and a release builds the builder once per platform #2557
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2557
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:push-pxwusowyyrwx"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
On current
main(after #2554; no longer stacked). Nine commits in two parts: CI (the restructure, the smaller images, the Windows compiler cache, two fixes for checks failing onmain) and the release build (the pack appended after the link, third-party objects from the last signed release, a trusted-runs-only Rust cache, the Linux builder linked with tools.lock's clang and sysroot again). This is the one PR for today's CI and release work. (#2552, thin LTO, had already merged.)Pull-request CI installed its tools again in every job (rustup, apt, glslang, headers, Python packages, pre-commit), compiled the builder twice (Rust job and e2e job), built the website twice (CI's check and the preview), and ran 16 jobs. This restructures it as decided:
CI images for every check job (commit 1 made one; commit 2 splits it, see below).
scripts/linux/ci_setup.shinstalls everything (apt packages incl. llvm and libclang-rt-18-dev, mise.toml's Rust with rustfmt+clippy via the checksum-pinned rustup, Node/actionlint/ShellCheck from mise.lock, the tests' Python packages, pre-commit with its hooks pre-fetched, glslang 16.6.0, the SPIR-V and Vulkan headers).scripts/linux/checks.Dockerfileruns it (localrun_all.py --container).ci.yml'schangesjob hashes the commit's inputs (scripts/linux/ci_image.sh) and asks the registry anonymously for that tag; the jobs use it viacontainer: image:. A PR that changes the inputs has no image yet: its jobs runci_setup.sh --github-envfirst on the runner's own Ubuntu 24.04, so it is checked with its own tools and pushes nothing.ci-image.yml(main only: push touching the inputs, or by hand) builds the layer on the release runner and pushes it fromdeploywith crane andPACKAGES_TOKEN_SEALED(only main's runs can unseal it), throughRELEASE_UPLOAD_API's host. The runners give jobs no Docker (docker_host: "-"), hence crane, notdocker build. Per-job installs,ci_apt.sh, the rustup/apt caches and glslang/header downloads are gone; the crate cache, ccache, git-base and llvm-mingw caches stay.Quick checks in three jobs: title moved into
pr-description.yml("Title and description", pull_request_target, main's script reading the event file; no PR code). In ci.yml it would rerun on every edit and cancel/replace the code checks. Lint = pre-commit + ShellCheck + actionlint. "Third-party parts and guide screenshots" in ci.yml (third-party.ymlkeeps only the nightly upstream comparison;guide-screenshots.ymlremoved).Website built once: ci.yml's website job keeps
dist/aswebsite-dist-<head sha>;website.yml's preview no longer builds the PR:preview-wait(quick, no secrets) waits for that artifact,preview-upload(deploy, main's code only) downloads it as files (scripts/ci_website_dist.py: only an artifact of ci.yml's pull_request run at that exact commit counts; links, absolute and..paths refused).Builder compiled once: e2e folded into the Rust job,
cargo test --workspace --test end_to_end -- --ignoredaftercargo test, reusing its build. Host C for Windows unchanged apart from the image.SPIR-V fixtures are three
run_all.pychecks (tests/global_load_16,tests/native_suatom,tests/f2i_immediate), built with the tests' SPIR-V headers pin (they pass with it); the spirv-fixtures job is gone.2 test parts instead of 4, with #2554's release-builder pre-build step and 900 s / longer job limits carried over.
test_mods_sizesruns its example in the dev profile (21 s to ~10 s cold).Job summary: run_all.py's
$GITHUB_STEP_SUMMARYlists the failures first with each one's first error line; the full table is folded.Smaller images, in layers (commit 2). The one image was 2.98 GB, 318 MB of it the Go toolchain pre-commit's
golanggitleaks hook downloads. Now gitleaks is mise.toml's prebuilt 8.22.1 (mise.lock, SHA-256) run by thegitleaks-systemhook (same scan;pass_filenames: falseas upstream's golang hook); apt without recommends, no docs/man/locales/lists; Node without headers; caches removed in the step that makes them. Still well over 1.5 GB, so it is two images:longshot-ci-checks(rust, host-windows, tests) 2.1 GB andlongshot-ci-lite(lint, website) 0.6 GB, each tagged by its own name + inputs, each part (system, python, headers, node, tools, rust, hooks) its own reproducible layer (sorted, mtime 0, gzip -n), so a change re-pulls only its layer.Compiler cache for Host C for Windows (commit 3):
check_host_compile.py --launcher ccache, work folder in the checkout,CCACHE_BASEDIRthe checkout, compiler checked by llvm-mingw's name; saved on main only, keyed by llvm-mingw +host/,game/,tools.lock, newest older entry restored. Second run in the image: 66/66 hits, 12 s → 2 s.Fixes for checks failing on main (commits 4, 5):
build-driver'sa_line_over_the_limit_closes_the_channelhit a broken pipe when the builder hung up mid-write, which is the behaviour it checks (accepted now, refusal and close still asserted); and part 4/4'stests/test_lifter.pytimed out at 900 s building its clippy and release tests beside the other checks: the pre-build step now makes those first (nothing skipped).Release builds (commits 6-9, by the pack-append work)
build(release): longshot-builder carries its pack appended after the link ...): the shipped builder is compiled once per platform, and its sources pack (33 members, 131 MB) is attached to the end of the linked program (dev releaseattach; a 64-byte trailer), so a nightly compiles the builder 2 times instead of 4. The Windows build job now waits for the Linux one.build(release): take the third-party objects whose keys did not change ...): reused only after that release'sSHA256SUMS.sigchecks out, object by object by per-object keys; anything changed is compiled.ci(release): keep the shipped builder's compiled Rust between trusted release runs): restored and saved only by runs ofmainandv*tags on the release runner.docs/dev/reference/ci.mdsays what it costs: a poisoned entry would reach a signed build, and the open gap is that anyone who can push a branch here could write a workflow that saves that key on the release runner.build(release): link the shipped Linux builder ...,longshot_builder.py link-tools), so it stays at GLIBC_2.35.changesstill skipsrustandhost-windowson docs-only PRs. No check removed or weakened.Read first:
scripts/linux/ci_setup.sh,scripts/linux/ci_image.sh,.forgejo/workflows/ci.yml,.forgejo/workflows/ci-image.yml,scripts/ci_website_dist.py,docs/dev/reference/ci.md(The CI image).Testing
Tested: Linux (CachyOS):
docker buildof both images (checks2.1 GB,lite0.6 GB); pre-commit with all hooks, gitleaks included, run offline inlite; check_host_compile.py twice under ccache inchecks(66/66 hits);build-driver's channel tests; the three SPIR-V fixtures as run_all checks (pass) and the new failure summary;actionlint, ShellCheck, ruff, py_compile; the game-free tests that read the workflows and run_all (test_checks_container,test_check_pr_description,test_release_workflow,test_dev_packs,test_run_all_*,test_vulkan_fixtures_ci,test_windows_on_linux, …) pass. This PR's own CI runs the fallback path (its image isn't pushed yet).Still to test:
ci-image.ymlbuilds and pushes the image (first real run of crane push throughRELEASE_UPLOAD_API), then ci.yml's jobs pull it (by hand, watching the run)website/: the preview takes CI's dist/ (by hand)Measurements
Verdict: smaller CI images and fewer jobs. Runner-minutes per PR to follow from this PR's own CI timings.
Image sizes (unpacked, local
docker build):checks: system 943 MB, rust 667, python 181, node 138, headers 71, tools 37lite: system-lite 128 MB, python 181, node 138, tools 37, hooks 63Host C for Windows, second run with the cache: 66/66 hits, 12 s → 2 s (local, in the image). Before (#2553's run): 16 jobs, ~54 runner-minutes.
Release builds
Tested by build-mode queue jobs on this PC (no game run):
checked usable, highest symbol GLIBC_2.35;sourcesfrom a fresh cache 2.2-3.7 s, again 0 s; a real game build from the .nup with the attached builder succeeded in 3:08 (built, not run);tools_incomplete); a one-file change's delta 774,834 bytes of 172.7 MB;Risks
Release builds: the Windows job now waits for Linux, so a nightly's wall time can grow even with less compiling; a damaged pack is refused at start (tested). The release Rust cache: a poisoned entry would reach a signed build (main/v* only; the branch-push gap is stated in ci.md). Third-party reuse depends on the signature check of the last release; a failed check compiles everything.
CI: a revert restores the old workflows. If the image push fails, ci.yml keeps working on the fallback (slower, as before). If Forgejo's runner did not interpolate
container: image:fromneeds, every container job would fail at start: this PR's CI shows it. Pulling a ~3 GB image once per runner and tag.Checklist
Ready for review
main; the title is a Conventional Commit. (stacked on #2554)mise run testpasses (any failure that also fails onmainis named). (the workflow-reading tests pass locally; this PR's CI runs the rest)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
tests/that reads changed source is updated, not weakened.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
- lint: the quick runner's image has no ShellCheck; installed from apt - tests: llvm (llvm-mc, test_lifter.py) and libclang-rt-18-dev (the ASan runtime, test_obj_cache_size.py), which --no-install-recommends left out; the same in scripts/linux/checks.Dockerfile - tests: the release longshot-builder (and build-driver's redact example) built before the checks in the part that runs them; --timeout 900 (test_recorder_sync) - test_display_startup_failure: a stub for bc_claim, which main now calls - test_mods_sizes: the long path's case pads its game folder, so /tmp's short scratch folder still makes the path too long - test_release_workflow: the upload-artifact step, not the header comment naming it; cache paths split by line (${{ runner.temp }} has spaces) - test_windows_on_linux: the Vulkan build check is a step of the package job now - test_title_card_strips: nx2/oot_patches.py is gone; its host checks kept. The title card's hooks have no hook site since #2286 (a bug, not fixed here) Co-Authored-By: Claude Opus 5.5 <[email protected]>80886862921c7d1e83bdWIP: ci: one CI image for every check, fewer and faster jobsto WIP: ci: one CI image per job kind, fewer and faster jobsWIP: ci: one CI image per job kind, fewer and faster jobsto WIP: ci: one CI image per job kind and fewer jobs, and a release builds the builder once per platformWIP: ci: one CI image per job kind and fewer jobs, and a release builds the builder once per platformto ci: one CI image per job kind and fewer jobs, and a release builds the builder once per platform