diff --git a/src/main/java/com/google/devtools/build/lib/exec/SymlinkTreeHelper.java b/src/main/java/com/google/devtools/build/lib/exec/SymlinkTreeHelper.java index 379f41f28170c1..c95e51bf596ea8 100644 --- a/src/main/java/com/google/devtools/build/lib/exec/SymlinkTreeHelper.java +++ b/src/main/java/com/google/devtools/build/lib/exec/SymlinkTreeHelper.java @@ -138,12 +138,13 @@ public void createSymlinks( /** Copies the input manifest to the output manifest. */ public void copyManifest() throws ExecException { - // Pretend we created the runfiles tree by copying the manifest + // Pretend we created the runfiles tree by symlinking the output manifest to the input manifest. + Path outputManifest = getOutputManifest(); try { symlinkTreeRoot.createDirectoryAndParents(); - FileSystemUtils.copyFile(inputManifest, getOutputManifest()); + outputManifest.createSymbolicLink(inputManifest); } catch (IOException e) { - throw new EnvironmentalExecException(e, Code.SYMLINK_TREE_MANIFEST_COPY_IO_EXCEPTION); + throw new EnvironmentalExecException(e, Code.SYMLINK_TREE_MANIFEST_LINK_IO_EXCEPTION); } }