[Bazel] Allow lit_test() macro to be used from other repos.
authorChristian Sigg <csigg@google.com>
Fri, 16 Sep 2022 20:27:04 +0000 (22:27 +0200)
committerChristian Sigg <csigg@google.com>
Sat, 17 Sep 2022 09:06:07 +0000 (11:06 +0200)
Wrap implicit dependencies in Label() so that they refer to @llvm-project, see https://bazel.build/rules/lib/Label#Label.

This change allows lit_test() to be used from other bazel repositories.

utils/bazel/llvm-project-overlay/llvm/lit_test.bzl

index 47ec267..ce2a0a0 100644 (file)
@@ -30,8 +30,8 @@ def lit_test(
 
     native.py_test(
         name = name,
-        srcs = ["//llvm:lit"],
-        main = "//llvm:utils/lit/lit.py",
+        srcs = [Label("//llvm:lit")],
+        main = Label("//llvm:utils/lit/lit.py"),
         args = args + ["-v"] + ["$(execpath %s)" % src for src in srcs],
         data = data + srcs,
         legacy_create_init = False,