Skip to content

Commit

Permalink
Add a jq version for arm64
Browse files Browse the repository at this point in the history
Closes bazelbuild#18444.

PiperOrigin-RevId: 642659695
Change-Id: I97f2c2a20a8dd7a3958e6d814475395a2802dc70
  • Loading branch information
fmeum authored and bazel-io committed Jun 12, 2024
1 parent 54fe273 commit b8e043e
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 13 deletions.
16 changes: 15 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -309,21 +309,35 @@ use_repo(gvm, "graalvm_toolchains")

http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")

# DO NOT UPDATE the jq version, this is used to verify compatibility with old versions.
# DO NOT UPDATE the jq versions, they are used to verify compatibility with old and new versions.
http_file(
name = "jq_linux_amd64",
executable = True,
integrity = "sha256-xrOn19PntwxvUbcGo7kL0BgzhGxU0yyjLwAn8AIm/20=",
urls = ["https://github.com/jqlang/jq/releases/download/jq-1.5/jq-linux64"],
)

http_file(
name = "jq_linux_arm64",
executable = True,
integrity = "sha256-TdLYoGYd8LIvG7mh+YMPBrbzuPfZEhGh7118TwaotKU=",
urls = ["https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-arm64"],
)

http_file(
name = "jq_macos_amd64",
executable = True,
integrity = "sha256-OG6SyYKlb+SFFGjXqTHfyilWDO4wag5mxqG9QGXT2sU=",
urls = ["https://github.com/jqlang/jq/releases/download/jq-1.5/jq-osx-amd64"],
)

http_file(
name = "jq_macos_arm64",
executable = True,
integrity = "sha256-C75hnmY+DeLFUL4v4NJA0HZ5nW+KZStw+gSuqKg2Loo=",
urls = ["https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-macos-arm64"],
)

http_file(
name = "jq_windows_amd64",
executable = True,
Expand Down
56 changes: 46 additions & 10 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 18 additions & 2 deletions scripts/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,27 @@ sh_test(
],
)

filegroup(
name = "jq_linux",
srcs = select({
"@platforms//cpu:arm64": ["@jq_linux_arm64//file"],
"@platforms//cpu:x86_64": ["@jq_linux_amd64//file"],
}),
)

filegroup(
name = "jq_macos",
srcs = select({
"@platforms//cpu:arm64": ["@jq_macos_arm64//file"],
"@platforms//cpu:x86_64": ["@jq_macos_amd64//file"],
}),
)

filegroup(
name = "jq",
srcs = select({
"@platforms//os:linux": ["@jq_linux_amd64//file"],
"@platforms//os:macos": ["@jq_macos_amd64//file"],
"@platforms//os:linux": [":jq_linux"],
"@platforms//os:macos": [":jq_macos"],
"@platforms//os:windows": ["@jq_windows_amd64//file"],
}),
)
Expand Down

0 comments on commit b8e043e

Please sign in to comment.