Skip to content

Bump scikit-build-core to 1.1.1 and make use of its features - #200913

Closed
zklaus wants to merge 1 commit into
pytorch:mainfrom
zklaus:bump-scikit-build-core-1.1
Closed

zklaus wants to merge 1 commit into
pytorch:mainfrom
zklaus:bump-scikit-build-core-1.1

Conversation

@zklaus

@zklaus zklaus commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Go through the following checklist

  • Passes lint (spin fixlint)
  • Added/updated tests
  • Updated documentation (if applicable)
  • Included benchmark results (for PRs impacting perf)

Linked issue or supporting maintainer

Fixes #194945. Fixes #196619.

BC-breaking?

No. Wheels and sdists are produced with the same contents and metadata as before (the sdist loses eight symlinks that nothing consumes; docs/requirements.txt has the same content). For developers, an editable install now keeps its compiled artifacts in build/install// instead of site-packages, so deleting build/ removes them, and code that located the install tree through the distribution's site-packages path has to use the import-system anchor from #195587 instead (in-tree code already does). Building from source needs scikit-build-core 1.1.1, available on PyPI and conda-forge.

Summary (human written only)

This PR raises the floor for scikit-build-core from 1.0 to 1.1.1, which is a release that includes a number of improvements that target issues specifically surfaced from Pytorch.

Agent details (if applicable)

The build-system floor moves from 1.0 to 1.1.1, together with the CI pins (.ci/docker/requirements-ci.txt, the Windows installer scripts, the riscv cross image), so this rebuilds the Docker images. Two features of the new release are switched on at the same time; the Import-Name metadata (PEP 794) that 1.1 can also emit is left for a follow-up, since it raises the wheels' Metadata-Version to 2.5 and deserves its own compatibility check.

