Skip to content

Ask for a wheel only on the leg that builds one - #115

Merged
wdolinar merged 1 commit into
masterfrom
fix/gate-wheel-dir-to-release
Aug 23, 2026
Merged

Ask for a wheel only on the leg that builds one#115
wdolinar merged 1 commit into
masterfrom
fix/gate-wheel-dir-to-release

Conversation

@wdolinar

Copy link
Copy Markdown
Member

What broke

xmsconan 2.22.0 made build.py exit 1 when --wheel-dir yields no complete
set of wheels (c614bc5, "Stop publishing a wheel chosen by package-id hash").
The GitHub CI template, however, still passes --wheel-dir wheelhouse on
every matrix leg — and [matrix].pybind_build_types defaults to
["Release"], so a Debug leg has no pybind package to extract.

Every GitHub consumer's Debug legs therefore turn red the moment they float up
to 2.22.x:

 >> All configurations built successfully.
 >> No pybind package found to extract.
error: --wheel-dir wheelhouse was given but no complete set of wheels was extracted

Already observed on master in the wild:

Repo When Pattern
xmsgrid 2026-08-21 5 Debug fail / 8 Release pass
xmsmesher 2026-08-22 4 Debug fail / 5 Release pass

xmsinterp and xmsextractor float too and last ran 2026-08-18, before 2.22.0 —
they break on their next run. xmscore never passes --wheel-dir to build.py;
xmsvtk is pinned ==2.16.0; xmsconstraint's GitLab job carries no build_type
filter, so its Release pybind configuration is always present. All three are
unaffected.

The fix

Gate the flag on matrix.build_type == 'Release' — how repair, artifact upload
and deploy in the same workflow are already gated, and what generate_ci
already assumes when it rejects a GitHub build.toml whose pybind_build_types
excludes Release (ci_file_generator.py:210-225).

The guard in build.py is deliberately left alone. --wheel-dir meaning "I
require wheels" is the intended contract; the defect was asking for them on a
leg that cannot produce any. A library that names Debug in
pybind_build_types loses nothing — its Debug wheel was built and discarded
before, since every downstream step was Release-gated already.

The Windows --skip-dependency-libs companion moves inside the gate with it:
build.py reads it only within the if args.wheel_dir branch, so leaving it
outside would put a flag on the Debug command line that reads as staging
control and does nothing.

GitLab is unaffected and unchanged.

Verification

  • flake8 . → exit 0 (with flake8-docstrings, -bugbear, -import-order,
    pep8-naming, -tidy-imports, matching CI)
  • pytest tests/ -q → 1978 passed, 5 skipped
  • Two new tests, both mutation-proven: un-gating --wheel-dir fails
    test_github_build_step_requests_a_wheel_only_on_release[mac], and moving
    --skip-dependency-libs outside the gate fails its own test. The first is
    asserted per job so a regression names the platform.
  • Regenerated xmsgrid's and xmsmesher's workflows end-to-end; YAML parses and
    all four build steps carry the gate.

Docs

docs/USAGE.md §10 step 3 and a new §10.1 bullet; rationale added to the
template's header comment.

Ordering — please read before releasing

xmsmesher/master/build.toml still carries has_test_files, which the
KNOWN_KEYS whitelist merged in #112 now rejects. Verified against this
branch:

Error: build.toml has unknown top-level key(s) has_test_files.

Aquaveo/xmsmesher#88 must merge before the release that carries this, or
xmsmesher's CI dies one step earlier, at Generate.

Consumers also need xmsconan ci re-run and the result committed — the
workflow is generated, not floated.

The GitHub workflow passed `--wheel-dir wheelhouse` to build.py on every
matrix leg. `[matrix].pybind_build_types` defaults to `["Release"]`, so a
Debug leg builds no pybind package -- and since 2.22.0 build.py treats
`--wheel-dir` as a request it must satisfy, exiting 1 when no complete set
of wheels comes out. That turned every Debug leg of every GitHub consumer
red the moment it picked up 2.22.0, which is what happened to xmsgrid on
2026-08-21 and to xmsmesher on 2026-08-22:

     >> All configurations built successfully.
     >> No pybind package found to extract.
    error: --wheel-dir wheelhouse was given but no complete set of wheels
    was extracted; see the message above.

Gate the flag on `matrix.build_type == 'Release'`, which is how repair,
artifact upload and deploy in the same workflow are already gated -- and
which `generate_ci` already relies on when it rejects a GitHub build.toml
whose `pybind_build_types` excludes Release. A library that also names
Debug loses nothing: its Debug wheel was built and discarded before.

The Windows `--skip-dependency-libs` companion moves inside the gate with
it. build.py reads that flag only within its `if args.wheel_dir` branch, so
leaving it outside would put a flag on the Debug command line that reads as
staging control and does nothing.

The guard itself is left alone. `--wheel-dir` meaning "I require wheels" is
the deliberate behavior; the defect was asking for them where none exist.

GitLab is unaffected -- its build job carries no `build_type` filter, so the
full matrix runs and the Release pybind configuration is always present.

Consumers need `xmsconan ci` re-run and the result committed to pick this
up; the workflow is generated, not floated.
@wdolinar
wdolinar merged commit c0072ee into master Aug 23, 2026
6 checks passed
wdolinar added a commit that referenced this pull request Aug 23, 2026
master carries the same fix from #115 (c0072ee), which was opened and merged
while this PR sat approved. This branch is the implementation that was reviewed,
so it supersedes that one: the flag lives in one named constant
(RELEASE_ONLY_WHEEL_DIR) that the four build steps share, the --wheel-dir option
row in USAGE section 9.1 is updated, the tests cover linux-arm and assert that
every wheel-consuming step stays Release-gated, and the generate_ci comment at
the pybind_build_types guard is amended to match.

Merged with -s ours so the tree is exactly what merging this PR before #115
would have produced. Nothing from c0072ee is kept -- everything it changed, this
branch changes too.
@wdolinar
wdolinar deleted the fix/gate-wheel-dir-to-release branch August 23, 2026 06:13
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