File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -76,11 +76,8 @@ def _is_external_label(param):
76
76
Returns:
77
77
a bool
78
78
"""
79
-
80
- # Seems like a bug in Bazel that the workspace_root for a label like
81
- # @@//js/private/node-patches:fs.js is "external"
82
- # See https://github.com/bazelbuild/bazel/issues/16528
83
- if str (param ).startswith ("@@//" ):
79
+ if not _is_bazel_6_or_greater () and str (param ).startswith ("@@//" ):
80
+ # Work-around for https://github.com/bazelbuild/bazel/issues/16528
84
81
return False
85
82
return len (_to_label (param ).workspace_root ) > 0
86
83
Original file line number Diff line number Diff line change @@ -51,12 +51,13 @@ def _is_external_label_test_impl(ctx):
51
51
asserts .false (env , utils .is_external_label ("//some/label" ))
52
52
asserts .false (env , utils .is_external_label (Label ("//some/label" )))
53
53
asserts .false (env , utils .is_external_label ("@//some/label" ))
54
-
55
- # TODO(Bazel 6.0): enable this test when the @@ syntax is available
56
- # asserts.false(env, utils.is_external_label("@@//some/label"))
57
54
asserts .false (env , utils .is_external_label (Label ("@aspect_bazel_lib//some/label" )))
58
55
asserts .false (env , ctx .attr .internal_with_workspace_as_string )
59
56
57
+ # the "@@" repository name syntax applies to Bazel 6 or greater
58
+ if utils .is_bazel_6_or_greater ():
59
+ asserts .false (env , utils .is_external_label ("@@//some/label" ))
60
+
60
61
# assert that labels and string that give a workspace return true
61
62
asserts .true (env , utils .is_external_label (Label ("@foo//some/label" )))
62
63
asserts .true (env , ctx .attr .external_as_string )
You can’t perform that action at this time.
0 commit comments