Skip to content

Commit

Permalink
Add aarch64 to prebuild library constraints for macos (#1176)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmeijboom authored Mar 13, 2024
1 parent cecdab0 commit 86936d7
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 1 deletion.
57 changes: 57 additions & 0 deletions toolchains/prebuilt_toolchains.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -8301,6 +8301,20 @@ def _ninja_toolchains(version, register_toolchains):
),
)

maybe(
http_archive,
name = "ninja_1.11.1_mac_aarch64",
urls = [
"https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-mac.zip",
],
sha256 = "482ecb23c59ae3d4f158029112de172dd96bb0e97549c4b1ca32d8fad11f873e",
strip_prefix = "",
build_file_content = _NINJA_BUILD_FILE.format(
bin = "ninja",
env = "{\"NINJA\": \"$(execpath :ninja_bin)\"}",
),
)

maybe(
http_archive,
name = "ninja_1.11.1_win",
Expand Down Expand Up @@ -8328,6 +8342,10 @@ def _ninja_toolchains(version, register_toolchains):
"@platforms//cpu:x86_64",
"@platforms//os:macos",
],
"ninja_1.11.1_mac_aarch64": [
"@platforms//cpu:aarch64",
"@platforms//os:macos",
],
"ninja_1.11.1_win": [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
Expand All @@ -8340,6 +8358,7 @@ def _ninja_toolchains(version, register_toolchains):
native.register_toolchains(
"@ninja_1.11.1_toolchains//:ninja_1.11.1_linux_toolchain",
"@ninja_1.11.1_toolchains//:ninja_1.11.1_mac_toolchain",
"@ninja_1.11.1_toolchains//:ninja_1.11.1_mac_aarch64_toolchain",
"@ninja_1.11.1_toolchains//:ninja_1.11.1_win_toolchain",
)

Expand Down Expand Up @@ -8374,6 +8393,20 @@ def _ninja_toolchains(version, register_toolchains):
),
)

maybe(
http_archive,
name = "ninja_1.11.0_mac_aarch64",
urls = [
"https://github.com/ninja-build/ninja/releases/download/v1.11.0/ninja-mac.zip",
],
sha256 = "21915277db59756bfc61f6f281c1f5e3897760b63776fd3d360f77dd7364137f",
strip_prefix = "",
build_file_content = _NINJA_BUILD_FILE.format(
bin = "ninja",
env = "{\"NINJA\": \"$(execpath :ninja_bin)\"}",
),
)

maybe(
http_archive,
name = "ninja_1.11.0_win",
Expand Down Expand Up @@ -8401,6 +8434,10 @@ def _ninja_toolchains(version, register_toolchains):
"@platforms//cpu:x86_64",
"@platforms//os:macos",
],
"ninja_1.11.0_mac_aarch64": [
"@platforms//cpu:aarch64",
"@platforms//os:macos",
],
"ninja_1.11.0_win": [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
Expand All @@ -8413,6 +8450,7 @@ def _ninja_toolchains(version, register_toolchains):
native.register_toolchains(
"@ninja_1.11.0_toolchains//:ninja_1.11.0_linux_toolchain",
"@ninja_1.11.0_toolchains//:ninja_1.11.0_mac_toolchain",
"@ninja_1.11.0_toolchains//:ninja_1.11.0_mac_aarch64_toolchain",
"@ninja_1.11.0_toolchains//:ninja_1.11.0_win_toolchain",
)

Expand Down Expand Up @@ -8447,6 +8485,20 @@ def _ninja_toolchains(version, register_toolchains):
),
)

maybe(
http_archive,
name = "ninja_1.10.2_mac_aarch64",
urls = [
"https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-mac.zip",
],
sha256 = "6fa359f491fac7e5185273c6421a000eea6a2f0febf0ac03ac900bd4d80ed2a5",
strip_prefix = "",
build_file_content = _NINJA_BUILD_FILE.format(
bin = "ninja",
env = "{\"NINJA\": \"$(execpath :ninja_bin)\"}",
),
)

maybe(
http_archive,
name = "ninja_1.10.2_win",
Expand Down Expand Up @@ -8474,6 +8526,10 @@ def _ninja_toolchains(version, register_toolchains):
"@platforms//cpu:x86_64",
"@platforms//os:macos",
],
"ninja_1.10.2_mac_aarch64": [
"@platforms//cpu:aarch64",
"@platforms//os:macos",
],
"ninja_1.10.2_win": [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
Expand All @@ -8486,6 +8542,7 @@ def _ninja_toolchains(version, register_toolchains):
native.register_toolchains(
"@ninja_1.10.2_toolchains//:ninja_1.10.2_linux_toolchain",
"@ninja_1.10.2_toolchains//:ninja_1.10.2_mac_toolchain",
"@ninja_1.10.2_toolchains//:ninja_1.10.2_mac_aarch64_toolchain",
"@ninja_1.10.2_toolchains//:ninja_1.10.2_win_toolchain",
)

Expand Down
10 changes: 9 additions & 1 deletion toolchains/prebuilt_toolchains.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@
"@platforms//cpu:x86_64",
"@platforms//os:macos",
],
"mac_aarch64": [
"@platforms//cpu:aarch64",
"@platforms//os:macos",
],
"win": [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
Expand Down Expand Up @@ -418,13 +422,17 @@ def get_ninja_definitions() -> str:

for version in NINJA_VERSIONS:

supports_mac_universal = not version in ["1.8.2", "1.9.0", "1.10.0", "1.10.1"]
version_archives = []
version_toolchains = {}

for target in NINJA_TARGETS.keys():
if not supports_mac_universal and target == "mac_aarch64":
continue

url = NINJA_URL_TEMPLATE.format(
full=version,
target=target,
target="mac" if target == "mac_aarch64" else target,
)

# Get sha256 (can be slow)
Expand Down

0 comments on commit 86936d7

Please sign in to comment.