Skip to content

Commit f568d48

Browse files
huydhnpytorchmergebot
authored andcommitted
Enable git long paths checkout on Windows (#138411)
Checking out PyTorch on Windows starts to fail after ROCm change #131004 in which one of the submodule path, `third_party/composable_kernel`, is getting too long https://hud.pytorch.org/pr/pytorch/pytorch/131004#31778700376 According to actions/checkout#1285, there is no fix in GHA checkout, but we can set `git config --system core.longpaths true` to enable long paths support in Git as a workaround. ### Testing Windows checkout is ok now https://github.com/pytorch/pytorch/actions/runs/11423112351/job/31781916540 Pull Request resolved: #138411 Approved by: https://github.com/wdvr
1 parent f830374 commit f568d48

9 files changed

Lines changed: 934 additions & 2 deletions

.github/templates/common.yml.j2

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ concurrency:
4040
continue-on-error: true
4141
with:
4242
github-secret: ${{ secrets.GITHUB_TOKEN }}
43+
- name: Enable git long paths and symlinks on Windows and disable fsmonitor daemon
44+
shell: bash
45+
run: |
46+
git config --global core.longpaths true
47+
git config --global core.symlinks true
48+
49+
# https://git-scm.com/docs/git-fsmonitor--daemon. The daemon could lock
50+
# the directory on Windows and prevent GHA from checking out as reported
51+
# in https://github.com/actions/checkout/issues/1018
52+
git config --global core.fsmonitor false
4353
# Needed for binary builds, see: https://github.com/pytorch/pytorch/issues/73339#issuecomment-1058981560
4454
- name: Enable long paths on Windows
4555
shell: powershell

.github/workflows/_win-build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@ jobs:
6868
shell: bash
6969
steps:
7070
# Duplicated in win-test because this MUST go before a checkout
71-
- name: Enable git symlinks on Windows and disable fsmonitor daemon
71+
- name: Enable git long paths and symlinks on Windows and disable fsmonitor daemon
7272
shell: bash
7373
run: |
74+
git config --global core.longpaths true
7475
git config --global core.symlinks true
7576
7677
# https://git-scm.com/docs/git-fsmonitor--daemon. The daemon could lock

.github/workflows/_win-test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ jobs:
4646
shell: bash
4747
steps:
4848
# Duplicated in win-build because this MUST go before a checkout
49-
- name: Enable git symlinks on Windows and disable fsmonitor daemon
49+
- name: Enable git long paths and symlinks on Windows and disable fsmonitor daemon
5050
shell: bash
5151
run: |
52+
git config --global core.longpaths true
5253
git config --global core.symlinks true
5354
5455
# https://git-scm.com/docs/git-fsmonitor--daemon. The daemon could lock

.github/workflows/generated-windows-binary-conda-nightly.yml

Lines changed: 320 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/generated-windows-binary-libtorch-debug-main.yml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/generated-windows-binary-libtorch-debug-nightly.yml

Lines changed: 80 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/generated-windows-binary-libtorch-release-main.yml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/generated-windows-binary-libtorch-release-nightly.yml

Lines changed: 80 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)