Skip to content

feat: bundle the CMake source tarball in the sdist - #729

Draft
henryiii wants to merge 1 commit into
mainfrom
henryiii/feat/bundle-sdist-archive
Draft

feat: bundle the CMake source tarball in the sdist#729
henryiii wants to merge 1 commit into
mainfrom
henryiii/feat/bundle-sdist-archive

Conversation

@henryiii

@henryiii henryiii commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

Installing from the sdist required network access to download the CMake archive. Now build_sdist downloads the unix source tarball and bundles it as archive-cache/cmake-<version>.tar.gz (sdist grows to ~13 MB). A from-source wheel build from the sdist works offline; building the sdist itself needs network.

Changes:

  • backend.py: build_sdist wrapper fetches the tarball and injects it via the sdist.include config-setting (exact filename, so stale archives in a dev tree are not picked up). Download + SHA256 check is shared with _bootstrap_build.
  • CMakeLists.txt: CMakePythonDistributions_ARCHIVE_DOWNLOAD_DIR defaults to archive-cache/ in the source tree. ExternalProject skips the download when the hash matches, so git builds also get a cache shared across wheel tags.
  • CI: build_sdist asserts the tarball is bundled; test_sdist installs from source behind a dead proxy (no_proxy keeps PyPI reachable), so it is a real offline test. It now compiles CMake, so it is slower.

Not covered: BUILD_CMAKE_FROM_SOURCE=OFF (macOS/Windows default) still downloads the prebuilt binary, and Windows source builds still download the .zip.

Verified locally on macOS: wheel built from the unpacked sdist with https_proxy=http://127.0.0.1:9; the same command with the archive removed fails at the download.

The sdist now includes archive-cache/cmake-<version>.tar.gz, so a
from-source wheel build from the sdist needs no network. Building the
sdist itself downloads the tarball. Archives now default to
archive-cache/ in the source tree for both the CMake superbuild and the
Python bootstrap, so both find the bundled file.

Assisted-by: ClaudeCode:claude-fable-5
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