Make labels in .bzl files in remote repos resolve relative to their repo
For example, if you have a BUILD file that does:
load('@foo//bar:baz.bzl', 'my_rule')
my_rule(...)
If baz.bzl uses Label('//whatever'), this change makes //whatever resolve to
@foo//whatever. Previous to this change, it would be resolved to the repository
the BUILD file using my_rule was in.
RELNOTES[INC]: Labels in .bzl files in remote repositories will be resolved
relative to their repository (instead of the repository the Skylark rule is
used in).
--
MOS_MIGRATED_REVID=117720181
diff --git a/src/main/java/com/google/devtools/build/lib/packages/RuleClassProvider.java b/src/main/java/com/google/devtools/build/lib/packages/RuleClassProvider.java
index f6529a6..2f0988f 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/RuleClassProvider.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/RuleClassProvider.java
@@ -49,12 +49,15 @@
* Returns a new Skylark Environment instance for rule creation.
* Implementations need to be thread safe.
* Be sure to close() the mutability before you return the results of said evaluation.
+ *
+ * @param label the location of the rule.
* @param mutability the Mutability for the current evaluation context
* @param eventHandler the EventHandler for warnings, errors, etc.
* @param astFileContentHashCode the hash code identifying this environment.
* @return an Environment, in which to evaluate load time skylark forms.
*/
Environment createSkylarkRuleClassEnvironment(
+ Label label,
Mutability mutability,
EventHandler eventHandler,
@Nullable String astFileContentHashCode,