bazelbuild / rules_license

Apache License 2.0
80 stars 28 forks source link

rules_python is declared as a dev dependency but is an actual dependency #145

Open Zemnmez opened 3 months ago

Zemnmez commented 3 months ago

I tried to use the SBOM rule:

thomas@DESKTOP-B82ERE8:~/monorepo$ bazel build //project/zemn.me/public:sbom.txt
INFO: Invocation ID: 82643534-c719-4c97-8df4-8bd7a9caabd6
INFO: Streaming build results to: https://app.buildbuddy.io/invocation/82643534-c719-4c97-8df4-8bd7a9caabd6
ERROR: error loading package '@@rules_license~//tools': Unable to find package for @@[unknown repo 'rules_python' requested from @@rules_license~]//python:defs.bzl: The repository '@@[unknown repo 'rules_python' requested from @@rules_license~]' could not be resolved: No repository visible as '@rules_python' from repository '@@rules_license~'.
ERROR: /home/thomas/monorepo/project/zemn.me/public/BUILD.bazel:64:14: every rule of type _generate_sbom implicitly depends upon the target '@@rules_license~//tools:write_sbom', but this target could not be found because of: error loading package '@@rules_license~//tools': Unable to find package for @@[unknown repo 'rules_python' requested from @@rules_license~]//python:defs.bzl: The repository '@@[unknown repo 'rules_python' requested from @@rules_license~]' could not be resolved: No repository visible as '@rules_python' from repository '@@rules_license~'.
ERROR: Analysis of target '//project/zemn.me/public:sbom.txt' failed; build aborted: Analysis failed
INFO: Elapsed time: 1.134s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
INFO: Streaming build results to: https://app.buildbuddy.io/invocation/82643534-c719-4c97-8df4-8bd7a9caabd6
aiuto commented 3 months ago

The fix we would like to make is to split rules_license into two modules in the same repo. One with just the declarations and one with the tools. It will remain a dev dep for the license() and license_kind() rules, but a real dep for the tools.