Plan to remove `output_licenses` as a global attribute
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
`output_licenses` is only used by deprecated license checking code that only Google uses internally.
We can remove it in a straightforward manor.
Old use case:
IFF --check_licenses was enabled
- Bazel would collect `licenses` and `output_licenses` attributes from the dependency graph
- this was done bottom up, like an aspect
- `licenses` would add to a set at that target node
- `output_licenses` would replace the set at that target node
Strawman replacement:
`output_licenses = ["notice"]`
becomes
`package_metadata = ["@rules_license://licenses/legacy:notice", "@rules_license//tools:override"]`
While running an SBOM or other aspect over the graph, when we hit a target that has a special provider of the type used by `@rules_license//tools:override` we replace the set of gathered providers from deps instead of adding to the set.
There are other ways to slice this.
While this is to some extent a Google internal change, we can do much of it from the Bazel side. The work probably belongs in rules/supply_chain.
cc: @Yannic @fweikert @mzeren-vmw @aiuto
Contributor guide
Assessment
This issue has not been assessed yet.