bazelbuild / bazel

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

Improve Errors for Transitive Rules #15791

Open aryeh-looker opened 2 years ago

aryeh-looker commented 2 years ago

Description of the feature request:

improve errors in transitive rules

what we get:

ERROR: /usr/local/google/home/aryehh/Development/cloud-spanner-emulator/binaries/BUILD:23:10: While resolving toolchains for target //binaries:emulator_main: invalid registered toolchain '@rules_foreign_cc//tools/build_defs/shell_toolchain/toolchains:linux_commands': error loading package '@rules_foreign_cc//tools/build_defs/shell_toolchain/toolchains': at /usr/local/google/home/aryehh/.cache/bazel/_bazel_aryehh/432487528c3e0374d8bae32ea74d9eb8/external/rules_foreign_cc/tools/build_defs/shell_toolchain/toolchains/defs.bzl:6:6: at /usr/local/google/home/aryehh/.cache/bazel/_bazel_aryehh/432487528c3e0374d8bae32ea74d9eb8/external/commands_overloads/toolchain_data_defs.bzl:3:6: compilation of module 'windows_commands.bzl' failed

what might be more ideal:

ERROR: /usr/local/google/home/aryehh/Development/cloud-spanner-emulator/binaries/BUILD:23:10: While resolving toolchains for target //binaries:emulator_main: invalid registered toolchain
  '@rules_foreign_cc//tools/build_defs/shell_toolchain/toolchains:linux_commands': error loading package 
    '@rules_foreign_cc//tools/build_defs/shell_toolchain/toolchains':
      at /usr/local/google/home/aryehh/.cache/bazel/_bazel_aryehh/432487528c3e0374d8bae32ea74d9eb8/external/rules_foreign_cc/tools/build_defs/shell_toolchain/toolchains/defs.bzl:6:6:
      at /usr/local/google/home/aryehh/.cache/bazel/_bazel_aryehh/432487528c3e0374d8bae32ea74d9eb8/external/commands_overloads/toolchain_data_defs.bzl:3:6: compilation of module 'windows_commands.bzl' failed

or something similar

What underlying problem are you trying to solve with this feature?

Understanding the dependency graph when an error in a rule happens

Which operating system are you running Bazel on?

glinux

What is the output of bazel info release?

release 5.2.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

Have you found anything relevant by searching the web?

No response

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

No response

aryeh-looker commented 2 years ago

Repro is to clone https://github.com/GoogleCloudPlatform/cloud-spanner-emulator and attempt to build with bazel 5.2.0

sgowroji commented 2 years ago

Hello @aryeh-looker, Thank you for providing the above details. Can you provide exact steps to reproduce the above errors. Thanks!

sgowroji commented 2 years ago

Hello @aryeh-looker, Could you please provide steps to reproduce the above errors. Thanks!

sgowroji commented 1 year ago

We are marking the above Issue as stale because it has not had any recent activity from many days. It will be closed in 7 days if there is no further activity occurs. Thank you.

sgowroji commented 1 year ago

Closing as it is stale. Please reach us back if you still looking resolution for the above request or open a new issue adding the above as reference.

fmeum commented 1 year ago

@sgowroji I think that this issue is still valid. It isn't tied to a particular project, it's just about better error messages. @gregestren who I think has an ongoing project for more beautiful error messages.

gregestren commented 1 year ago

See https://github.com/bazelbuild/bazel/issues/11984. Sadly prioritizing low for now...

github-actions[bot] commented 3 months ago

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.