ci: let a Windows retry build a ref other than the release tag - #4376
Merged
Conversation
`publish-target.yml` reads its workflow YAML from the ref that triggered the run, but checks out `previous_tag` for the source. A CI fix written in the matrix therefore takes effect on a retry, while the identical fix written in Cargo.toml is silently reverted by the tag checkout. That asymmetry is why Windows could not publish 22.0.0 or 22.0.1. `qsv` built fine because its `viz_static` removal lived in `addl-build-args`; `qsvmcp` never once finished because its removal lived in the `qsvmcp` feature in Cargo.toml. `qsvmcp` gained `viz_static` in 2f83bcd (viz, #4019), between 21.1.0 and 22.0.0 -- and Windows shipped binaries for 21.1.0 and nothing for any release after it: release viz_static in qsvmcp Windows assets 21.1.0 no shipped 22.0.0 yes none 22.0.1 yes none Every earlier attempt to explain the qsvmcp build time measured master's Cargo.toml (crate counts, polars feature counts, LOC) and so described a build CI never performed. Add an optional `source_ref` to `publish-target.yml`, used by the build and package jobs alike so the shipped THIRD_PARTY_NOTICES.md and per-target README keep describing the binaries beside them. Empty means "build previous_tag", so publish.yml -- the real release path -- is unchanged. `publish-windows.yml` defaults it to the dispatched commit, pinned to the SHA so a mid-run push cannot change what is built. That is the opposite of publish.yml and deliberate: this workflow only runs after a Windows publish has already failed, which is exactly when the fix lives on master and not in the tag. Also guard the release tag before hours are spent building. This workflow is dispatched from an untagged master, so tag auto-detection is not exercised the way publish.yml exercises it, the repo carries non-version tags (`git tag --sort=-version:refname | head -1` returns `rkyv`), and the upload runs with overwrite: true. Assert MAJOR.MINOR.PATCH and that the release exists, with a `release_tag` input to override. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why Windows could not publish
publish-target.ymltakes its workflow YAML from the ref that triggered the run, butchecks out
previous_tagfor the source. A CI fix written in the matrix therefore takeseffect on a retry, while the identical fix written in
Cargo.tomlis silently reverted bythe tag checkout.
That asymmetry is why 22.0.1 shipped no Windows binaries:
viz_staticremoval livesqsvaddl-build-argsin the matrixqsvmcpqsvmcpfeature inCargo.tomlqsvmcpgainedviz_staticin 2f83bcd (viz, #4019). 21.1.0 — the last release whoseqsvmcphad noviz_static— shipped Windows binaries; 22.0.1 did not, across threecapped runs (31243109948, 31261021249, 31287336214), each ≥218m with
Build qsvmcpnevercompleting once.
A consequence worth flagging: every earlier attempt to explain the
qsvmcpbuild time(crate counts, polars feature counts, LOC) was measured against master's
Cargo.toml,and so described a build CI never performed.
Proof
Run 31303175743 — success.
[main][mcp][main][mcp][package]×2Build qsvmcpwent from ≥268m-and-never-finishing to under 47 minutes. Both zips arenow on the 22.0.1 release (msvc 142.0 MB, gnu 118.7 MB), each verified to contain
qsv.exe,qsvlite.exe,qsvmcp.exeand the license/notice files. The six pre-existingrelease assets kept their original timestamps.
What this changes
publish-target.yml: new optionalsource_ref. Empty (the default) buildsprevious_tag, sopublish.yml— the real release path — is unchanged. Used by thebuild and package jobs alike, so the shipped
THIRD_PARTY_NOTICES.mdand per-targetREADME keep describing the binaries beside them.
publish-windows.yml: defaultssource_refto the dispatched commit, pinned to theSHA so a mid-run push cannot change what is built. This is the opposite of
publish.ymland deliberate — this workflow only runs after a Windows publish has already failed,
which is exactly when the fix is on master and not in the tag.
auto-detection is not exercised the way
publish.ymlexercises it; the repo carries anon-version tag (
git tag --sort=-version:refname | head -1returnsrkyv); and theupload runs with
overwrite: true. The guard assertsMAJOR.MINOR.PATCHand that therelease exists, with a
release_taginput to override. It loggedoverride='' detected='22.0.1' -> resolved='22.0.1'.The next release will not need
source_ref— master'sCargo.tomlalready hasqsvmcpwithoutviz_static, so a new tag carries the fix. This is a retry escape hatch,not a new default.
Provenance
The shipped Windows 22.0.1 assets were built from
2a0feb607on this branch, notfrom the 22.0.1 tag. Recorded here so the source stays findable if the branch is deleted.
qsv --versionstill reports22.0.1: the string comes fromCARGO_PKG_VERSION(
util.rs:140/:284), andCargo.toml'sversionis unchanged on this branch.Self-update detection is intact —
util.rs:1623gates onQSV_KIND.starts_with("prebuilt"),satisfied by both
prebuiltand the PGO step'sprebuilt-pgo.Note on the commit message
The commit body carries a 3-row table including
22.0.0 / viz_static / no Windows assets.There is no release object for 22.0.0 (tag only), so that row is literally true but
misleading as evidence — it shipped nothing at all, for unrelated reasons. The claim rests
on the 21.1.0-vs-22.0.1 contrast and, more directly, on the ≥268m → 46m before/after above.
Follow-ups (not in this PR)
getandget_cloudfrom the qsvmcp build #4374 (breaking: dropget/get_cloudfromqsvmcp) was adopted for a build-timeproblem it did not cause; measured impact was 2 crates. Worth revisiting on its own merits.
lto: thin+codegen-units: 16should not be reverted casually: they arethe settings these successful builds ran under, and fat LTO +
codegen-units=1has nevercompleted for
qsvmcpon Windows.cargo-timings-*artifacts for all four legs are attached to the run (14-day retention) —the first real Windows build-time data.
Validated with
actionlint(0 findings) andscripts/check-publish-matrix-sync.py(OK).🤖 Generated with Claude Code