Skip to content

Commit

Permalink
Materialize the runfiles output manifest as a symlink instead of a co…
Browse files Browse the repository at this point in the history
…py when building with --nobuild_runfile_links.

Compare with the equivalent code path for --build_runfile_links in SymlinkTreeStrategy#createOutput.

PiperOrigin-RevId: 552457444
Change-Id: I8ae22a15fcdc60395dfe2a112b6dc59e0ed10236
  • Loading branch information
tjgq authored and copybara-github committed Jul 31, 2023
1 parent 0c91725 commit 0763dd0
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 0763dd0

Please sign in to comment.