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

[bug] I think I am running into PATH length limits or symlink(ntfs links) issues #309

Open
kozmaz87 opened this issue Mar 15, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@kozmaz87
Copy link

What happened?

Creating artifact from directory blows up
image

What did you expect to happen?

The folder to be packed up correctly.

How can we reproduce it?

Create an anaconda env with tensorflow, package it up with electron and try to get the directory put into an artifact.

Anything else we need to know?

No response

What version of the action are you using?

v3

What are your runner environments?

window

Are you on GitHub Enterprise Server? If so, what version?

No response

@kozmaz87 kozmaz87 added the bug Something isn't working label Mar 15, 2022
@kozmaz87 kozmaz87 changed the title [bug] I think I am running into PATH length limits or symlink issues [bug] I think I am running into PATH length limits or symlink(ntfs links) issues Mar 15, 2022
@grzegorz-wolszczak-relone
Copy link

grzegorz-wolszczak-relone commented Mar 22, 2022

I have the same issue. Even though operating system supports LongPaths, this task cannot process paths longer that 260 chars.

e.g. this piece of github actions reproduces the issue

      - name: Create directory path longer than 260 characters
        shell: pwsh
        run: |
          # first: check if system supports long paths
          $longPathsEnabled = (Get-ItemProperty "HKLM:System\CurrentControlSet\Control\FileSystem").LongPathsEnabled
          if($longPathsEnabled -ne 1 )
          {
            throw "Long paths are not supported on this operating system: (longPathsEnabledValue:$($longPathsEnabled))"
          }
          Write-Host "OK: Long paths are supported on this system"
          
         
          $paths = [System.Collections.Generic.List[string]]::new();
          $length = 0;
          for($i = 0; $i -le 60; $i++)
          {
            $dirName = "dir_${i}"
            $length += $dirName.Length
            $paths.Add($dirName);
            if($length -ge 260 ){
                break
            }            
          }
        
          $generatedDirs = [string]::Join("/", $paths);
          write-host "Generated path length is $($generatedDirs.Length)"
          $tempDir = [System.IO.Path]::GetTempPath()
          
          $baseDir = Join-Path $tempDir "baseDir"
          $fullDir = Join-Path $baseDir $generatedDirs
          Write-Host "full dir length: $($fullDir.Length)"
          
          # create directory          
          New-Item -Path $fullDir -ItemType Directory
                  
          # set directory path as environment variable to be used in next step
          Add-Content -Path "$env:GITHUB_ENV" -Value "DIRECTORY_WITH_LONG_PATH=${fullDir}"
         

      - name: Store artifacts
        uses: actions/upload-artifact@v3
        if: success() || failure()
        with:
          name: 'some artifact name'
          path: ${{env.DIRECTORY_WITH_LONG_PATH}}/

output like that:
image

@laeubi
Copy link

laeubi commented Oct 19, 2022

I think this is the issue reported here:

the noejs issue is closed but it is unclear how/if this fixes the issue with the upload ..

@laeubi
Copy link

laeubi commented Nov 3, 2022

Are there any updates? THis currently renders the action useless as it can only reliable be used on linux :-\

@Piedone
Copy link

Piedone commented Nov 3, 2022

For those wondering, an obvious workaround is to move the files you want to upload as artifacts to a separate folder under a short path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants