diff options
author | Benjamin Peterson <bp@benjamin.pe> | 2018-04-12 08:05:59 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-04-12 08:07:41 -0700 |
commit | fdda242d815c895f23d980674eeb15a7c77b0737 (patch) | |
tree | 70daa9a140453421fc95b13cab465d3a1b1a33e0 /src/test/cpp | |
parent | b456e9d9e53b1f45b181da277efb4d12cc4f031f (diff) |
Make FileSystemUtils.moveFile always preserve symlinks and use it in SandboxedSpawn.copyOutputs.
Previously, if moveFile fell back to copying from a true rename (e.g., if the
move is across file systems), it would fully dereference the source and produce
a regular file at the output location. This CL fixes moveFile to properly copy
symlinks. Note we don't preserve metadata in the symlink case mostly because the
Bazel VFS has no API to write metadata without dereferencing symlinks. (But,
also, it's not important for the current use cases.)
This breaks the backward-compatibility of FileSystemUtils.moveFile and
FileSystemUtils.moveTreeBelow. This seems okay because the new behavior makes
more sense, and sandbox is the only consumer of these APIs.
Switching SandboxedSpawn.copyOutputs to use FileSystemUtils.moveFile rather than
Guava's Files.move fixes https://github.com/bazelbuild/bazel/issues/4987.
Closes #4989.
Change-Id: I0283e8aa11fadff5b0afd7bdfd0490aca12a1f6b
PiperOrigin-RevId: 192611227
Diffstat (limited to 'src/test/cpp')
0 files changed, 0 insertions, 0 deletions