bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23.21k stars 4.06k forks source link

Bazel 8.0.0rc2: autoload does not work with WORKSPACE repos #24235

Open gergelyfabian opened 3 hours ago

gergelyfabian commented 3 hours ago

Description of the bug:

Testing Bazel 8.0.0rc2 I got such an error:

$ bazel build //...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 94b17434-9dc8-4f06-8612-54cdc65e5c92
WARNING: WORKSPACE support will be removed in Bazel 9 (late 2025), please migrate to Bzlmod, see https://bazel.build/external/migration.
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.
WARNING: Couldn't auto load rules or symbols, because no dependency on module/repository 'rules_java' 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_python' 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_shell' found. This will result in a failure if there's a reference to those rules or symbols.
ERROR: /home/user/opt/bazel-scala-example/example-lib/BUILD:13:13: //example-lib:hello-world: no such attribute 'srcs' in 'java_library' rule
ERROR: /home/user/opt/bazel-scala-example/example-lib/BUILD:18:10: //example-lib:java_test: no such attribute 'test_class' in 'java_test' rule
ERROR: /home/user/opt/bazel-scala-example/example-lib/BUILD:18:10: //example-lib:java_test: no such attribute 'srcs' in 'java_test' rule
ERROR: /home/user/opt/bazel-scala-example/example-lib/BUILD:18:10: //example-lib:java_test: no such attribute 'deps' in 'java_test' rule
ERROR: package contains errors: example-lib
ERROR: package contains errors: example-lib: //example-lib:hello-world: no such attribute 'srcs' in 'java_library' rule
WARNING: Target pattern parsing failed.
ERROR: Skipping '//...': Error evaluating '//...': error loading package 'example-lib': Package 'example-lib' contains errors
ERROR: Error evaluating '//...': error loading package 'example-lib': Package 'example-lib' contains errors
INFO: Elapsed time: 2.845s
INFO: 0 processes.
ERROR: Build did NOT complete successfully

This worked with Bazel 7.3.2.

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.

Reproduction: https://github.com/gergelyfabian/bazel-scala-example/tree/bazel-8.0.0rc1

Simply run bazel build //... in this repo at branch bazel-8.0.0rc1

Which operating system are you running Bazel on?

Ubuntu 24.04

What is the output of bazel info release?

release 8.0.0rc2

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 ?

git@github.com:gergelyfabian/bazel-scala-example.git
b44d1811b34b69e28c30f99ec4b92c04b1ca93a5

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?

Related: https://github.com/bazelbuild/bazel/issues/23899

gergelyfabian commented 3 hours ago

Moved here after initial clarification in #23899

meteorcloudy commented 3 hours ago

@bazel-io fork 8.0.0