Repository navigation
ci: check dependency licenses with cargo-deny on every PR #3293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,6 +118,14 @@ tested in CI and developers have reproducible builds. | |
| In `Cargo.toml`, we specify the minimum version required to use iceberg-rust. This allows users to choose their | ||
| dependency versions without always upgrading to the latest. | ||
|
|
||
| Dependency licenses must comply with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html). | ||
| CI checks them against `deny.toml` with `cargo deny`; run `make check-dependency-licenses` to check locally. If a | ||
| license is rejected, find its category in the policy: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. keeping this part concise |
||
|
|
||
| - Category A: add the license to `allow`. | ||
| - Category B: add a per-crate entry to `exceptions`. | ||
| - Category X: not allowed by ASF policy; do not take the dependency. | ||
|
|
||
| ## Code of Conduct | ||
|
|
||
| We expect all community members to follow our [Code of Conduct](https://www.apache.org/foundation/policies/conduct.html). | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,10 @@ | |
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| [graph] | ||
| # Include dependencies from optional features. | ||
| all-features = true | ||
|
Comment on lines
+18
to
+20
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch - I do think we need this.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💯 ty for this! i didn't know about this option. |
||
|
|
||
| [licenses] | ||
| allow = [ | ||
| "Apache-2.0", | ||
|
|
@@ -26,7 +30,6 @@ allow = [ | |
| "CC0-1.0", | ||
| "Zlib", | ||
| "CDLA-Permissive-2.0", | ||
| "bzip2-1.0.6", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is flagged by my agent: removing cargo deny flags it as |
||
| # Category-A: https://issues.apache.org/jira/browse/LEGAL-660 | ||
| "Unicode-3.0", | ||
| # Boost Software License Version 1.0 is allowed (Category-A): | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -157,16 +157,6 @@ require_checksum_command() { | |
| fi | ||
| } | ||
|
|
||
| require_cargo_deny() { | ||
| require_command cargo | ||
| if ! cargo deny --version >/dev/null 2>&1; then | ||
| echo "This step requires 'cargo-deny' for dependency license checks." >&2 | ||
| echo "Install it with: cargo install --locked cargo-deny" >&2 | ||
| echo "To skip this step locally, pass: --check_deps 0" >&2 | ||
| return 1 | ||
| fi | ||
| } | ||
|
|
||
| require_gpg_secret_key() { | ||
| require_command gpg | ||
| if ! gpg --list-secret-keys --with-colons 2>/dev/null | grep -q '^sec'; then | ||
|
|
@@ -317,12 +307,7 @@ check_rc_tag_available() { | |
| } | ||
|
|
||
| check_dependency_licenses() { | ||
| require_cargo_deny | ||
| ( | ||
| trap - ERR | ||
| cd "${REPO_ROOT}" | ||
| cargo deny check license | ||
| ) | ||
| "${SCRIPT_DIR}/dependencies.sh" check | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use the same script for |
||
| } | ||
|
|
||
| # Packages and builds every crate as `cargo publish` would, without uploading, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we might be able to get rid of the "keep versions in sync" pattern, now that we have
make install-*in Makefile.this can be a follow up 😄