Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bazel_dep(name = "bazel_features", version = "1.11.0")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "platforms", version = "0.0.10")

bazel_dep(name = "buildifier_prebuilt", version = "7.3.1", dev_dependency = True)
bazel_dep(name = "buildifier_prebuilt", version = "8.2.1.1", dev_dependency = True)

# ensure toolchains get registered
multitool = use_extension("//multitool:extension.bzl", "multitool")
Expand Down
2 changes: 2 additions & 0 deletions examples/workspace/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_shell//shell:sh_test.bzl", "sh_test")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore workspace example by defining @rules_shell

In the WORKSPACE-based example, @rules_shell is never declared (checked examples/workspace/WORKSPACE.bazel), so adding load("@rules_shell//shell:sh_test.bzl", "sh_test") will make bazel test //:integration_test fail with an unresolved repository error. The previous usage relied on the native sh_test without any external repo. Either add a rules_shell repository to the workspace example or drop this load and use the native rule again.

Useful? React with 👍 / 👎.


sh_test(
name = "integration_test",
srcs = ["integration_test.sh"],
Expand Down
2 changes: 1 addition & 1 deletion lockfile.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"enum": ["macos", "linux", "windows"]
},
"supported_cpu": {
"enum": ["x86_64", "arm64"]
"enum": ["x86_64", "arm64", "riscv64"]
},
"file_type": {
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def _toolchain_info_impl(ctx):
toolchain_info = rule(
attrs = dict(
executable = attr.label(allow_single_file = True),
cpu = attr.string(mandatory = True, values = ["arm64", "x86_64"]),
cpu = attr.string(mandatory = True, values = ["arm64", "x86_64", "riscv64"]),
os = attr.string(mandatory = True, values = ["linux", "macos", "windows"]),
ext = attr.string(mandatory = True, values = ["", ".exe"]),
),
Expand Down
2 changes: 1 addition & 1 deletion multitool/private/lockfile.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _load(ctx, lockfiles):
),
)
_check(
binary["cpu"] in ["x86_64", "arm64"],
binary["cpu"] in ["x86_64", "arm64", "riscv64"],
"{tool_name}: Unknown cpu '{cpu}'".format(
tool_name = tool_name,
cpu = binary["cpu"],
Expand Down
1 change: 1 addition & 0 deletions multitool/private/templates.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ _TOOL_TOOL_TEMPLATE = "//multitool/private:tool_repo_tool_template/{filename}.te
# map from HOST_CONSTRAINTS to supported_os and supported_cpu from lockfile.schema.json
_HOST_CONSTRAINTS_MAPPING = {
"@platforms//cpu:aarch64": "arm64",
"@platforms//cpu:riscv64": "riscv64",
"@platforms//cpu:x86_64": "x86_64",
"@platforms//os:osx": "macos",
"@platforms//os:linux": "linux",
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Define a [lockfile](lockfile.schema.json) that references the tools to load:
"url": "https://...",
"sha256": "sha256 of the file",
"os": "linux|macos|windows",
"cpu": "x86_64|arm64"
"cpu": "x86_64|arm64|riscv64"
}
]
}
Expand Down