Skip to content

Commit 3e48adb

Browse files
committed
fixup! skip macOS-only archive rules on unsupported platforms
1 parent 2214de1 commit 3e48adb

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

common/private/dmg_archive.bzl

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
def _dmg_archive_impl(repository_ctx):
2-
hdiutil = repository_ctx.which("hdiutil")
3-
if not hdiutil:
4-
# Create BUILD with expected targets so queries succeed; builds will fail with missing files
5-
repository_ctx.file("BUILD.bazel", repository_ctx.attr.build_file_content)
2+
repository_ctx.file("BUILD.bazel", repository_ctx.attr.build_file_content)
3+
4+
if not repository_ctx.which("hdiutil"):
5+
# hdiutil is macOS-only; skip download on other platforms
66
return
77

88
url = repository_ctx.attr.url
@@ -33,11 +33,6 @@ def _dmg_archive_impl(repository_ctx):
3333
output = repository_ctx.attr.output,
3434
)
3535

36-
repository_ctx.file(
37-
"BUILD.bazel",
38-
repository_ctx.attr.build_file_content,
39-
)
40-
4136
dmg_archive = repository_rule(
4237
_dmg_archive_impl,
4338
attrs = {

common/private/pkg_archive.bzl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
def _pkg_archive_impl(repository_ctx):
2-
pkgutil = repository_ctx.which("pkgutil")
3-
if not pkgutil:
4-
# Create BUILD with expected targets so queries succeed; builds will fail with missing files
5-
repository_ctx.file("BUILD.bazel", repository_ctx.attr.build_file_content)
2+
repository_ctx.file("BUILD.bazel", repository_ctx.attr.build_file_content)
3+
4+
if not repository_ctx.which("pkgutil"):
5+
# pkgutil is macOS-only; skip download on other platforms
66
return
77

88
url = repository_ctx.attr.url
@@ -33,8 +33,6 @@ def _pkg_archive_impl(repository_ctx):
3333
for (key, value) in repository_ctx.attr.move.items():
3434
repository_ctx.execute(["mv", pkg_name + "/" + key, value])
3535

36-
repository_ctx.file("BUILD.bazel", repository_ctx.attr.build_file_content)
37-
3836
pkg_archive = repository_rule(
3937
_pkg_archive_impl,
4038
attrs = {

0 commit comments

Comments
 (0)