Skip to content

tools/bazel detection is broken with bzlmod repos #20509

@siddharthab

Description

@siddharthab

Description of the bug:

Bazel's launcher script checks for only WORKSPACE and WORKSPACE.bazel files, and not MODULE.bazel, so the workspace is not detected as a workspace, and hence, a tools/bazel file is not picked up from the workspace.

Which category does this issue belong to?

No response

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

In any bazel workspace with bzlmod enabled:

  1. Delete WORKSPACE and WORKSPACE.bazel files if any.
  2. Write a tools/bazel file that prints something before running bazel with all passed arguments.
  3. Run any bazel command; notice that tools/bazel is not being run.

Which operating system are you running Bazel on?

Linux

What is the output of bazel info release?

release 7.0.0

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    team-OSSIssues for the Bazel OSS team: installation, release processBazel packaging, websitetype: buguntriaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions