Skip to content

LWLP-5506: pin Fromager sdist destination filename to avoid zip-sdist cache miss - #148

Merged
Jonathan Gangi (JAVGan) merged 1 commit into
mainfrom
fix/LWLP-5506-sdist-destination-filename
Nov 18, 2026
Merged

Jonathan Gangi (JAVGan) merged 1 commit into
mainfrom
fix/LWLP-5506-sdist-destination-filename

Conversation

@JAVGan

Copy link
Copy Markdown
Member

Summary

  • Cumulative Konflux builds for h11 0.6.0/0.7.0 were failing the python-fromager-build-wheels provenance gate (Primary wheel filename version mismatch) because Fromager rebuilt from the pristine upstream sdist instead of our version-rewritten one.
  • Root cause: Fromager's default_download_source() derives the sdist cache filename from the resolved PyPI index URL's extension, not from what source-to-sdist already wrote. create_sdist() always writes .tar.gz cache aliases, so for packages whose canonical PyPI sdist is .zip (h11 <= 0.7.0), Fromager's cache check misses and it downloads the pristine, unrewritten-version upstream zip instead.
  • Fix: BuildConfig.render_settings() now pins download_source.destination_filename in the rendered per-package Fromager settings YAML to ${canonicalized_name}-${version}.tar.gz — the exact name create_sdist() already writes — so Fromager finds our pre-placed, version-rewritten sdist regardless of the upstream index's advertised extension. Uses setdefault so a build config that already overrides download_source for some other reason (e.g. an alternate-source package) is left untouched.

See LWLP-5506 for the full root-cause writeup and the fix-direction tradeoffs considered.

Test plan

  • uv run pytest — 301 passed, including 3 new tests covering the default pin, respecting an existing download_source override, and rejecting a non-mapping download_source.
  • uv run ruff check . / uv run ruff format --check . / uv run mypy src — clean.
  • Locally tested end-to-end against real PyPI data and the real fromager binary (not mocked), for both affected versions:
    • Confirmed PyPI's real sdist for h11 0.6.0 and 0.7.0 is genuinely .zip (0.8.1 is genuinely .tar.gz).
    • Pre-fix: ran lightwell-source-to-sdist + lightwell-build-wheels for h11 0.6.0 and reproduced the exact reported failure — Fromager re-downloaded a fresh h11-0.6.0.zip and failed with Primary wheel filename version mismatch: h11-0.6.0-1-py2.py3-none-any.whl.
    • Post-fix: same run now finds the pre-placed .tar.gz locally (no download) and builds h11-0.6.0+rhlw.0-1-py2.py3-none-any.whl, passing the version gate. Same result confirmed for h11 0.7.0 (h11-0.7.0+rhlw.0-1-py2.py3-none-any.whl).
  • Not tested: a real in-cluster Konflux SCRATCH PipelineRun — h11 0.6.0/0.7.0 are already-onboarded versions in calunga-python, so re-triggering them for real requires a throwaway re-detection workaround there; the local reproduction above exercises the identical code path and failure/success signal.

… miss

Fromager's default_download_source() derives the sdist cache filename
from the resolved index URL's extension, not from what source-to-sdist
already wrote. For packages whose canonical PyPI sdist is .zip (h11 <=
0.7.0), this misses our .tar.gz-only cache and downloads the pristine,
unrewritten-version upstream sdist, failing the wheel-version gate.

Pin download_source.destination_filename in the rendered Fromager
settings to the exact name create_sdist() already writes, so Fromager
finds our pre-placed, version-rewritten sdist regardless of the
upstream index's advertised extension.

LWLP-5506
@JAVGan
Jonathan Gangi (JAVGan) merged commit df1c6f8 into main Nov 18, 2026
12 of 14 checks passed
@JAVGan
Jonathan Gangi (JAVGan) deleted the fix/LWLP-5506-sdist-destination-filename branch November 18, 2026 13:28
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.

3 participants