RemoteExecutionClient: Support replacing files in `downloadOutputs()`
Description
downloadOutputs()
currently fails if an output file already exists with
Failed to link downloaded file to final location
due to linkat()
not supporting file replacement. As the typical behavior of tools is to replace (or overwrite) existing output files, this changes downloadOutputs()
to match the expected behavior.
Changes proposed in this merge request:
- FileUtils: Support
copyFile()
with dirfds - RemoteExecutionClient: Extract
stageDownloadedFile()
method - RemoteExecutionClient: Support replacing files in
downloadOutputs()
Validation
I've extended the existing test case to also test file replacement. I've verified that the updated test case fails with master and passes with this branch.