Run the corpus-sync NIF's three builds on one cargo profile #10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ceres/9-lint-one-profile"
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?
Purpose (from macula-services/mcl-rag#9): lint on main finishes inside its own timeout, so a landing on main reads green or red for a reason in the code.
What changed
One file,
.github/workflows/lint.yml, in thecheckjob, fornative/mcl_rag_corpus_sync_nifonly:cargo clippy --all-targets -- -D warnings→cargo clippy --release --all-targets -- -D warningscargo test --locked→cargo test --release --lockedbash scripts/build-corpus-sync-nif.shunchanged — it already runscargo build --releaseCargo runs a build script's work once per profile. The crate's dependency tree is mostly C — vendored libgit2 and openssl-src, the 5m38s the issue measured inside the clippy step — so the dev passes compiled it once and the release build compiled it a third time from cold. All three builds now name the release profile the NIF script already builds, so the C is compiled once and the release artefacts the script copies are already in place.
Nothing was added or loosened: no new step, no check removed,
timeout-minutes: 15unchanged, the same clippy flags and the same tests.cargo test --releaseruns exactly the suitecargo testran — neither crate hasdebug_assert!, anoverflow-checkssetting,#[should_panic]or a timing assertion (grep overnative/*/src), so release changes no test's meaning.The store NIF's three steps are untouched: its build script pins
RUSTFLAGS=-C target-cpu=x86-64, a different fingerprint from an unpinned test build, so the same trick there would need that pin moved into the crate first. It is not the issue's measured cost (msi00: 20s clippy + 10s test + 85s build).Cold timing of the changed steps
msi00,
ghcr.io/macula-io/macula-ci-otp:20261120-1240@sha256:39da31…, fresh tree, no target directory,nice -n 10, 8 cores, steps in the workflow's own order:The after run carried a much heavier machine load than the before run, which is the whole subject of the issue, so its clippy figure is pessimistic; what both runs show plainly is the two steps that used to recompile the dependency tree now reuse it —
cargo test115 s → 23 s and the NIF script 132 s → 1 s. On the forge's loaded runner, where the issue measured 6m43s clippy and 6m54s test, that is the second C compile and the whole second codegen pass removed.This PR's own lint run
The proof is the
lint-and-testrun on this tip: the same workflow, the same 15-minute ceiling. Forge baseline from the issue and the run list: green lint runs 7m35s–8m, run 63 14m26s, run 68 cancelled at 15m01s, and main's tipf8f0d355(run 81) was cancelled too.Refs macula-services/mcl-rag#9.