aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java
diff options
context:
space:
mode:
authorGravatar nharmata <nharmata@google.com>2017-05-02 18:16:23 +0200
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2017-05-03 10:56:14 +0200
commit5e924aff704b68f5b02c47672e4ac217c7376cf2 (patch)
tree22fa87938eb2bbc2592ddc983aee6b6c6d475222 /src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java
parent08718159ed47ee689c62d9974583f4d1680c7cdc (diff)
Automated g4 rollback of commit 7beadb7277453efec7e12b925005e7f0e003b592.
*** Reason for rollback *** Original CL was rolled backed incorrectly. See post-submit discussion on http://https://github.com/bazelbuild/bazel/commit/7beadb7277453efec7e12b925005e7f0e003b592. *** Original change description *** Automated g4 rollback of commit 38b835097f9ae9a6062172b8a33ec2e2d1edde20. *** Reason for rollback *** Breaking Bazel build on linux, see http://ci.bazel.io/job/bazel-tests/733/ Repro: bazel build //src/test/java/com/google/devtools/build/lib:packages_test Found by bisecting. *** Original change description *** Only allocate some formerly frequently allocated PathFragment objects once. This reduces both gc churn and retained memory usage. RELNOTES: None PiperOrigin-RevId: 154839279
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java
index 74d1d3cdb0..1b1884ce8d 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java
@@ -110,6 +110,8 @@ public class CppCompileAction extends AbstractAction
}
};
+ private static final PathFragment BUILD_PATH_FRAGMENT = PathFragment.create("BUILD");
+
private static final int VALIDATION_DEBUG = 0; // 0==none, 1==warns/errors, 2==all
private static final boolean VALIDATION_DEBUG_WARN = VALIDATION_DEBUG >= 1;
@@ -948,7 +950,7 @@ public class CppCompileAction extends AbstractAction
// Still not found: see if it is in a subdir of a declared package.
Path root = input.getRoot().getPath();
for (Path dir = input.getPath().getParentDirectory();;) {
- if (dir.getRelative("BUILD").exists()) {
+ if (dir.getRelative(BUILD_PATH_FRAGMENT).exists()) {
return false; // Bad: this is a sub-package, not a subdir of a declared package.
}
dir = dir.getParentDirectory();