Skip to content

Commit

Permalink
Fetch extra action outputs with --remote_download_toplevel
Browse files Browse the repository at this point in the history
This allows Kythe extraction to work with BwoB.

Closes #23669.

PiperOrigin-RevId: 676371827
Change-Id: I354cb9b9c0ec3511c6d866956fca1ff06a27cfab
  • Loading branch information
fmeum authored and bazel-io committed Sep 19, 2024
1 parent 3300d15 commit d27a976
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/com/google/devtools/build/lib/remote/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ java_library(
"//src/main/java/com/google/devtools/build/lib/actions:file_metadata",
"//src/main/java/com/google/devtools/build/lib/analysis:analysis_cluster",
"//src/main/java/com/google/devtools/build/lib/analysis:configured_target",
"//src/main/java/com/google/devtools/build/lib/analysis:extra_action_artifacts_provider",
"//src/main/java/com/google/devtools/build/lib/analysis:provider_collection",
"//src/main/java/com/google/devtools/build/lib/analysis:top_level_artifact_context",
"//src/main/java/com/google/devtools/build/lib/clock",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.google.devtools.build.lib.analysis.AnalysisResult;
import com.google.devtools.build.lib.analysis.ConfiguredAspect;
import com.google.devtools.build.lib.analysis.ConfiguredTarget;
import com.google.devtools.build.lib.analysis.ExtraActionArtifactsProvider;
import com.google.devtools.build.lib.analysis.FilesToRunProvider;
import com.google.devtools.build.lib.analysis.ProviderCollection;
import com.google.devtools.build.lib.analysis.TopLevelArtifactContext;
Expand Down Expand Up @@ -170,6 +171,7 @@ private void addTopLevelTarget(
.getImportantArtifacts();
addOutputsToDownload(artifactsToBuild.toList());
addRunfiles(target);
addExtraActionArtifacts(target);
}
}

Expand Down Expand Up @@ -205,6 +207,14 @@ private void addRunfiles(ProviderCollection buildTarget) {
}
}

private void addExtraActionArtifacts(ProviderCollection target) {
ExtraActionArtifactsProvider extraActionArtifactsProvider =
target.getProvider(ExtraActionArtifactsProvider.class);
if (extraActionArtifactsProvider != null) {
addOutputsToDownload(extraActionArtifactsProvider.getExtraActionArtifacts().toList());
}
}

private void addTargetUnderTest(ProviderCollection target) {
TestProvider testProvider = checkNotNull(target.getProvider(TestProvider.class));
if (outputsMode != RemoteOutputsMode.MINIMAL && commandMode == CommandMode.TEST) {
Expand Down

0 comments on commit d27a976

Please sign in to comment.