Skip to content

Commit

Permalink
Add AEGs to CppCompileActionTemplate inside CcCompilationHelper.
Browse files Browse the repository at this point in the history
This action was not covered by cc_common.compile or cc_link, which are already getting action owner from the AEG connected to the cpp toolchain type.

PiperOrigin-RevId: 525426385
Change-Id: Ie7f00a3a043095953705b9364820d7878f55bfa8
  • Loading branch information
kotlaja authored and copybara-github committed Apr 19, 2023
1 parent 71b4342 commit 6adbbc9
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.io.Files;
import com.google.devtools.build.lib.actions.ActionOwner;
import com.google.devtools.build.lib.actions.ActionRegistry;
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.actions.Artifact.SpecialArtifact;
Expand Down Expand Up @@ -910,7 +911,7 @@ private PublicHeaders computePublicHeaders(List<Artifact> headers) throws Interr
originalHeader,
virtualHeader,
"Symlinking virtual headers for " + label,
/*useExecRootForSource=*/ true));
/* useExecRootForSource= */ true));
moduleHeadersBuilder.add(virtualHeader);
if (configuration.isCodeCoverageEnabled()) {
virtualToOriginalHeaders.add(
Expand Down Expand Up @@ -1497,6 +1498,12 @@ private Artifact createCompileActionTemplate(
CppHelper.getDiagnosticsOutputTreeArtifact(
actionConstructionContext, label, sourceArtifact, outputName, usePic);
}

ActionOwner actionOwner = null;
if (actionConstructionContext instanceof RuleContext
&& ((RuleContext) actionConstructionContext).useAutoExecGroups()) {
actionOwner = actionConstructionContext.getActionOwner(semantics.getCppToolchainType());
}
CppCompileActionTemplate actionTemplate =
new CppCompileActionTemplate(
sourceArtifact,
Expand All @@ -1506,7 +1513,7 @@ private Artifact createCompileActionTemplate(
builder,
ccToolchain,
outputCategories,
actionConstructionContext.getActionOwner());
actionOwner == null ? actionConstructionContext.getActionOwner() : actionOwner);
actionRegistry.registerAction(actionTemplate);

return outputFiles;
Expand Down

0 comments on commit 6adbbc9

Please sign in to comment.