Hi,
say I have two projects they both use bazel,
in Project A I have Project B as a git repository
then in one BUILD files in Project A I use a custom rule defined in Project B
example/BUILD:
load("@repob//1.bzl", "rule1");
rule1(name="xxx", ...)
This works fine, however
in Project B,
1.bzl uses
load("//2.bzl", get_global_var)
def rule1():
v = get_global_var()
in 2.bzl, it is
PROJECT_NAME = "B"
def get_global_var():
return PROJECT_NAME
Now, this is a problem for me, because I actually wanted to set PROJECT_NAME to A , and still use the same rule definition, in project A . But since load() function automatically resolve first argument to Label, I can't even override "2.bzl" locally in Project A to return a different variable.
What other options do I have?
Thanks