bazelbuild / bazelbuild/rules_rust

Provide rules_license metadata in crate BUILD files

Open
#2,475 2 comments 0 reactions 0 assignees View on GitHub
crate-universe enhancement needs-triage
Dominant language
Starlark
Stars
843
Forks
651
Avg merge
2d 18h
Merged PRs (30d)
15

Description

Please provide an option to include rules_license metadata when rendering crate BUILD files.

- [package_info](https://bazelbuild.github.io/rules_license/latest.html#package_info)
- [license](https://bazelbuild.github.io/rules_license/latest.html#license)

For example the BUILD file for the [rand](https://crates.io/crates/rand) crate would include

...

load("@rules_license//rules:package_info.bzl", "package_info")

load("@rules_license//rules:license.bzl", "license")

package(
default_package_metadata = [
":license",
":package_info",
],
default_visibility = ["//visibility:public"],
)

package_info(
name = "package_info",
package_name = "rand",
package_version = "0.8.5",
package_url = "https://github.com/rust-random/rand",
)

license(
name = "license",
license_kinds = [
"@rules_license//licenses/spdx:Apache-2.0",
"@rules_license//licenses/spdx:MIT",
],
)

...

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.