Skip to content

Revert "Build PyTorch wheel via PEP 517 instead of setup.py" (#21562) - #21684

Open
shoumikhin wants to merge 1 commit into
mainfrom
revert-21562-riscv-break
Open

Revert "Build PyTorch wheel via PEP 517 instead of setup.py" (#21562)#21684
shoumikhin wants to merge 1 commit into
mainfrom
revert-21562-riscv-break

Conversation

@shoumikhin

Copy link
Copy Markdown
Contributor

Reverts the install_pytorch.sh change from #21562.

Why

#21562 broke test-riscv on main. 17 of 17 jobs, on every commit that has landed since it went in. Failing step is pip install --no-build-isolation extension/llm/tokenizers:

[299/312] Generating CXX dyndep file CMakeFiles/pytorch_tokenizers_cpp.dir/CXX.dd
FAILED: CMakeFiles/pytorch_tokenizers_cpp.dir/src/python_bindings.cpp.o
cc1plus: error: to generate dependencies you must specify either '-M' or '-MM'

Cause

The PEP 517 change itself is correct and should come back. The problem is how the build requirements are installed.

To run python -m build --wheel --no-isolation, #21562 installs build, scikit-build-core, setuptools, cmake and ninja permanently into the image's conda environment. scikit-build-core ships a setuptools plugin that registers itself as the build_ext command class. Every later pip install --no-build-isolation in that image then runs its CMake configure instead of the plain setuptools one, which switches on C++20 module dependency scanning. The image's GCC 14.2.0 cannot produce the scan output CMake asks for, so the tokenizers build dies.

Two greps confirm it. dyndep has zero hits in the last green job log and one in the red one. scikit_build_core is absent from the green log and present in the red traceback.

Why CI did not catch it

test-riscv lives in its own workflow, Test RISC-V Backend. It does not run on pull requests unless the change touches specific RISC-V paths, it is not a required merge context, and it does not gate viable/strict. So nothing in the pre-merge gate could have seen this.

Next

Re-landing separately with the build requirements confined to a throwaway virtualenv, so they stop leaking into every later build in the image. That PR will carry a ciflow/trunk tag so test-riscv actually runs on it before it merges.

This reverts the install_pytorch.sh change from #21562. It broke test-riscv on main, 17 of 17 jobs, on every commit since it landed.

The PEP 517 change itself is correct. The problem is that the PR installs the PEP 517 build requirements permanently into the image conda environment. scikit-build-core registers a setuptools build_ext plugin, so every later "pip install --no-build-isolation" in that image runs its cmake configure instead of the plain setuptools one. That turns on C++20 module dependency scanning, which the image GCC 14.2.0 cannot satisfy, and the tokenizers build fails with "cc1plus: error: to generate dependencies you must specify either -M or -MM".

Reverting to unblock main. Re-landing separately with the build requirements confined to a throwaway virtualenv.
Copilot AI lite review requested due to automatic review settings August 8, 2026 00:05
@pytorch-bot

pytorch-bot Bot commented Aug 8, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 1 New Failure

As of commit a02e38d with merge base a439afd (image):

NEW FAILURE - The following job has failed:

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

@pytorch-bot pytorch-bot Bot added the ci-no-td label Aug 8, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-td CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants