File tree Expand file tree Collapse file tree
main/java/com/google/devtools/build/lib/remote Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -754,6 +754,9 @@ private void parseNoCacheOutputs(AnalysisResult analysisResult) {
754754 }
755755
756756 for (ConfiguredTarget configuredTarget : analysisResult .getTargetsToBuild ()) {
757+ // This will either dereference an alias chain, or return the final ConfiguredTarget.
758+ configuredTarget = configuredTarget .getActual ();
759+
757760 if (configuredTarget instanceof RuleConfiguredTarget ) {
758761 RuleConfiguredTarget ruleConfiguredTarget = (RuleConfiguredTarget ) configuredTarget ;
759762 for (ActionAnalysisMetadata action : ruleConfiguredTarget .getActions ()) {
Original file line number Diff line number Diff line change @@ -3318,6 +3318,33 @@ EOF
33183318 expect_log " command.profile.gz.*bytestream://" || fail " should upload profile data"
33193319}
33203320
3321+ function test_uploader_alias_action_respect_no_cache() {
3322+ mkdir -p a
3323+ cat > a/BUILD << EOF
3324+ genrule(
3325+ name = 'foo',
3326+ outs = ["foo.txt"],
3327+ cmd = "echo \"foo bar\" > \$ @",
3328+ tags = ["no-cache"],
3329+ )
3330+
3331+ alias(
3332+ name = 'foo-alias',
3333+ actual = '//a:foo',
3334+ )
3335+ EOF
3336+
3337+ bazel build \
3338+ --remote_cache=grpc://localhost:${worker_port} \
3339+ --incompatible_remote_build_event_upload_respect_no_cache \
3340+ --build_event_json_file=bep.json \
3341+ //a:foo-alias >& $TEST_log || fail " Failed to build"
3342+
3343+ cat bep.json > $TEST_log
3344+ expect_not_log " a:foo.*bytestream://"
3345+ expect_log " command.profile.gz.*bytestream://"
3346+ }
3347+
33213348function test_uploader_respect_no_cache_trees() {
33223349 mkdir -p a
33233350 cat > a/output_dir.bzl << 'EOF '
You can’t perform that action at this time.
0 commit comments