Skip to content

Commit f30b1a3

Browse files
committed
Add more ISPC versions
GitOrigin-RevId: f202018ae6038b4f7587e912c4193f3a729a6905
1 parent b6ce187 commit f30b1a3

3 files changed

Lines changed: 60 additions & 11 deletions

File tree

extensions.bzl

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
load("//:fetch_ispc.bzl", "fetch_ispc")
22

3-
def _ispc_impl(ctx):
4-
# Get version from the first download tag, default to "1.22.0" for backward compatibility
5-
version = "1.22.0"
6-
for mod in ctx.modules:
7-
for download_tag in mod.tags.download:
8-
if download_tag.version:
9-
version = download_tag.version
10-
break
11-
3+
def _ispc_impl(module_ctx):
4+
version = "1.22.0" # Default version
5+
6+
# Extract version from download tags
7+
found_proper_version = False
8+
for module in module_ctx.modules:
9+
for download_tag in module.tags.download:
10+
version = download_tag.version
11+
print("Fetching ISPC version: {}".format(version))
12+
found_proper_version = True
13+
break
14+
if found_proper_version:
15+
break
16+
1217
fetch_ispc(version = version)
1318

1419
_download = tag_class(

fetch_ispc.bzl

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,50 @@ _ISPC_VERSIONS = {
4848
"strip_prefix": "ispc-v1.23.0-macOS.arm64",
4949
},
5050
},
51+
"1.28.0": {
52+
"linux": {
53+
"url": "https://github.com/ispc/ispc/releases/download/v1.28.0/ispc-v1.28.0-linux.tar.gz",
54+
"sha256": "993ecc5b3d9b72a2dfa6ec96362a80a92ed4e1c4858d41dcab74cc9d64f9d3aa",
55+
"strip_prefix": "ispc-v1.28.0-linux",
56+
},
57+
"windows": {
58+
"url": "https://github.com/ispc/ispc/releases/download/v1.28.0/ispc-v1.28.0-windows.zip",
59+
"sha256": "727369f4477ea312bc9ab1b92911d7247a03ffaf83f39030d8d3e5fab08712ca",
60+
"strip_prefix": "ispc-v1.28.0-windows",
61+
},
62+
"osx_x86_64": {
63+
"url": "https://github.com/ispc/ispc/releases/download/v1.28.0/ispc-v1.28.0-macOS.x86_64.tar.gz",
64+
"sha256": "8ac7285bc6a7d7162289cbe175e6fd01a466be5f5136a2e66c05afa9a07bb657",
65+
"strip_prefix": "ispc-v1.28.0-macOS.x86_64",
66+
},
67+
"osx_arm64": {
68+
"url": "https://github.com/ispc/ispc/releases/download/v1.28.0/ispc-v1.28.0-macOS.arm64.tar.gz",
69+
"sha256": "741664b2edae3fcf94b38985e5cf5f18ad19a393f7e745577bdfe29d50ca6dd6",
70+
"strip_prefix": "ispc-v1.28.0-macOS.arm64",
71+
},
72+
},
73+
"1.28.1": {
74+
"linux": {
75+
"url": "https://github.com/ispc/ispc/releases/download/v1.28.1/ispc-v1.28.1-linux.tar.gz",
76+
"sha256": "00697aadb6e41e01568c9ef75446a0d3074ca05292c35c359f98a8fd27758791",
77+
"strip_prefix": "ispc-v1.28.1-linux",
78+
},
79+
"windows": {
80+
"url": "https://github.com/ispc/ispc/releases/download/v1.28.1/ispc-v1.28.1-windows.zip",
81+
"sha256": "230f0b1beeb333dc1e9fcdbac759869b362aab94db2285486ae6526d9160c52c",
82+
"strip_prefix": "ispc-v1.28.1-windows",
83+
},
84+
"osx_x86_64": {
85+
"url": "https://github.com/ispc/ispc/releases/download/v1.28.1/ispc-v1.28.1-macOS.x86_64.tar.gz",
86+
"sha256": "8c7fe14a3cc3ccc7f2b0717f00107a452cdfc2d68614ee986ed69a6f45e1a1c0",
87+
"strip_prefix": "ispc-v1.28.1-macOS.x86_64",
88+
},
89+
"osx_arm64": {
90+
"url": "https://github.com/ispc/ispc/releases/download/v1.28.1/ispc-v1.28.1-macOS.arm64.tar.gz",
91+
"sha256": "6a07c9087ae1d7fd41e785d9eafd6fd8cfa08d1354292df22ee003893ea48f64",
92+
"strip_prefix": "ispc-v1.28.1-macOS.arm64",
93+
},
94+
},
5195
"1.28.2": {
5296
"linux": {
5397
"url": "https://github.com/ispc/ispc/releases/download/v1.28.2/ispc-v1.28.2-linux.tar.gz",
@@ -76,7 +120,7 @@ def fetch_ispc(version = "1.22.0"):
76120
"""Fetches the remote prebuilt ISPC compiler for the specified version.
77121
78122
Args:
79-
version: ISPC version to download. Supported versions: 1.22.0, 1.23.0.
123+
version: ISPC version to download. Supported versions: 1.22.0, 1.23.0, 1.28.0, 1.28.1, 1.28.2.
80124
Defaults to 1.22.0 for backward compatibility.
81125
"""
82126

tests/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ local_path_override(
99
)
1010

1111
ispc = use_extension("@rules_ispc//:extensions.bzl", "ispc")
12-
ispc.download(version = "1.28.2")
12+
ispc.download(version = "1.28.0")
1313

1414
use_repo(
1515
ispc,

0 commit comments

Comments
 (0)