Skip to content

Commit

Permalink
Clarify the purpose of the boolean argument to createRunfiles.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 547476948
Change-Id: Ia0f68c3b367b1fa33094a5b58b42210d06190b65
  • Loading branch information
tjgq authored and copybara-github committed Jul 12, 2023
1 parent 65c16a9 commit 1ef4aac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void updateRunfiles(
// We are the first attempt; update the runfiles tree and mark the future complete.
try {
updateRunfilesTree(
runfilesDir, env, outErr, runfilesSupplier.isRunfileLinksEnabled(runfilesDir));
runfilesDir, env, outErr, !runfilesSupplier.isRunfileLinksEnabled(runfilesDir));
freshFuture.complete(null);
} catch (Exception e) {
freshFuture.completeExceptionally(e);
Expand All @@ -100,7 +100,7 @@ private void updateRunfilesTree(
PathFragment runfilesDir,
ImmutableMap<String, String> env,
OutErr outErr,
boolean enableRunfiles)
boolean manifestOnly)
throws IOException, ExecException, InterruptedException {
Path runfilesDirPath = execRoot.getRelative(runfilesDir);
Path inputManifest = RunfilesSupport.inputManifestPath(runfilesDirPath);
Expand Down Expand Up @@ -131,6 +131,6 @@ private void updateRunfilesTree(

SymlinkTreeHelper helper =
new SymlinkTreeHelper(inputManifest, runfilesDirPath, /* filesetTree= */ false);
helper.createSymlinks(execRoot, outErr, binTools, env, enableRunfiles);
helper.createSymlinks(execRoot, outErr, binTools, env, manifestOnly);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,19 @@ public void createSymlinksDirectly(Path symlinkTreeRoot, Map<PathFragment, Artif
/**
* Creates symlink tree and output manifest using the {@code build-runfiles.cc} tool.
*
* @param enableRunfiles If {@code false} only the output manifest is created.
* @param manifestOnly If {@code true}, only the output manifest is created.
*/
public void createSymlinks(
Path execRoot,
OutErr outErr,
BinTools binTools,
Map<String, String> shellEnvironment,
boolean enableRunfiles)
boolean manifestOnly)
throws ExecException, InterruptedException {
if (enableRunfiles) {
createSymlinksUsingCommand(execRoot, binTools, shellEnvironment, outErr);
} else {
if (manifestOnly) {
copyManifest();
} else {
createSymlinksUsingCommand(execRoot, binTools, shellEnvironment, outErr);
}
}

Expand Down

0 comments on commit 1ef4aac

Please sign in to comment.