Editable installs now use editable.rebuild-dir = "build/install/{wheel_tag}" with rebuild = false. The compiled artifacts are installed into a persistent tree under build/ and the editable wheel shrinks to the redirect. Before, every pip install -e . zipped the whole install tree into a wheel that pip unpacked and discarded, several GB and about five minutes on a debug build (#196619). The tree is keyed by wheel tag so editable installs for several interpreters can share one checkout, and spin clean removes it with the rest of build/. Rebuild-on-import stays off; torch.loader.rebuild() refreshes the tree on demand. CONTRIBUTING.md describes the new location.
The tree is keyed by wheel tag only: scikit-build-core formats rebuild-dir with the same keys as build-dir and has no {build_dir} key, so a second build tree selected through SKBUILD_BUILD_DIR (another CUDA toolkit, a Debug build) shares build/install/<wheel tag>/ with the first and the last editable install wins. Setting SKBUILD_EDITABLE_REBUILD_DIR to a directory under that build tree keeps them apart; CONTRIBUTING.md says so. The proper fix is a {build_dir} template key upstream, which we will ask for separately.

The sdist build sets sdist.resolve-symlinks = "error", so a symlink among the included files fails the build by name instead of being silently copied. Every tracked symlink is handled explicitly: seven are excluded (.dockerignore, the three AGENTS.md links, XNNPACK's xngen alias, the cudnn_frontend .claude directory link that the old default duplicated, and a flatbuffers test fixture), and docs/requirements.txt is force-included from its target in .ci. The release workflow used to make that replacement in the working tree before both of its archives were built; it now does so only on the staged copy that becomes the plain tarball, so the PEP 517 sdist is built from the pristine checkout and the local python -m build --sdist and the release sdist are produced the same way. The sdist member list changes by exactly those eight entries.

1.1.0 and 1.1.1 also carry the nested-.gitignore walk fix (#194945, scikit-build/scikit-build-core#1542), repository-boundary handling for ignore rules (scikit-build-core#1585, #1594) and the deterministic, install-first path with a public loader.paths for redirect-mode packages (#1566, #1567), which the resolution helpers from #195587 use.

Not in this change: the blanket third_party/** include block in sdist.include stays. Without it, 1.1.1 drops 389 more tracked files, among them cpuinfo's deps/clog sources and PeachPy's instruction tables that NNPACK's code generation imports, so retiring it needs targeted includes and a build-from-sdist test of its own.

Requires #195587: before it, get_file_path found the editable install tree through the distribution's location under site-packages; with rebuild-dir that tree moves to build/install//, where only the import-system anchor finds it.

Test Plan

On top of main at the #195587 merge (7402bdb) with scikit-build-core 1.1.1, CPU-only Release build on Linux, Python 3.10:

python -m build --sdist --no-isolation
python -m pip wheel . -v --no-build-isolation --no-deps -w /tmp/wheel
python -m pip install -e . -v --no-build-isolation
python -m pytest test/test_utils.py -k "PathResolution or cmake_prefix_path or get_file_path"
spin lint

The sdist builds with the symlink check on; of the six tracked symlinks only docs/requirements.txt appears among its members, as a regular file copied from its .ci target. The editable install takes 22 s from an existing build directory, puts the artifacts under
build/install/cp310-cp310-linux_x86_64/ with nothing but the redirect in site-packages; import torch from outside the checkout loads _C from that tree, torch.loader.paths lists it first, and torch.utils.cmake_prefix_path resolves into it with TorchConfig.cmake present. The six path-resolution tests pass against that editable install.

Authored with an AI assistant; the diff was reviewed by hand.

🤖 Generated with Claude Code

@pytorch-bot

pytorch-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/200913

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 Cancelled Job

As of commit 293990a with merge base eb429a0 (image):

CANCELLED JOB - The following job was cancelled. Please retry:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@Skylion007

Copy link
Copy Markdown
Collaborator

@henryiii Mind taking a look to see if there any Scikit-Core-build features we aren't using?

@Skylion007 Skylion007 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't want to do any of the config system changes? Or we saying that for a different PR in the stack?

Comment thread .github/workflows/create_release.yml Resolved
Comment thread pyproject.toml Resolved
@zklaus

zklaus commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

You don't want to do any of the config system changes? Or we saying that for a different PR in the stack?

Different PR: this one is deliberately just the floor and the two features we were waiting on (1.1.1 fixes two bumps we hit, #194945 and #196619). The config-settings stay in #200651; and I propose that once this lands, #200651 rebases on it and shrinks to the declarations and docs.

…rsistent tree

The build-system floor moves from 1.0 to 1.1.1, together with the CI pins
(.ci/docker/requirements-ci.txt, the Windows installer scripts, the riscv
cross image), so this rebuilds the Docker images. Two features of the new
release are switched on at the same time; the Import-Name metadata (PEP 794)
that 1.1 can also emit is left for a follow-up, since it raises the wheels'
Metadata-Version to 2.5 and deserves its own compatibility check.

Editable installs now use editable.rebuild-dir = "build/install/{wheel_tag}"
with rebuild = false. The compiled artifacts are installed into a persistent
tree under build/ and the editable wheel shrinks to the redirect. Before,
every `pip install -e .` zipped the whole install tree into a wheel that pip
unpacked and discarded, several GB and about five minutes on a debug build
(pytorch#196619). The tree is keyed by wheel tag so editable installs for several
interpreters can share one checkout, and `spin clean` removes it with the
rest of build/. Rebuild-on-import stays off; torch.__loader__.rebuild()
refreshes the tree on demand. CONTRIBUTING.md describes the new location.

The tree is keyed by wheel tag only: scikit-build-core formats rebuild-dir
with the same keys as build-dir and has no `{build_dir}` key, so a second
build tree selected through `SKBUILD_BUILD_DIR` (another CUDA toolkit, a Debug
build) shares `build/install/<wheel tag>/` with the first and the last
editable install wins. Setting `SKBUILD_EDITABLE_REBUILD_DIR` to a directory
under that build tree keeps them apart; CONTRIBUTING.md says so. The proper
fix is a `{build_dir}` template key upstream, which we will ask for
separately.

The sdist build sets sdist.resolve-symlinks = "error", so a symlink among the
included files fails the build by name instead of being silently copied.
Every tracked symlink is handled explicitly: seven are excluded
(.dockerignore, the three AGENTS.md links, XNNPACK's xngen alias, the
cudnn_frontend .claude directory link that the old default duplicated, and a
flatbuffers test fixture), and docs/requirements.txt is force-included from
its target in .ci. The release workflow used to make that replacement in the
working tree before both of its archives were built; it now does so only on
the staged copy that becomes the plain tarball, so the PEP 517 sdist is built
from the pristine checkout and the local `python -m build --sdist` and the
release sdist are produced the same way. The sdist member list changes by
exactly those eight entries.

1.1.0 and 1.1.1 also carry the nested-.gitignore walk fix (pytorch#194945,
scikit-build/scikit-build-core#1542), repository-boundary handling for ignore
rules (scikit-build-core#1585, pytorch#1594) and the deterministic, install-first
__path__ with a public __loader__.paths for redirect-mode packages (pytorch#1566,

Not in this change: the blanket third_party/** include block in sdist.include
stays. Without it, 1.1.1 drops 389 more tracked files, among them cpuinfo's
deps/clog sources and PeachPy's instruction tables that NNPACK's code
generation imports, so retiring it needs targeted includes and a
build-from-sdist test of its own.

Requires pytorch#195587: before it, get_file_path found the editable install tree
through the distribution's location under site-packages; with rebuild-dir
that tree moves to build/install/<wheel tag>/, where only the import-system
anchor finds it.

Fixes pytorch#194945. Fixes pytorch#196619.

Test Plan

On top of main at the pytorch#195587 merge (7402bdb) with scikit-build-core
1.1.1, CPU-only Release build on Linux, Python 3.10:

```
python -m build --sdist --no-isolation
python -m pip wheel . -v --no-build-isolation --no-deps -w /tmp/wheel
python -m pip install -e . -v --no-build-isolation
python -m pytest test/test_utils.py -k "PathResolution or cmake_prefix_path or get_file_path"
spin lint
```

The sdist builds with the symlink check on; of the six tracked symlinks only
docs/requirements.txt appears among its members, as a regular file copied
from its .ci target. The editable install takes 22 s from an existing
build directory, puts the artifacts under
build/install/cp310-cp310-linux_x86_64/ with nothing but the redirect in
site-packages; `import torch` from outside the checkout loads _C from that
tree, torch.__loader__.paths lists it first, and torch.utils.cmake_prefix_path
resolves into it with TorchConfig.cmake present. The six path-resolution
tests pass against that editable install.

Authored with an AI assistant; the diff was reviewed by hand.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@zklaus
zklaus force-pushed the bump-scikit-build-core-1.1 branch from ab4a348 to 293990a Compare October 16, 2026 11:56
@zklaus
zklaus marked this pull request as ready for review October 16, 2026 13:55
@zklaus
zklaus requested a review from a team as a code owner October 16, 2026 13:55
@zklaus
zklaus requested a review from atalman October 16, 2026 13:55

@benjaminglass1 benjaminglass1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Can we merge soon? My debug builds locally take so long to install right now, and this fixes that.

@zklaus

zklaus commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator Author

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 21, 2026
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@zklaus

zklaus commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator Author

@pytorchbot merge -f "The only pending check, trunk macos-py3-arm64 test (mps), is queued on the runner label macos-m2-15 that #201231 retired on 10-19; this PR predates that change, so the job can never start. All 359 other checks on this head passed, and a scikit-build-core floor bump does not touch MPS."

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command
For more information see pytorch-bot wiki.

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

This branch was previously deployed

1 inactive deployment
bedrock — 293990a9 Deployed Oct 16, 2026 by zklaus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

6 participants