Skip to content

Setuptools symlinks#20092

Open
tomeuv wants to merge 1 commit into
pytorch:mainfrom
tomeuv:setuptools-symlinks
Open

Setuptools symlinks#20092
tomeuv wants to merge 1 commit into
pytorch:mainfrom
tomeuv:setuptools-symlinks

Conversation

@tomeuv
Copy link
Copy Markdown
Contributor

@tomeuv tomeuv commented Jun 8, 2026

Summary

build_py: filter directory symlinks from manifest_files in non-editable mode

Recent setuptools includes bare directory symlinks (e.g.
src/executorch/backends -> ../../backends) from version control in
manifest_files. These exist for editable mode but break regular
installs: build_package_data passes them to copy_file, which calls
os.path.isfile() and gets False for a symlink-to-directory.

Override analyze_manifest() to filter out non-regular-file entries
after the parent populates manifest_files, guarded by editable_mode.

Fixes #20091

Test plan

Run the command in the bug report with the problematic Python version as reported.

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani

Copilot AI review requested due to automatic review settings June 8, 2026 07:44
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Jun 8, 2026

🔗 Helpful Links

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

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

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

@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 Jun 8, 2026
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Jun 8, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

@github-actions github-actions Bot added ciflow/trunk module: arm Issues related to arm backend labels Jun 8, 2026
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Jun 8, 2026

The following ciflow label(s) have been added but CI has not been triggered yet because the workflows are awaiting approval:

  • ciflow/trunk

Once a maintainer approves the workflows (scroll to the bottom of the PR page), the corresponding CI jobs will be triggered automatically. Please ping one of the reviewers if you do not have access to approve and run workflows.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 8, 2026

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR updates release guidance, dependency installation behavior, and CI workflow references, while addressing packaging issues caused by directory symlinks in manifests.

Changes:

  • Update documentation and contributor guidance to reference release/1.3 / 1.3.1 instead of viable/strict.
  • Adjust packaging/installation tooling (manifest filtering, pip --no-cache-dir, model/artifact download robustness).
  • Migrate many GitHub Actions workflows from pytorch/test-infra@main to @release/2.12.

Reviewed changes

Copilot reviewed 45 out of 45 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
version.txt Updates the project version string.
setup.py Filters manifest entries for non-editable builds to avoid copying directory symlinks.
requirements-examples.txt Adds torchaudio/torchvision requirements for examples.
pyproject.toml Adjusts dependency specs and removes cortex_m optional extra from published metadata.
install_requirements.py Adds --no-cache-dir to pip installs for dev + optional example requirements.
extension/llm/tokenizers Updates submodule commit pointer.
extension/benchmark/apple/Benchmark/README.md Updates clone instructions to release/1.3.
extension/android/executorch_android/android_test_setup.sh Improves download robustness and makes golden artifacts URL discoverable/configurable.
examples/models/parakeet/tokenizer_utils.cpp Replaces UTF-8 literal with byte-escaped constant for C++20 compatibility.
examples/models/moshi/mimi/install_requirements.sh Updates torchcodec install source/version.
docs/source/using-executorch-ios.md Updates SwiftPM docs and clone instructions for 1.3.1/release/1.3.
docs/source/using-executorch-building-from-source.md Updates clone instructions to release/1.3.
docs/source/raspberry_pi_llama_tutorial.md Updates clone instructions to release/1.3 and fixes formatting.
docs/source/getting-started.md Updates iOS SwiftPM example and clone instructions to release/1.3.
docs/README.md Updates clone instructions to release/1.3.
backends/cortex_m/requirements-cortex-m.txt Clarifies why direct URL deps are kept out of pyproject metadata.
backends/cortex_m/passes/init.py Updates missing-deps installation guidance for Cortex-M backend.
backends/arm/scripts/install_models_for_test.sh Pins model-gym clone to a tag and shallow clones.
backends/arm/requirements-arm-models-test.txt Pins ng_model_gym dependencies since it’s installed with --no-deps.
CONTRIBUTING.md Updates guidance to rebase onto release/1.3 instead of viable/strict.
.github/workflows/windows-msvc.yml Pins reusable workflow ref to pytorch/test-infra@release/2.12.
.github/workflows/update-viablestrict.yml Pins update action to pytorch/test-infra@release/2.12.
.github/workflows/test-pico2-build.yml Pins reusable workflows to pytorch/test-infra@release/2.12.
.github/workflows/periodic.yml Pins reusable workflow to pytorch/test-infra@release/2.12.
.github/workflows/nightly.yml Pins actions/workflows to pytorch/test-infra@release/2.12.
.github/workflows/docker-builds.yml Pins actions to pytorch/test-infra@release/2.12.
.github/workflows/doc-build.yml Pins reusable workflows to pytorch/test-infra@release/2.12.
.github/workflows/cuda.yml Pins reusable workflows to pytorch/test-infra@release/2.12.
.github/workflows/cuda-windows.yml Pins reusable workflows to pytorch/test-infra@release/2.12.
.github/workflows/cuda-perf.yml Pins reusable workflows/actions to pytorch/test-infra@release/2.12.
.github/workflows/claude-code.yml Pins reusable workflow to pytorch/test-infra@release/2.12.
.github/workflows/build-wheels-windows.yml Pins reusable workflows to pytorch/test-infra@release/2.12.
.github/workflows/build-wheels-macos.yml Pins reusable workflows to pytorch/test-infra@release/2.12.
.github/workflows/build-wheels-linux.yml Pins reusable workflows to pytorch/test-infra@release/2.12.
.github/workflows/build-wheels-aarch64-linux.yml Pins reusable workflows to pytorch/test-infra@release/2.12.
.github/workflows/build-cadence-runner.yml Pins reusable workflow to pytorch/test-infra@release/2.12.
.github/workflows/apple.yml Increases iOS device farm timeout.
.github/workflows/android-release-artifacts.yml Pins reusable workflow to pytorch/test-infra@release/2.12.
.github/workflows/_test_riscv.yml Pins reusable workflow to pytorch/test-infra@release/2.12.
.github/workflows/_test_cadence.yml Pins reusable workflows to pytorch/test-infra@release/2.12.
.github/workflows/_link_check.yml Switches to full-depth checkout and removes manual base-ref fetch.
.github/workflows/_android.yml Pins setup action to pytorch/test-infra@release/2.12.
.ci/scripts/unittest-macos-cmake.sh Scopes TorchInductor cache to the job to avoid stale PCH issues.
.ci/scripts/test_wheel_package_qnn.sh Changes torch install index and disables pip cache.
.ci/scripts/test_model_e2e.sh Updates torchcodec install source/version.
Comments suppressed due to low confidence (5)

