Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.0.1] Forward @bazel_tools//tools/sh:toolchain_type to rules_shell #24793

Merged
merged 1 commit into from
Jan 2, 2025
Merged
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
1 change: 0 additions & 1 deletion scripts/bootstrap/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ EOF

# Create @bazel_tools//tools/sh
mkdir -p ${BAZEL_TOOLS_REPO}/tools/sh
link_file "${PWD}/tools/sh/sh_configure.bzl" "${BAZEL_TOOLS_REPO}/tools/sh/sh_configure.bzl"
link_file "${PWD}/tools/sh/sh_toolchain.bzl" "${BAZEL_TOOLS_REPO}/tools/sh/sh_toolchain.bzl"
link_file "${PWD}/tools/sh/BUILD.tools" "${BAZEL_TOOLS_REPO}/tools/sh/BUILD"

Expand Down
4 changes: 0 additions & 4 deletions src/MODULE.tools
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ use_repo(
"remote_java_tools_darwin_arm64",
)

sh_configure_extension = use_extension("//tools/sh:sh_configure.bzl", "sh_configure_extension")
use_repo(sh_configure_extension, "local_config_sh")
register_toolchains("@local_config_sh//:local_sh_toolchain")

remote_coverage_tools_extension = use_extension("//tools/test:extensions.bzl", "remote_coverage_tools_extension")
use_repo(remote_coverage_tools_extension, "remote_coverage_tools")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -807,12 +807,6 @@ def cc_configure(**kwargs):
""");

config.create("embedded_tools/tools/sh/BUILD");
config.create(
"embedded_tools/tools/sh/sh_configure.bzl",
"""
def sh_configure(**kwargs):
pass
""");
config.create("embedded_tools/tools/osx/BUILD");
config.create(
"embedded_tools/tools/osx/xcode_configure.bzl",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ private static void mockEmbeddedTools(Path embeddedBinaries) throws IOException
"def xcode_configure(*args, **kwargs):",
" pass");
FileSystemUtils.writeIsoLatin1(tools.getRelative("tools/sh/BUILD"), "");
FileSystemUtils.writeIsoLatin1(
tools.getRelative("tools/sh/sh_configure.bzl"),
"def sh_configure(*args, **kwargs):",
" pass");
FileSystemUtils.writeIsoLatin1(tools.getRelative("tools/build_defs/repo/BUILD"));
FileSystemUtils.writeIsoLatin1(
tools.getRelative("tools/build_defs/repo/http.bzl"),
Expand Down
1 change: 0 additions & 1 deletion tools/sh/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ filegroup(
name = "embedded_tools",
srcs = [
"BUILD.tools",
"sh_configure.bzl",
"sh_toolchain.bzl",
],
visibility = ["//tools:__pkg__"],
Expand Down
4 changes: 2 additions & 2 deletions tools/sh/BUILD.tools
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
exports_files([
"sh_toolchain.bzl",
"sh_configure.bzl",
])

toolchain_type(
alias(
name = "toolchain_type",
actual = "@rules_shell//shell:toolchain_type",
visibility = ["//visibility:public"],
)

Expand Down
90 changes: 0 additions & 90 deletions tools/sh/sh_configure.bzl

This file was deleted.

14 changes: 3 additions & 11 deletions tools/sh/sh_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Define a toolchain rule for the shell."""
"""Deprecated forwarders to rules_shell."""

def _sh_toolchain_impl(ctx):
"""sh_toolchain rule implementation."""
return [platform_common.ToolchainInfo(path = ctx.attr.path)]
load("@rules_shell//shell:sh_toolchain.bzl", _sh_toolchain = "sh_toolchain")

sh_toolchain = rule(
attrs = {
# Absolute path to the shell interpreter.
"path": attr.string(),
},
implementation = _sh_toolchain_impl,
)
sh_toolchain = _sh_toolchain
Loading