Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
# Keep versions in sync with the local install targets in Makefile.
uses: taiki-e/install-action@d438492cf8a250514fa2d34b30bc3c0dc37c65ff # v2.87.8
with:
tool: taplo@0.9.3,cargo-machete@0.7.0
tool: taplo@0.9.3,cargo-machete@0.7.0,cargo-deny@0.19.9

Copy link
Copy Markdown
Contributor

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 😄


- name: Check License Header
uses: apache/skywalking-eyes/header@a196742f472feaffafea537ce5a2a4c3c53a8de4 # v0.9.0
Expand All @@ -79,6 +79,9 @@ jobs:
- name: Check crates package LICENSE and NOTICE
run: make check-license-notice

- name: Check dependency licenses
run: dev/release/dependencies.sh check

# Trusted publishing cannot create a crate (https://crates.io/docs/trusted-publishing),
# so a new publishable crate must be reserved on crates.io before it is merged.
# See "Adding a new crate" in website/src/release.md.
Expand Down
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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).
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,15 @@ check-public-api: install-cargo-public-api
check-license-notice:
bash ./dev/check_license_notice.sh

check: check-fmt check-clippy check-toml cargo-machete check-license-notice
# Keep version in sync with the CI lint install step in .github/workflows/ci.yml
# and EXPECTED_CARGO_DENY_VERSION in dev/release/dependencies.sh.
install-cargo-deny:
cargo install --locked cargo-deny@0.19.9

check-dependency-licenses: install-cargo-deny
bash ./dev/release/dependencies.sh check

check: check-fmt check-clippy check-toml cargo-machete check-license-notice check-dependency-licenses

doc-test:
cargo test --no-fail-fast --doc --all-features --workspace
Expand Down
5 changes: 4 additions & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch - I do think we need this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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",
Expand All @@ -26,7 +30,6 @@ allow = [
"CC0-1.0",
"Zlib",
"CDLA-Permissive-2.0",
"bzip2-1.0.6",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is flagged by my agent: removing bzip2-1.0.6 since nothing uses it anymore.

cargo deny flags it as license-not-encountered even with all-features, and there's no bzip2 crate in Cargo.lock. looks like it was added back in the 0.8.0 bump (#1938) for a dep we've since dropped. if it comes back, the check will fail and we can re-add it then.

# Category-A: https://issues.apache.org/jira/browse/LEGAL-660
"Unicode-3.0",
# Boost Software License Version 1.0 is allowed (Category-A):
Expand Down
2 changes: 1 addition & 1 deletion dev/release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Defaults:
`--check_deps 1` requires `cargo-deny`. Install it with:

```shell
cargo install --locked cargo-deny
make install-cargo-deny
```

`--check_publish 1` runs `cargo publish --workspace --dry-run`, which packages and compiles every crate and needs network access to crates.io.
Expand Down
17 changes: 1 addition & 16 deletions dev/release/create_rc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the same script for create_rc.sh

}

# Packages and builds every crate as `cargo publish` would, without uploading,
Expand Down
3 changes: 2 additions & 1 deletion dev/release/dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ if [ "${BASH_VERSINFO[0]}" -lt 4 ]; then
echo "Warning: bash ${BASH_VERSION} will not print which step failed. Use bash 4 or newer to see it." >&2
fi

# Keep this in sync with CARGO_DENY_VERSION in .github/workflows/dependencies.yml.
# Keep this in sync with the cargo-deny version in the CI lint install step in
# .github/workflows/ci.yml and the install-cargo-deny target in Makefile.
# The generated DEPENDENCIES.rust.tsv files are version-sensitive, so the local
# cargo-deny must match the version CI uses to avoid spurious diffs.
EXPECTED_CARGO_DENY_VERSION="0.19.9"
Expand Down
2 changes: 1 addition & 1 deletion website/src/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The RC creation script requires a local GPG secret key when artifact signing or

Install the release tooling used by the local scripts:

- `cargo-deny`
- `cargo-deny` (`make install-cargo-deny`)
- `docker`
- `gpg`
- `svn`
Expand Down
Loading