aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/google/devtools/build/lib/query2/ConfiguredTargetQueryEnvironment.java9
-rwxr-xr-xsrc/test/shell/integration/configured_query_test.sh23
2 files changed, 6 insertions, 26 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/query2/ConfiguredTargetQueryEnvironment.java b/src/main/java/com/google/devtools/build/lib/query2/ConfiguredTargetQueryEnvironment.java
index 0dfff29072..c87583db36 100644
--- a/src/main/java/com/google/devtools/build/lib/query2/ConfiguredTargetQueryEnvironment.java
+++ b/src/main/java/com/google/devtools/build/lib/query2/ConfiguredTargetQueryEnvironment.java
@@ -180,14 +180,17 @@ public class ConfiguredTargetQueryEnvironment
}
private ConfiguredTarget getConfiguredTarget(Label label) throws InterruptedException {
- // Try with host configuration.
+ // Try with target configuration.
ConfiguredTarget configuredTarget =
- getConfiguredTarget(ConfiguredTargetValue.key(label, hostConfiguration));
+ getConfiguredTarget(ConfiguredTargetValue.key(label, defaultTargetConfiguration));
if (configuredTarget != null) {
return configuredTarget;
}
+ // Try with host configuration (even when --nohost_deps is set in the case that top-level
+ // targets are configured in the host configuration so we are doing a host-configuration-only
+ // query).
configuredTarget =
- getConfiguredTarget(ConfiguredTargetValue.key(label, defaultTargetConfiguration));
+ getConfiguredTarget(ConfiguredTargetValue.key(label, hostConfiguration));
if (configuredTarget != null) {
return configuredTarget;
}
diff --git a/src/test/shell/integration/configured_query_test.sh b/src/test/shell/integration/configured_query_test.sh
index bdeea8c23c..0a09332306 100755
--- a/src/test/shell/integration/configured_query_test.sh
+++ b/src/test/shell/integration/configured_query_test.sh
@@ -103,29 +103,6 @@ function test_universe_scope_specified() {
assert_not_equals $HOST_CONFIG $TARGET_CONFIG
}
-# This test ensures the known buggy behavior described at b/71905538 i.e. nodes
-# lingering from previous builds.
-# TODO(juliexxia): Remove this test once b/71905538 is fixed.
-function test_ghost_nodes_bug() {
- write_java_library_build
-
- # Create host-configured //pine:plugin node in this cquery
- bazel cquery "deps(//pine:my_java)" || fail "Excepted success"
- # This cquery should return target configured //pine:plugin but actually returns
- # the host-configured target generated above. This is the buggy behavior.
- bazel cquery //pine:dep+//pine:plugin \
- > output 2>"$TEST_log" || fail "Excepted success"
-
- # Find the lines of output for //pine:plugin and //pine:dep.
- PLUGIN=$(grep "//pine:plugin" output)
- DEP=$(grep "//pine:dep" output)
- # Trim to just configurations.
- PLUGIN_CONFIG=${PLUGIN/"//pine:plugin"}
- DEP_CONFIG=${DEP/"//pine:dep"}
- # Ensure they are are not equal (the buggy behavior).
- assert_not_equals $PLUGIN_CONFIG $DEP_CONFIG
-}
-
function test_host_config_output() {
write_java_library_build