Skip to content

ci: build py3-none (build.sh) recipes on a single Python leg#86

Merged
ndonkoHenri merged 2 commits into
mainfrom
canonical
Jun 28, 2026
Merged

ci: build py3-none (build.sh) recipes on a single Python leg#86
ndonkoHenri merged 2 commits into
mainfrom
canonical

Conversation

@ndonkoHenri

Copy link
Copy Markdown

Problem

flet-lib* recipes (libpq, libzbar, libmupdf, …) are native C libraries: a recipe with a build.sh routes to forge's SimplePackageBuilder, whose wheel tag is hardcoded py3-none-<platform> — versus the cp3XX-cp3XX tag real C-extension recipes get from PythonPackageBuilder.

A py3-none wheel is byte-identical regardless of which Python built it. But the matrix fans every recipe across 3.12,3.13,3.14, so each of these libs is built three times, producing three identical wheel filenames. Publishing is per-leg, so only the first upload lands and the other two are dismissed as duplicates — two wasted build legs per py3-none recipe, every run.

Change

Build py3-none recipes on a single canonical leg (the first Python in the list, computed in detect and passed to the reusable workflow). Real cp3XX extensions are unaffected and still build on every leg.

  • build-wheels.yml: detect computes canonical_python (first listed, normalized X.Y) and passes it to the build job.
  • build-wheels-version.yml: new optional canonical_python input (default "" = no gating); set-matrix drops build.sh recipes on non-canonical legs (one ::notice:: per skip); a has_jobs output + if: guard skip a leg whose matrix ends up empty (e.g. a change touching only flet-lib* recipes).

The gate keys off build.sh presence — the exact signal forge itself uses to pick the builder (src/forge/package.py:116), so CI can't disagree with the wheel tag.

Effect

A PR touching one flet-lib* recipe drops from 6 build jobs → 2 (frees a scarce macOS/iOS runner); a full ALL run sheds ~80–90 jobs. Applies to every trigger (push, PR, dispatch). cp3XX extensions keep building on all three Pythons.

Backward compatibility

canonical_python is optional with an empty default, so standalone build-wheels-version.yml dispatches and any cross-repo callers are unchanged (empty = no gating).

Verification

Workflow dispatch (flet-libpq:,lru-dict:): flet-libpq built only on 3.12; lru-dict on all three. Annotations confirmed: Skip py3.13: flet-libpq — py3-none recipe, built only on py3.12.

Tradeoff

The redundant builds were incidental fault-tolerance — a flaky leg was masked by another publishing the identical wheel. Now each py3-none wheel publishes from one leg, so a canonical-leg failure blocks that recipe's publish until a re-run. Low risk: wheels are byte-identical, failures are visible (run goes red), and a re-run republishes the same artifact.

@ndonkoHenri ndonkoHenri merged commit 7c448f4 into main Jun 28, 2026
9 of 28 checks passed
@ndonkoHenri ndonkoHenri deleted the canonical branch June 28, 2026 17:21
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