bazel icon indicating copy to clipboard operation
bazel copied to clipboard

WARNING: Couldn't auto load rules or symbols

Open criemen opened this issue 1 year ago • 2 comments
trafficstars

Description of the bug:

I've tried out 8.0.0rc1 on our codebase, and we're seeing

WARNING: Couldn't auto load rules or symbols, because no dependency on module/repository 'protobuf' found. This will result in a failure if there's a reference to those rules or symbols.
WARNING: Couldn't auto load rules or symbols, because no dependency on module/repository 'rules_android' found. This will result in a failure if there's a reference to those rules or symbols.

We're not actively using either of these rules in our codebase, but I wouldn't rule out that we have them as transitive dependencies in our dependency tree. We're using bzlmod, our WORKSPACE file exists and is empty.

How can we silence these warnings? They are not helpful for us, and I'd be reluctant to roll out this upgrade to our users, as they'll be confused by warnings that aren't actionable or relevant to them.

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.

No response

Which operating system are you running Bazel on?

macos

What is the output of bazel info release?

8.0.0rc1

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 HEAD ?

No response

If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

No response

Have you found anything relevant by searching the web?

No response

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

Slack discussion: https://bazelbuild.slack.com/archives/CA31HN1T3/p1728481396695989

criemen avatar Oct 09 '24 20:10 criemen

cc @comius

Wyverald avatar Oct 09 '24 20:10 Wyverald

You may silence the warning by removing rules_android and protobuf from incompatible_autoload_externally. At the moment that means setting it to „+@rules_java,+@rules_python,+@rules_shell“.

Futhermore if you have load statements for some of the remaining rules or if you’re not using them, you may also omit them from the flag.

comius avatar Oct 12 '24 08:10 comius

A fix for this issue has been included in Bazel 8.0.1 RC1. Please test out the release candidate and report any issues as soon as possible. If you're using Bazelisk, you can point to the latest RC by setting USE_BAZEL_VERSION=8.0.1rc1. Thanks!

iancha1992 avatar Jan 16 '25 07:01 iancha1992