File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,9 @@ aws_repositories = repository_rule(
156
156
attrs = _ATTRS ,
157
157
)
158
158
159
+ def _is_bazel_6_or_greater ():
160
+ return "apple_binary" not in dir (native )
161
+
159
162
def _aws_alias_impl (rctx ):
160
163
rctx .file ("BUILD.bazel" , """\
161
164
load("@bazel_skylib//rules:native_binary.bzl", "native_binary")
@@ -164,16 +167,16 @@ native_binary(
164
167
name = "aws",
165
168
src = select(
166
169
{{
167
- "@bazel_tools//src/conditions:linux_x86_64": "@@ {0}_linux-x86_64//:aws",
168
- "@bazel_tools//src/conditions:linux_aarch64": "@@ {0}_linux-aarch64//:aws",
169
- "@bazel_tools//src/conditions:darwin_x86_64": "@@ {0}_darwin//:aws",
170
- "@bazel_tools//src/conditions:darwin_arm64": "@@ {0}_darwin//:aws",
170
+ "@bazel_tools//src/conditions:linux_x86_64": "{0}_linux-x86_64//:aws",
171
+ "@bazel_tools//src/conditions:linux_aarch64": "{0}_linux-aarch64//:aws",
172
+ "@bazel_tools//src/conditions:darwin_x86_64": "{0}_darwin//:aws",
173
+ "@bazel_tools//src/conditions:darwin_arm64": "{0}_darwin//:aws",
171
174
}},
172
175
),
173
176
out = "aws",
174
177
visibility = ["//visibility:public"],
175
178
)
176
- """ .format (rctx .name ))
179
+ """ .format (( "@@" if _is_bazel_6_or_greater () else "@" ) + rctx .name ))
177
180
178
181
aws_alias = repository_rule (
179
182
_aws_alias_impl ,
You can’t perform that action at this time.
0 commit comments