Provide the RuleContext in the buildCcInfoProvider method in PythonSemantics.
PiperOrigin-RevId: 447087141
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
index 94ef431..ec9ab61 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
@@ -473,7 +473,8 @@
}
@Override
- public CcInfo buildCcInfoProvider(Iterable<? extends TransitiveInfoCollection> deps) {
+ public CcInfo buildCcInfoProvider(
+ RuleContext ruleContext, Iterable<? extends TransitiveInfoCollection> deps) {
ImmutableList<CcInfo> ccInfos =
ImmutableList.<CcInfo>builder()
.addAll(AnalysisUtils.getProviders(deps, CcInfo.PROVIDER))
diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PyExecutable.java b/src/main/java/com/google/devtools/build/lib/rules/python/PyExecutable.java
index 3c54608..4fa3735 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/python/PyExecutable.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/python/PyExecutable.java
@@ -62,7 +62,8 @@
return null;
}
- CcInfo ccInfo = semantics.buildCcInfoProvider(ruleContext.getPrerequisites("deps"));
+ CcInfo ccInfo =
+ semantics.buildCcInfoProvider(ruleContext, ruleContext.getPrerequisites("deps"));
Runfiles commonRunfiles = collectCommonRunfiles(ruleContext, common, semantics, ccInfo);
diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PyLibrary.java b/src/main/java/com/google/devtools/build/lib/rules/python/PyLibrary.java
index 62d6a66..73749a4 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/python/PyLibrary.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/python/PyLibrary.java
@@ -68,7 +68,7 @@
.setFilesToBuild(filesToBuild)
.addNativeDeclaredProvider(
new PyCcLinkParamsProvider(
- semantics.buildCcInfoProvider(ruleContext.getPrerequisites("deps"))))
+ semantics.buildCcInfoProvider(ruleContext, ruleContext.getPrerequisites("deps"))))
.add(RunfilesProvider.class, RunfilesProvider.simple(runfilesBuilder.build()))
.build();
}
diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PythonSemantics.java b/src/main/java/com/google/devtools/build/lib/rules/python/PythonSemantics.java
index 6c399d2..1beb2a1 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/python/PythonSemantics.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/python/PythonSemantics.java
@@ -90,7 +90,8 @@
RuleConfiguredTargetBuilder builder)
throws InterruptedException, RuleErrorException;
- CcInfo buildCcInfoProvider(Iterable<? extends TransitiveInfoCollection> deps);
+ CcInfo buildCcInfoProvider(
+ RuleContext ruleContext, Iterable<? extends TransitiveInfoCollection> deps);
/**
* Called when building executables or packages to fill in missing empty __init__.py files if the