Skip to content

Conversation

@zklaus
Copy link
Collaborator

@zklaus zklaus commented Jul 8, 2025

Before this change, there was the requirements file .ci/docker/requirements-docs.txt which was symlinked as ../.ci/docker/requirements-docs.txt from docs/requirements.txt since #151796.
In this situation, because .ci is excluded from the source tarball, we end up with a broken symlink, that additionally is invalid in a Python source distribution.

The broken symlink can be confirmed in the rc sources.

After this change, there is still a single source of truth, which now is docs/requirements.txt, symlinked as ../docs/requirements.txt from .ci/docker/requirements-docs.txt, which would also be invalid in a Python source distribution, but is not included in the tarball (see above). Additionally, the docs requirements that were missing from the previous tarball, are now actually included, allowing users to build the documentation again.

@malfet clarified offline that there is a problem with the docs workflows because they use a cache with a key that includes the hash of the requirements document in the .ci folder, which now does no longer change when the requirements change. Hence, a different solution is needed~, though for now the problem remains~.

The solution in this PR is simply to copy the actual document to replace the symlink just prior to creating the source distribution. This way, a single document needs to be maintained, git checkouts remain as they are, and the source distributions contain the before-missing document.

A better solution may be implemented at a later stage with a better build system.

Stack from ghstack (oldest at bottom):

[ghstack-poisoned]
@zklaus zklaus requested a review from jeffdaily as a code owner July 8, 2025 16:22
@pytorch-bot
Copy link

pytorch-bot bot commented Jul 8, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit cdbc3a0 with merge base 334b38c (image):
💚 Looks good so far! There are no failures yet. 💚

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

zklaus added 5 commits July 29, 2025 14:15
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@zklaus zklaus marked this pull request as ready for review August 11, 2025 10:11
@zklaus zklaus requested a review from a team as a code owner August 11, 2025 10:11
@zklaus zklaus changed the title Fix broken docs requirements symlink For sdists, replace symlink with copy for docs requirements Aug 11, 2025
@zklaus zklaus requested review from atalman and malfet August 12, 2025 10:17
@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #157813

Copy link
Contributor

@atalman atalman left a comment

Choose a reason for hiding this comment

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

looks good. Thank you.

@zklaus
Copy link
Collaborator Author

zklaus commented Aug 18, 2025

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Aug 18, 2025
@pytorchmergebot
Copy link
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

can-gaa-hou pushed a commit to can-gaa-hou/pytorch that referenced this pull request Aug 22, 2025
…157811)

Before this change, there was the requirements file `.ci/docker/requirements-docs.txt` which was symlinked as `../.ci/docker/requirements-docs.txt` from `docs/requirements.txt` since pytorch#151796.
In this situation, [because `.ci` is excluded from the source tarball](https://github.com/pytorch/pytorch/blob/3173616532ecf0d5c0b78595d6054f1b4bd2bd75/.github/workflows/create_release.yml#L67), we end up with a broken symlink, that additionally is [invalid in a Python source distribution](https://packaging.python.org/en/latest/specifications/source-distribution-format/#unpacking-without-the-data-filter).

The broken symlink can be confirmed in [the rc sources](https://github.com/pytorch/pytorch/actions/runs/15892205745).

~After this change, there is still a single source of truth, which now is `docs/requirements.txt`, symlinked as `../docs/requirements.txt` from `.ci/docker/requirements-docs.txt`, which would also be invalid in a Python source distribution, but is not included in the tarball (see above). Additionally, the docs requirements that were missing from the previous tarball, are now actually included, allowing users to build the documentation again.~

@malfet clarified offline that there is a problem with the docs workflows because they use a cache with a key that includes the hash of the requirements document in the `.ci` folder, which now does no longer change when the requirements change. Hence, a different solution is needed~, though for now the problem remains~.

The solution in this PR is simply to copy the actual document to replace the symlink just prior to creating the source distribution. This way, a single document needs to be maintained, git checkouts remain as they are, and the source distributions contain the before-missing document.

A better solution may be implemented at a later stage with a better build system.

Pull Request resolved: pytorch#157811
Approved by: https://github.com/atalman
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
…157811)

Before this change, there was the requirements file `.ci/docker/requirements-docs.txt` which was symlinked as `../.ci/docker/requirements-docs.txt` from `docs/requirements.txt` since pytorch#151796.
In this situation, [because `.ci` is excluded from the source tarball](https://github.com/pytorch/pytorch/blob/3173616532ecf0d5c0b78595d6054f1b4bd2bd75/.github/workflows/create_release.yml#L67), we end up with a broken symlink, that additionally is [invalid in a Python source distribution](https://packaging.python.org/en/latest/specifications/source-distribution-format/#unpacking-without-the-data-filter).

The broken symlink can be confirmed in [the rc sources](https://github.com/pytorch/pytorch/actions/runs/15892205745).

~After this change, there is still a single source of truth, which now is `docs/requirements.txt`, symlinked as `../docs/requirements.txt` from `.ci/docker/requirements-docs.txt`, which would also be invalid in a Python source distribution, but is not included in the tarball (see above). Additionally, the docs requirements that were missing from the previous tarball, are now actually included, allowing users to build the documentation again.~

@malfet clarified offline that there is a problem with the docs workflows because they use a cache with a key that includes the hash of the requirements document in the `.ci` folder, which now does no longer change when the requirements change. Hence, a different solution is needed~, though for now the problem remains~.

The solution in this PR is simply to copy the actual document to replace the symlink just prior to creating the source distribution. This way, a single document needs to be maintained, git checkouts remain as they are, and the source distributions contain the before-missing document.

A better solution may be implemented at a later stage with a better build system.

Pull Request resolved: pytorch#157811
Approved by: https://github.com/atalman
@github-actions github-actions bot deleted the gh/zklaus/14/head branch September 18, 2025 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged open source topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants