Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows long paths support #4913

Closed
1 of 7 tasks
JamieMagee opened this issue Jan 19, 2022 · 4 comments
Closed
1 of 7 tasks

Windows long paths support #4913

JamieMagee opened this issue Jan 19, 2022 · 4 comments
Assignees
Labels
Area: Image administration investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: Windows

Comments

@JamieMagee
Copy link

Description

When attempting to checkout https://github.com/Azure/azure-sdk-for-net into a subdirectory on a Windows 2019 based runner I receive many error messages like the following:

error: unable to create file sdk/cognitiveservices/Microsoft.Azure.Management.CognitiveServices/tests/SessionRecords/CognitiveServices.Tests.CognitiveServicesAccountTests/CognitiveServicesAccountCreateAllApisTest.json: Filename too long

Please enable long paths support when building Windows images

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force

Virtual environments affected

  • Ubuntu 18.04
  • Ubuntu 20.04
  • macOS 10.15
  • macOS 11
  • Windows Server 2016
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

Environment: windows-2019
Version: 20220116.1

https://github.com/microsoft/component-detection/runs/4874590492?check_suite_focus=true

Is it regression?

No

Expected behavior

No response

Actual behavior

No response

Repro steps

  1. Try and check out a repository to a path with more than 260 characters 1

Footnotes

  1. https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation

@JamieMagee JamieMagee changed the title Windows long filename support Windows long paths support Jan 19, 2022
@al-cheb
Copy link
Contributor

al-cheb commented Jan 20, 2022

Hey, @JamieMagee
LongPathsEnabled is enabled - https://github.com/actions/virtual-environments/blob/a64db791f32ffe355d7397c1ac896d42686e9dfa/images/win/scripts/Installers/Initialize-VM.ps1#L70

- name: Check LongPathsEnabled
  run: |
           (Get-ItemProperty "HKLM:System\CurrentControlSet\Control\FileSystem").LongPathsEnabled

image

@JamieMagee
Copy link
Author

Interesting! After some more searching, it might be a configuration issue with git1. Is it possible to set a git config default for the image?

git config --system core.longpaths true

Footnotes

  1. https://stackoverflow.com/a/22575737

@al-cheb al-cheb self-assigned this Jan 20, 2022
@al-cheb al-cheb added Area: Image administration investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: Windows and removed needs triage labels Jan 20, 2022
@al-cheb
Copy link
Contributor

al-cheb commented Jan 20, 2022

Interesting! After some more searching, it might be a configuration issue with git1. Is it possible to set a git config default for the image?

git config --system core.longpaths true

Footnotes

  1. https://stackoverflow.com/a/22575737

I will take a look at it.

As a workaround set this flag in runtime:

 - name: Set git core.longpaths flag
        run: |
            git config --system core.longpaths true
      - name: Clone verification repo (nuget/azure-sdk-for-net)
        uses: actions/checkout@v2.3.2
        with:
          repository: Azure/azure-sdk-for-net
          path: verification/projects/nuget
          ref: 1bf85a0ae26d1453e190dd2323fed43f560e9837

image

@al-cheb
Copy link
Contributor

al-cheb commented Jan 20, 2022

@JamieMagee , We have decided not to set up this option at the system level - #4915 (comment) due to impact to customers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Image administration investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: Windows
Projects
None yet
Development

No branches or pull requests

2 participants