Skip to content

Error out if git symlink not enabled on Windows - #15684

Merged
larryliu0820 merged 2 commits into
mainfrom
fix_setup_win
Nov 10, 2025
Merged

Error out if git symlink not enabled on Windows#15684
larryliu0820 merged 2 commits into
mainfrom
fix_setup_win

Conversation

@larryliu0820

@larryliu0820 larryliu0820 commented Nov 7, 2025

Copy link
Copy Markdown
Contributor

When I install executorch on windows I run into this error: error:
[Errno 2] No such file or directory:
'pip-out\lib.win-amd64-cpython-312\executorch\version.py'

This is because we are not enabling symlink in git.

Need to run:

 git config --global core.symlinks true

and reclone the repo.

This PR fails the installation when that happens.

When I install executorch on windows I run into this error:   error:
[Errno 2] No such file or directory:
'pip-out\\lib.win-amd64-cpython-312\\executorch\\version.py'

It turns out sometimes the dst directory (in this case
pip-out\lib.win-amd64-cpython-312\executorch) is not installed before we
write version.py into it. This PR adds a mkpath call to make sure it's
always there.
@pytorch-bot

pytorch-bot Bot commented Nov 7, 2025

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 3 New Failures, 3 Unrelated Failures

As of commit 2ebc280 with merge base 9a7882e (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

BROKEN TRUNK - The following jobs failed but was present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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 Nov 7, 2025
@github-actions

github-actions Bot commented Nov 7, 2025

Copy link
Copy Markdown

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.

@mergennachin

Copy link
Copy Markdown
Contributor

@GregoryComer @larryliu0820 cherry-pickable to 1.0.1?

@larryliu0820

Copy link
Copy Markdown
Contributor Author

Oops this patch doesn't fix the underlying problem. If we don't turn on symlink on windows: git config --global core.symlinks true, then the wheel doesn't have all the python files such as exir/backend/:

PS C:\executorch> tar -tf ".\dist\executorch-1.1.0a0+a6b20e6-cp312-cp312-win_amd64.whl" | Select-String exir

executorch/exir/_serialize/program.fbs
executorch/exir/_serialize/scalar_type.fbs

Probably will abandon this.

@GregoryComer

Copy link
Copy Markdown
Contributor

@GregoryComer @larryliu0820 cherry-pickable to 1.0.1?

Following up on Mengwei's comment, I had a task for 1.0 to at least catch this any maybe try to automatically fix the symlinks. I dropped it from release blockers due to priorities, but I'll pull it into 1.0.1.

@larryliu0820 larryliu0820 changed the title Fix windows build cannot find versions.py Error out if git symlink not enabled on Windows Nov 7, 2025
@larryliu0820

Copy link
Copy Markdown
Contributor Author

I updated the PR to error out in install_executorch.bat when symlink is not enabled on the environment.

@GregoryComer GregoryComer 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.

Thanks for adding this. Looks good to me.

@larryliu0820
larryliu0820 merged commit 6e2a46b into main Nov 10, 2025
146 of 152 checks passed
@larryliu0820
larryliu0820 deleted the fix_setup_win branch November 10, 2025 18:25
JacobSzwejbka pushed a commit that referenced this pull request Nov 10, 2025
When I install executorch on windows I run into this error:   error:
[Errno 2] No such file or directory:
'pip-out\\lib.win-amd64-cpython-312\\executorch\\version.py'

This is because we are not enabling symlink in git.

Need to run:

```
 git config --global core.symlinks true
```

and reclone the repo.

This PR fails the installation when that happens.
@GregoryComer

Copy link
Copy Markdown
Contributor

@pytorchbot cherry-pick --onto release/1.0 -c critical

pytorchbot pushed a commit that referenced this pull request Nov 20, 2025
When I install executorch on windows I run into this error:   error:
[Errno 2] No such file or directory:
'pip-out\\lib.win-amd64-cpython-312\\executorch\\version.py'

This is because we are not enabling symlink in git.

Need to run:

```
 git config --global core.symlinks true
```

and reclone the repo.

This PR fails the installation when that happens.

(cherry picked from commit 6e2a46b)
@pytorchbot

Copy link
Copy Markdown
Collaborator

Cherry picking #15684

The cherry pick PR is at #15905 and it is recommended to link a critical cherry pick PR with an issue. The following tracker issues are updated:

Details for Dev Infra team Raised by workflow job

jirioc pushed a commit to nxp-upstream/executorch that referenced this pull request Dec 19, 2025
When I install executorch on windows I run into this error:   error:
[Errno 2] No such file or directory:
'pip-out\\lib.win-amd64-cpython-312\\executorch\\version.py'

This is because we are not enabling symlink in git.

Need to run:

```
 git config --global core.symlinks true
```

and reclone the repo.

This PR fails the installation when that happens.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants