Repository navigation
ci(python): bundle third-party licenses in pyiceberg-core wheels - #3493
Conversation
4a82ec6 to
8631c28
Compare
| ignore-build-dependencies = true | ||
| ignore-dev-dependencies = true | ||
|
|
||
| # zstd-sys vendors zstd's C code (BSD-3-Clause, Meta) next to the Rust |
There was a problem hiding this comment.
zstd-sys always compiles zstd's core C library 😭
but these changes dont look so bad
|
cc @dannycjones @CTTY @blackmwk let me know what you think about this solution. I don't think we need to over index much on LICENSE and NOTICE. Including the dependencies in LICENSE (via |
blackmwk
left a comment
There was a problem hiding this comment.
Requesting changes for two attribution issues in 8631c28:
-
[P2] Preserve libm's attribution in the generated LICENSE. The new generation command succeeds with cargo-about 0.9.2 and
--fail, but the output forlibm 0.2.16containsCopyright (c) <year> <copyright holders>. It omits the actual notices for Jorge Aparicio, musl, and other contributors from libm's packagedLICENSE.txt. Please add a checksum-verified libm clarification preserving that license text and its notices. A temporary clarification pointing toLICENSE.txtwas tested and restored the missing notices. A focused check of the generated output would help catch this silent fallback. -
[P2] Keep a valid LICENSE for builds outside the release workflows. The new bindings/python/LICENSE is only a placeholder, while generation is confined to the release workflows. Running
maturin sdistdirectly succeeds and packages those four lines as the declared LICENSE. Local wheel builds and the Python PR CI workflow also bypass generation. Please retain a real Apache LICENSE in-tree, or integrate generation into the packaging process so these build paths cannot ship the placeholder. This confirms the existing Copilot comment.
Also, please treat #3495 as a merge prerequisite for the acknowledged zstd omission, or include the legacy notices here. At the reviewed commit, cargo tree still shows zstd-sys/legacy enabled, while the generated LICENSE omits its BSD-2 notices.
Validation: ran the pinned cargo-about 0.9.2 command, built and inspected an sdist with maturin 1.9.4, checked dependency features and upstream license files, and tested the libm clarification separately. The full wheel build matrix was not run.
dannycjones
left a comment
There was a problem hiding this comment.
Thanks Kevin, I appreciate that you want to reduce the amount of code we're burdened with maintaining. I think this is especially valuable given the bindings here are a bit niche within the wider iceberg-rust project.
The difference between this approach and the approach in my PR is that this one lacks the defensive checks against falling short of meeting the license obligations.
For example, Renjie's comment flags an unmet obligation for libm: #3493 (review)
There's obviously a big cost to maintaining the scripts around that (and I'd rather see them made upstream into cargo-about, which we could do over time), so I certainly understand and share your concern on that. My opinion here was to accept the cost of a more complex script that gives us more confidence that we're not going to find other licensing issues pop up later as our dependencies evolve, with the assumption that the script once written remains largely static.
Also noting: we don't block CI here on inability to generate the license attribution notices. We do have the nightly release but I imagine it isn't monitored. (I think this one is an easy fix?)
To try and reach consensus here: I am OK with taking a more hardcoded approach, and we track somewhere that this is the decision taken. I am happy to explore at a later date what checks we can upstream to cargo-about/cargo-deny from my original PR so that we get those for free later on, and slowly become less open to the risks I've been worried about.
|
I missed Renjie's comment on the other PR, sharing here. Renjie shares the concern that the maintenance cost is not worth it, so we should stick to the simpler solution. I'm OK to move forward with the simpler approach. |
6aa1013 to
e72b58b
Compare
e72b58b to
cf499cb
Compare
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
84b0100 to
9717e29
Compare
|
Hi, @kevinjqliu Do you think this is ready for review or you still need some refinement? |
kevinjqliu
left a comment
There was a problem hiding this comment.
I documented the changes in LICENSING.md
| with: | ||
| key: bindings-python | ||
| save-if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
| - uses: $/.github/actions/generate-python-license |
There was a problem hiding this comment.
on PR CI, check if cargo about can fail. this gives us a early and clear signal on any dependency changes
| uses: $/.github/actions/setup-builder | ||
| with: | ||
| rust-version: ${{ steps.get-msrv.outputs.msrv }} | ||
| - uses: $/.github/actions/generate-python-license |
There was a problem hiding this comment.
only run when building wheels
| @@ -0,0 +1,30 @@ | |||
| This package bundles the following Rust dependencies that ship their own NOTICE. | |||
There was a problem hiding this comment.
as mentioned in the pr description, this is manually maintained. i checked with my agent a couple of times.
i think this is good enough for now to unblock 0.11 release
| run: | | ||
| cargo about generate -c about.toml --locked --fail --manifest-path Cargo.toml about.hbs > third-party-licenses.txt | ||
| # Both are symlinks to the root files, remove them so the redirects don't write through. | ||
| rm LICENSE NOTICE |
There was a problem hiding this comment.
both bindings/python/LICENSE and https://github.com/apache/iceberg-rust/blob/ca21f1587c6caaeb88dd3a9e1cc245747e1aba08/bindings/python/NOTICE already exist and symlinks to the root LICENSE/NOTICE.
they are needed by the sdist.
During generation we need to remove them first in order to regenerate these files
| # Both are symlinks to the root files, remove them so the redirects don't write through. | ||
| rm LICENSE NOTICE | ||
| cat ../../LICENSE third-party-licenses.txt > LICENSE | ||
| { cat ../../NOTICE; echo; cat third-party-notices.txt; } > NOTICE |
There was a problem hiding this comment.
final NOTICE is root NOTICE + our hand written one in bindings/python/third-party-notices.txt
| cargo about generate -c about.toml --locked --fail --manifest-path Cargo.toml about.hbs > cargo-about-output.txt | ||
| # Both are symlinks to the root files, remove them so the redirects don't write through. | ||
| rm LICENSE NOTICE | ||
| cat ../../LICENSE cargo-about-output.txt third-party-licenses.txt > LICENSE |
There was a problem hiding this comment.
final LICENSE is root LICENSE + cargo about output + manual entries (third-party-licenses.txt)
There was a problem hiding this comment.
trying to describe most of the changes. I can also leave out this file and just move the content to the PR description
There was a problem hiding this comment.
We do need to keep this this, so we can understand how to maintain these.
| | xargs -I{} find {} -maxdepth 1 -iname 'NOTICE*' | ||
| ``` | ||
|
|
||
| ## Keeping entries up to date |
There was a problem hiding this comment.
maybe we can automate this, but for now i am happy with the current solution in order to unblock 0.11 release
|
@blackmwk @dannycjones mind giving this another look? i iterated on this a bunch, and i think this is the best i can do right now to balance release and maintenance. This can unblock us for now and we can iterate more after |
dannycjones
left a comment
There was a problem hiding this comment.
generally lgtm, I think the main thing is that we should ensure there's a step in the release guide to check licenses. it'll be a bit ambiguous for now, although I'm hoping there's a Magpie skill to help out here
There was a problem hiding this comment.
We do need to keep this this, so we can understand how to maintain these.
| The action is used in these workflows: | ||
|
|
||
| - [`release_python.yml`](../../.github/workflows/release_python.yml): the release wheels published to PyPI. | ||
| - [`release_python_nightly.yml`](../../.github/workflows/release_python_nightly.yml): the nightly wheels published to TestPyPI. | ||
| - [`bindings_python_ci.yml`](../../.github/workflows/bindings_python_ci.yml): pull requests. It only checks that generation doesn't fail. The generated files are not published. |
There was a problem hiding this comment.
nitpicky: we can just drop this, it is easy to find and this is easy to grow stale.
| run: | | ||
| cargo about generate -c about.toml --locked --fail --manifest-path Cargo.toml about.hbs > cargo-about-output.txt | ||
| # Both are symlinks to the root files, remove them so the redirects don't write through. | ||
| rm LICENSE NOTICE | ||
| cat ../../LICENSE cargo-about-output.txt third-party-licenses.txt > LICENSE | ||
| { cat ../../NOTICE; echo; cat third-party-notices.txt; } > NOTICE |
There was a problem hiding this comment.
My preference on GHA is to have as much logic as we can in Python scripts, so GHA is a thin orchestration layer installing dependencies and executing individual scripts which can be reproduced locally.
(I don't want to block on this, but I think this is the direction we should head.)
Co-authored-by: Copilot App <[email protected]>
blackmwk
left a comment
There was a problem hiding this comment.
Thanks @kevinjqliu for this pr, LGTM! Just one minor suggestion, not a blocker.
| # | ||
| # Accepted licenses must be ASF Category A or B: | ||
| # https://www.apache.org/legal/resolved.html | ||
| accepted = [ |
There was a problem hiding this comment.
nit: Could we have some way to check it's in sync with deny.toml?
There was a problem hiding this comment.
yea we can, I'll follow up and make more improvements to the process.
|
I think we can try this one again on the merge queue, now that the CI issue is resolved. |
|
This PR gets us the correct structure for the LICENSE and NOTICE files, and unblocks 0.11 release. I'll follow up to improve the process and make it easier to maintain |
This branch's bindings pull in iceberg-datafusion and iceberg-storage-opendal with opendal-all for the DataFusion table provider, so the wheel's crate graph is much wider than main's and cargo-about needs more than apache#3493 configured. - Accept bzip2-1.0.6 and, per-crate, MPL-2.0 for colored and option-ext. They arrive through opendal-all -> services-hf -> hf-xet -> xet-runtime and iceberg-datafusion -> async-compression -> bzip2. Without them generation fails and no wheel can be built. - Clarify aws-lc-sys, reached through opendal -> reqwest -> rustls -> aws-lc-rs. It ships every license it grants in one combined file, so cargo-about matched none of them and synthesized SPDX templates for three of the four, one with an empty copyright line. - Drop aarch64-pc-windows-msvc from targets; this branch builds no windows-arm wheel. The zstd-sys clarification is deliberately kept. It is redundant on main, which is on zstd-sys 2.1.2, but this branch pins 2.0.16 where removing it drops the Facebook and Meta notices. Co-authored-by: Danny C Jones <[email protected]>
This branch's bindings pull in iceberg-datafusion and iceberg-storage-opendal with opendal-all for the DataFusion table provider, so the wheel's crate graph is much wider than main's and cargo-about needs more than apache#3493 configured. - Accept bzip2-1.0.6 and, per-crate, MPL-2.0 for colored and option-ext. They arrive through opendal-all -> services-hf -> hf-xet -> xet-runtime and iceberg-datafusion -> async-compression -> bzip2. Without them generation fails and no wheel can be built. - Clarify aws-lc-sys, reached through opendal -> reqwest -> rustls -> aws-lc-rs. It ships every license it grants in one combined file, so cargo-about matched none of them and synthesized SPDX templates for three of the four, one with an empty copyright line. - Drop aarch64-pc-windows-msvc from targets; this branch builds no windows-arm wheel. The zstd-sys clarification is deliberately kept. It is redundant on main, which is on zstd-sys 2.1.2, but this branch pins 2.0.16 where removing it drops the Facebook and Meta notices. We use the 0.11.x convention on GitHub Actions composite actions as we've not updated Zizmor here. Co-authored-by: Danny C Jones <[email protected]>
Which issue does this PR close?
What changes are included in this PR?
The
pyiceberg-corewheels statically link ~280 Rust crates, but theLICENSEandNOTICEin the wheel only cover iceberg-rust. This adds the third-party licenses and notices too. A smaller alternative to #3380.Use
cargo aboutto generate the third-party licenses when building the wheels. Thegenerate-python-licenseaction combines the rootLICENSE, thecargo aboutoutput and a few manual entries. The sdist and the in-treeLICENSE/NOTICEsymlinks stay as is.Most of the details are in
bindings/python/LICENSING.md.This is purely mechanical to unblock the 0.11 release. The manual entries (
about.tomlclarifications andtargets,third-party-licenses.txt,third-party-notices.txt) don't update automatically. PR CI only checks that generation doesn't fail, so we need to check them by hand before every release.Also, proc-macro crates are over-listed since
cargo aboutcan't filter them.Are these changes tested?
Built the wheel locally and checked
dist-info/licenses/. PR CI also runs the action on Linux, macOS and Windows, with nocargo aboutwarnings.Here's what the generated
LICENSEandNOTICElook like.AI Disclosure
Written with Copilot (Claude). Please check the ASF policy reading (accepted licenses in
about.toml, NOTICE handling) and the manual entries. Not reviewed by ASF legal. The release and nightly workflows haven't run end to end, andwindows-11-armisn't covered by PR CI.