[llvm] [bazel] Add rules_shell for sh_binary rule (PR #158365)
Keith Smiley via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 12 13:56:16 PDT 2025
https://github.com/keith created https://github.com/llvm/llvm-project/pull/158365
This is required for the upcoming bazel 9.x release where this rule is
no longer automatically available.
>From a43e392914928f6fd3f286c48f45ae20ea16fb70 Mon Sep 17 00:00:00 2001
From: Keith Smiley <keithbsmiley at gmail.com>
Date: Fri, 12 Sep 2025 20:51:27 +0000
Subject: [PATCH] [bazel] Add rules_shell for sh_binary rule
This is required for the upcoming bazel 9.x release where this rule is
no longer automatically available.
---
utils/bazel/WORKSPACE | 14 ++++++++++++++
utils/bazel/llvm-project-overlay/llvm/BUILD.bazel | 1 +
2 files changed, 15 insertions(+)
diff --git a/utils/bazel/WORKSPACE b/utils/bazel/WORKSPACE
index da69e1d7cf5a7..00cfea572096a 100644
--- a/utils/bazel/WORKSPACE
+++ b/utils/bazel/WORKSPACE
@@ -199,3 +199,17 @@ python_register_toolchains(
name = "python_3_12",
python_version = "3.12",
)
+
+maybe(
+ http_archive,
+ name = "rules_shell",
+ sha256 = "e6b87c89bd0b27039e3af2c5da01147452f240f75d505f5b6880874f31036307",
+ strip_prefix = "rules_shell-0.6.1",
+ url = "https://github.com/bazelbuild/rules_shell/releases/download/v0.6.1/rules_shell-v0.6.1.tar.gz",
+)
+
+load("@rules_shell//shell:repositories.bzl", "rules_shell_dependencies", "rules_shell_toolchains")
+
+rules_shell_dependencies()
+
+rules_shell_toolchains()
diff --git a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
index e6f10b08932e5..8fe8258d72e34 100644
--- a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
@@ -6,6 +6,7 @@ load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
load("@rules_python//python:defs.bzl", "py_binary")
+load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
load("//mlir:tblgen.bzl", "gentbl_cc_library", "gentbl_filegroup", "td_library")
load(":binary_alias.bzl", "binary_alias")
load(":config.bzl", "llvm_config_defines")
More information about the llvm-commits
mailing list