pyproject.toml:1

  • torch>=2.12.0a0 and torchao>=0.17.0 are likely non-existent/out-of-range versions for many environments (and a0 also implies a nightly/alpha). This can break dependency resolution for end users and published package metadata; consider setting a stable minimum supported PyTorch version (non-alpha) and/or moving “nightly-only” requirements behind an optional extra or a separate constraints/requirements file.
    requirements-examples.txt:1
  • The minimum versions torchaudio >= 2.11.0 and torchvision >= 0.27.0 appear to be far ahead of commonly available releases and may not exist for most platforms/Python versions, which would make the examples requirements unsatisfiable. Consider using known-released minimums aligned with the supported Torch version for this repo, or express compatibility via a torch-aligned range (e.g., matching major/minor pairs).
    examples/models/moshi/mimi/install_requirements.sh:1
  • --index-url overrides PyPI, which can break installs if torchcodec (or its dependencies) aren’t fully mirrored on the PyTorch index for the user’s platform/Python. Consider using --extra-index-url https://download.pytorch.org/whl/cpu so PyPI remains available, or constrain this to environments where you know the wheel is hosted on that index.
    docs/source/using-executorch-ios.md:1
  • The documented nightly branch format uses a dot separator (swiftpm-<version>.<year_month_date>), but the example uses a hyphen (swiftpm-1.4.0-20260601). Update either the format text or the example so they match, to prevent users from copying an invalid branch pattern.
    setup.py:1
  • This currently drops any manifest entry that isn’t an isfile() at analysis time, which is broader than “bare directory symlinks” and could mask unexpected packaging issues by silently removing entries. Consider narrowing the filter to the specific problematic case (symlink-to-directory), and optionally emitting a warning/log for removed entries so missing package data is easier to diagnose.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backends/cortex_m/passes/__init__.py Outdated
Comment on lines 12 to 15
f"(missing: {missing}). Install them with "
"`pip install --no-dependencies -r "
"backends/cortex_m/requirements-cortex-m.txt`, or run "
"`examples/arm/setup.sh --i-agree-to-the-contained-eula`."
Comment thread .ci/scripts/test_wheel_package_qnn.sh Outdated
# Install torch based on the pinned PyTorch version, preferring the PyTorch test index
"$PIPBIN" install torch=="${TORCH_VERSION}" --extra-index-url "https://download.pytorch.org/whl/test"
# Install torch based on the pinned PyTorch version.
"$PIPBIN" install --no-cache-dir torch=="${TORCH_VERSION}" --index-url "https://download.pytorch.org/whl/cpu"
Comment thread .github/workflows/_link_check.yml Outdated
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
…le mode

Recent setuptools includes bare directory symlinks (e.g.
src/executorch/backends -> ../../backends) from version control in
manifest_files. These exist for editable mode but break regular
installs: build_package_data passes them to copy_file, which calls
os.path.isfile() and gets False for a symlink-to-directory.

Override analyze_manifest() to filter out non-regular-file entries
after the parent populates manifest_files, guarded by editable_mode.
@tomeuv tomeuv force-pushed the setuptools-symlinks branch from 1edf104 to 6fbf6d4 Compare June 8, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: arm Issues related to arm backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build: error: can't copy 'src/executorch/backends': doesn't exist or not a regular file

2 participants