Closed japj closed 3 years ago
@damccorm the PublishBuildArtifacts task seems to use robocopy to copy the files to a fileshare, so that seems to work correctly for long path content.
Would it be an option to use robocopy to "delete" the files instead of using rd/? (since rd seems to fail in such case)
Workaround is to:
Environment
azure-pipelines-task-lib version: 2.9.3 (as part of DeleteFiles 1.166.2) Related to https://github.com/microsoft/azure-pipelines-tasks/issues/14459
Issue Description
rmRF fails to delete published build artifacts
Expected behaviour
Since the files were published by using the Publishing Build Artifacts task we expect the files to also be correctly deleted when manually deleting the build from AzureDevOps (or when cleaning up happens due to the build retention being triggered).
Actual behaviour
Build Artifacts published to a UNC fileshare failed to be deleted by the DeleteFiles/rmRF logic due to the "rd" command failing. I manually confirmed on the buildserver that the rd command (https://github.com/microsoft/azure-pipelines-task-lib/blob/master/node/task.ts#L1171) fails with
The path xxxxx is too long
(the reported path is actually 263 characters long).Steps to reproduce