rules_license icon indicating copy to clipboard operation
rules_license copied to clipboard

Create ADD_PKG_MGR.md

Open alexeagle opened this issue 10 months ago • 4 comments

Allows package manager implementations like rules_jvm_external to begin declaring the licenses or other metadata about third-party packages they fetch and add to the dependency graph.

Needs some discussion with @mzeren-vmw about whether this is the shape we want to commit to, vs. having a package_info rule as well.

alexeagle avatar Apr 22 '24 16:04 alexeagle

See also: https://github.com/bazelbuild/bazel/issues/22403, which asks for a way of attaching license info to a specific target (which we will need for rules_jvm_external)

shs96c avatar May 16 '24 16:05 shs96c

See also: bazelbuild/bazel#22403, which asks for a way of attaching license info to a specific target (which we will need for rules_jvm_external)

Does rules_jvm_external combine multiple distinct modules into a single BULD file?

aiuto avatar May 17 '24 02:05 aiuto

We can declare multiple java_export targets, each with potentially different licenses and PackageInfo, in a single build file.

shs96c avatar Jul 21 '24 08:07 shs96c

Having now implemented this for rules_jvm_external in https://github.com/bazelbuild/rules_jvm_external/pull/1232, I think that this PR needs to highlight some changes.

  1. Rules controlled by a ruleset can (and likely should) return a PackageInfo directly. Other mechanisms are unnecessary indirection, and this also allows user configured rules (java_export in the case of rules_jvm_external) to also participate in providing information.
  2. Attaching a custom PackageInfo via the package_info rule also works, but can create a proliferation of additional targets, just to create the PackageInfo provider.
  3. In many cases, a global license info or PackageInfo is not going to be very useful, since third party deps likely have many different licenses.

shs96c avatar Sep 09 '24 08:09 shs96c