Skip to content

Git checkout issue on Windows due to long file paths #2

@kimwalisch

Description

@kimwalisch

Hi,

The GitHub Action CI of my Pseudosquares-Prime-Sieve project failed today on Windows (MinGw-64) due to too long file paths that exceed the Windows MAX_PATH limit of ~256 characters:

"C:\Program Files\Git\bin\git.exe" sparse-checkout disable
"C:\Program Files\Git\bin\git.exe" config --local --unset-all extensions.worktreeConfig
Checking out the ref
  "C:\Program Files\Git\bin\git.exe" checkout --progress --force -B main refs/remotes/origin/main
  Error: error: unable to create file lib/modular_arithmetic/montgomery_arithmetic/include/hurchalla/montgomery_arithmetic/detail/experimental/montgomery_pow_2kary/timings_x64_Zen4/old_partial_array/older/128_full_clang_asm_partial_array.txt: Filename too long
  Error: error: unable to create file lib/modular_arithmetic/montgomery_arithmetic/include/hurchalla/montgomery_arithmetic/detail/experimental/montgomery_pow_2kary/timings_x64_Zen4/old_partial_array/older/128_full_clang_noasm_partial_array.txt: Filename too long
  Error: error: unable to create file lib/modular_arithmetic/montgomery_arithmetic/include/hurchalla/montgomery_arithmetic/detail/experimental/montgomery_pow_2kary/timings_x64_Zen4/old_partial_array/older/128_full_gcc_noasm_partial_array.txt: Filename too long
...

I was able to find a workaround to fix my CI issue (enable long paths in Git on Windows):

steps:
  - name: Enable Git long paths on Windows
    run: git config --system core.longpaths true
    shell: cmd # Use the standard cmd shell for the Git configuration command

However, I think it would make sense to fix this issue in your repo and avoid long paths as otherwise Windows users might not be able to clone/checkout your repo (and my repo as well).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions