bazel_rules_install icon indicating copy to clipboard operation
bazel_rules_install copied to clipboard

Apparent breakage under Bazel 7 due to removal of @bazel_tools//platforms

Open dstu opened this issue 1 year ago • 0 comments

Under Bazel 7.4.0, I get the following error when trying to run an installer target:

ERROR: no such package '@@bazel_tools//platforms': BUILD file not found in directory 'platforms' of external repository @@bazel_tools. Add a BUILD file to a directory to mark it as a package.
ERROR: /home/stu/.cache/bazel/_bazel_stu/4cc6ed521651214c33821daa1cfcef3c/external/bazel_skylib/toolchains/unittest/BUILD:22:10: no such package '@@bazel_tools//platforms': BUILD file not found in directory 'platforms' of external repository @@bazel_tools. Add a BUILD file to a directory to mark it as a package. and referenced by '@@bazel_skylib//toolchains/unittest:cmd_toolchain'

This may be due to changes in how platforms are provided for Bazel 7 (no longer available in bazel_tools: https://stackoverflow.com/questions/77599514/no-such-package-bazel-tools-platforms-when-building-with-bazel).

A minimal repo that reproduces this may be found here: https://github.com/dstu/bazel_installer_test. (Try running bazel run :install_hello_world -- ~/tmp or similar.)

If I run with an older version of Bazel (like bazel-5.0.0, which I happen to have on this system already), the :install_hello_world target runs correctly.

dstu avatar Nov 13 '24 04:11 dstu