Skip to content

files with long path cannot be deleted/reverted with the windows docker executor

Summary

When the runner reuses the repository the files cannot be deleted/reverted

Steps to reproduce

create some long path files in a previous job and download them in a job afterwards

Actual behavior

Files cannot be deleted/reverted because the path of the files is too long

Expected behavior

Relevant logs and/or screenshots

job log
...
Fetching changes...
Reinitialized existing Git repository in XXXXXXX/.git/
Checking out b6ac68bb as feature/docker_test...
warning: could not open directory 'artifacts/VsTestResults/x64/LE/TestResults/Deploy_ContainerAdministrator 2019-06-24 09_10_25/Out/CreateTargetFlash_NewAddFiles/CreateTargetFlash_NewAddFiles/AddFilesForExecutableSystem/appldisk/application/control/config/': Filename too long
warning: could not open directory 'artifacts/VsTestResults/x64/LE/TestResults/Deploy_ContainerAdministrator 2019-06-24 09_10_25/Out/CreateTargetFlash_NewAddFiles/CreateTargetFlash_NewAddFiles/AddFilesForExecutableSystem/appldisk/application/control/image/': Filename too long
...

Environment description

Installation on a Windows Server 2019

Used GitLab Runner version

Actual 12.0.0 PreRelease

Possible fixes

adding the following line in dockerfiles\build\Dockerfile.x86_64_servercore1809 and dockerfiles\build\Dockerfile.x86_64_servercore1803

RUN git config --system core.longpaths true

dockerfiles\build\Dockerfile.x86_64_servercore1803

COPY --from=builder ["git-lfs", "C:\\Program Files\\git-lfs"]
RUN setx PATH "%PATH%;C:\Program Files\git\cmd;C:\Program Files\git-lfs;C:\Program Files\gitlab-runner-helper" /M

RUN git lfs install --skip-repo
RUN git config --system core.longpaths true

COPY [".\\binaries\\gitlab-runner-helper.x86_64-windows.exe", "C:\\Program Files\\gitlab-runner-helper\\gitlab-runner-helper.exe"]

after adding this line the error won't occure any more

Edited by Benjamin Leitner