aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2017-08-17 05:40:27 +0200
committerGravatar Irina Iancu <elenairina@google.com>2017-08-17 09:54:45 +0200
commitab38960b9f34b965352d953afc00b918a97966a3 (patch)
tree35ec33254ef4033482bfc901a26a5c25bedaee58 /src
parent5e65c9828f424b6b0214b984b5d38c9cfc1c746f (diff)
Honor --nobuild_runfile_links for non-tests, and propagate it to the
host configuration. I think the comment I'm deleting is misleading. PAR file construction already has special handling of the input manifest, and host tools do get their runfiles when executed remotely. They don't get them for local execution, but users who care about that don't need to pass the non-default --nobuild_runfile_links option. RELNOTES: None. PiperOrigin-RevId: 165535870
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java20
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java5
2 files changed, 2 insertions, 23 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java b/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java
index 0957cbd7fe..2274a3dfb9 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java
@@ -1521,25 +1521,7 @@ public final class RuleContext extends TargetContext
* false if it should just create the manifest.
*/
public boolean shouldCreateRunfilesSymlinks() {
- // TODO(bazel-team): Ideally we wouldn't need such logic, and we'd
- // always use the BuildConfiguration#buildRunfiles() to determine
- // whether to build the runfiles. The problem is that certain build
- // steps actually consume their runfiles. These include:
- // a. par files consumes the runfiles directory
- // We should modify autopar to take a list of files instead.
- // of the runfiles directory.
- // b. host tools could potentially use data files, but currently don't
- // (they're run from the execution root, not a runfiles tree).
- // Currently hostConfiguration.buildRunfiles() returns true.
- if (isTestTarget()) {
- // Tests are only executed during testing (duh),
- // and their runfiles are generated lazily on local
- // execution (see LocalTestStrategy). Therefore, it
- // is safe not to build their runfiles.
- return getConfiguration().buildRunfiles();
- } else {
- return true;
- }
+ return getConfiguration().buildRunfiles();
}
/**
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java
index db9649d495..7dcb00cd9b 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java
@@ -1062,10 +1062,7 @@ public final class BuildConfiguration implements BuildEvent {
}
// === Runfiles ===
- // Ideally we could force this the other way, and skip runfiles construction
- // for host tools which are never run locally, but that's probably a very
- // small optimization.
- host.buildRunfiles = true;
+ host.buildRunfiles = buildRunfiles;
// === Linkstamping ===
// Disable all link stamping for the host configuration, to improve action