Skip to content
This repository was archived by the owner on Apr 29, 2025. It is now read-only.
This repository was archived by the owner on Apr 29, 2025. It is now read-only.

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

@dstu

Description

@dstu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions