Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
disable RE for CxxInferCaptureTransitiveRule
Browse files Browse the repository at this point in the history
Summary:
CxxInferCaptureTransitiveRule is uncacheable (fixed recently) and should not run on RE as it manipulates absolute paths.

The absolute paths are a design bug (it dates back to more than 6-7 years); this diff is a workaround until we fix this.

The upshot is that this rule is pointless to RE as it basically just concatenates a list of outputs.

Reviewed By: martintrojer

fbshipit-source-id: 6bc19c494d92c729913e550d21d3bb07eef1e016
  • Loading branch information
ngorogiannis authored and facebook-github-bot committed Sep 28, 2021
1 parent 239e850 commit 499f461
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
10 changes: 4 additions & 6 deletions src/com/facebook/buck/cxx/CxxInferCaptureTransitiveRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ public CxxInferCaptureTransitiveRule(
BuildTarget buildTarget,
ProjectFilesystem filesystem,
SourcePathRuleFinder ruleFinder,
ImmutableSet<CxxInferCaptureRule> captureRules,
boolean executeRemotely) {
super(buildTarget, filesystem, ruleFinder, new Impl(captureRules, executeRemotely));
ImmutableSet<CxxInferCaptureRule> captureRules) {
super(buildTarget, filesystem, ruleFinder, new Impl(captureRules));
}

@Override
Expand All @@ -77,15 +76,14 @@ static class Impl
/** Whether or not infer rules can be executed remotely. Fails serialization if false. */
@AddToRuleKey
@CustomFieldBehavior(RemoteExecutionEnabled.class)
private final boolean executeRemotely;
private final boolean executeRemotely = false;

public Impl(ImmutableSet<CxxInferCaptureRule> captureRules, boolean executeRemotely) {
public Impl(ImmutableSet<CxxInferCaptureRule> captureRules) {
this.output = new OutputPath(OUTPUT_PATH);
this.captureRulesOutputs =
captureRules.stream()
.map(CxxInferCaptureRule::getSourcePathToOutput)
.collect(ImmutableSet.toImmutableSet());
this.executeRemotely = executeRemotely;
}

@Override
Expand Down
3 changes: 1 addition & 2 deletions src/com/facebook/buck/cxx/CxxInferEnhancer.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@ private BuildRule requireAllTransitiveCaptureBuildRules(
ImmutableSet<CxxInferCaptureRule> captureRules = aggregator.getAllTransitiveCaptures();

return graphBuilder.addToIndex(
new CxxInferCaptureTransitiveRule(
target, filesystem, graphBuilder, captureRules, inferConfig.executeRemotely()));
new CxxInferCaptureTransitiveRule(target, filesystem, graphBuilder, captureRules));
}

private CxxInferCaptureRulesAggregator requireInferCaptureAggregatorBuildRuleForCxxDescriptionArg(
Expand Down

0 comments on commit 499f461

Please sign in to comment.