[700] Ship a license text for every bundled non-Apache-2.0 dependency - #885
Closed
vinishjail97 wants to merge 1 commit into
Closed
[700] Ship a license text for every bundled non-Apache-2.0 dependency#885vinishjail97 wants to merge 1 commit into
vinishjail97 wants to merge 1 commit into
Conversation
Adds the missing texts and enforces the invariant from the LICENSE-bundled banner -- "See licenses/ for text of these licenses" -- against the built jar rather than the poms. release/scripts/validate_bundled_license_texts.py reads each *-bundled.jar, takes the coordinate listing the jar carries in META-INF/LICENSE, confirms each non-Apache-2.0 coordinate's classes are genuinely present, and requires META-INF/licenses/LICENSE-<artifactId>. The reverse direction is checked too, so a text with no bundled dependency behind it fails. The published artifact is the only thing that settles what is bundled, and it is what a release reviewer inspects. Before this change the jars carried texts for 3 of 5 non-Apache-2.0 dependencies in xtable-aws and 3 of 22 in xtable-hive-metastore. Changes: - 21 license texts added, taken from apache#857 where Ranga Reddy had already curated and verified them. - Texts renamed to LICENSE-<artifactId> so the mapping is mechanical: LICENSE-jruby-jcodings -> LICENSE-jcodings, LICENSE-leveldbjni -> LICENSE-leveldbjni-all, LICENSE-javax-annotation-api -> LICENSE-javax.annotation-api, and LICENSE-jersey-core split into LICENSE-jersey-client, LICENSE-jersey-json, LICENSE-jersey-guice. - Texts removed for dependencies that are not bundled: antlr4-runtime and slf4j-api in xtable-aws and xtable-hive-metastore, glassfish-java-servlet-jsp, glasshfish-javax-servlet, and antlr4-runtime / javax-annotation-api in xtable-hudi-support-extensions. - xtable-hive-metastore shade config now filters META-INF/license/** and META-INF/licenses/*.txt from dependencies, which were landing alongside the curated texts. Ours carry no file extension. - junit corrected from 4.11 / Common Public License 1.0 to 4.12 / EPL 1.0 in LICENSE-bundled. The runtime tree resolves 4.12, which is EPL; the listing had it under CPL, so the bundled artifact was declared under the wrong license. The coordinate listings are otherwise untouched, so this does not depend on apache#880.
Contributor
Author
|
Closing as github actions are not working. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Every bundled non-Apache-2.0 dependency now ships its license text, and a check enforces that against the built jar rather than the poms.
Closes #700. Also closes #865, since the check fails in both directions.
Why the jar
LICENSE-bundledopens with "See licenses/ for text of these licenses", and today that is not true. The published artifact is the only thing that settles what is actually bundled — a shade<includes>list can name dependencies that no longer resolve, and a module with<filters>ships a subset of what the dependency tree describes. It is also what a release reviewer inspects, which is how #700 was found in the first place.Before this change, measured on jars built from
main:xtable-awscarried texts for 3 of 5 bundled non-Apache-2.0 dependenciesxtable-hive-metastorefor 3 of 22xtable-hudi-support-extensionsfor 3 of 3, plus two texts for dependencies it does not bundleThe check
release/scripts/validate_bundled_license_texts.py(152 lines) reads each*-bundled.jar, takes the coordinate listing from itsMETA-INF/LICENSE, confirms each non-Apache-2.0 coordinate's classes are genuinely present by matching against that artifact's own jar, and requiresMETA-INF/licenses/LICENSE-<artifactId>. A text with no bundled dependency behind it fails too. An empty run — no jars found — is a failure rather than a pass.Wired into
mvn-license-check.ymlas two steps: build the shaded modules, then run the check.Changes
LICENSE-<artifactId>so the mapping is mechanical rather than by eye:LICENSE-jruby-jcodingstoLICENSE-jcodings,LICENSE-leveldbjnitoLICENSE-leveldbjni-all,LICENSE-javax-annotation-apitoLICENSE-javax.annotation-api, and the singleLICENSE-jersey-coresplit intoLICENSE-jersey-client,LICENSE-jersey-jsonandLICENSE-jersey-guice.antlr4-runtimeandslf4j-apiacross modules,glassfish-java-servlet-jsp,glasshfish-javax-servlet.xtable-hive-metastoreforMETA-INF/license/**andMETA-INF/licenses/*.txt. Five third-party files (antlr2-license.txt,asm-license.txt,jline2-license.txt,jsr223-license.txt,normalize-stylesheet-license.txt) were landing alongside the curated set. Ours carry no file extension, so they are unaffected.One licensing correction worth review
junitwas listed as 4.11 under Common Public License 1.0. The runtime tree resolves 4.12, which is EPL 1.0. The bundled artifact was therefore declared under the wrong license. Corrected inLICENSE-bundled, and the text is the EPL 1.0 one from #857.Two things I would like a second opinion on:
xml-apis:1.3.04— its POM declares no license and its jar'slicense/LICENSEis the Apache text, but the same jar also ships the W3C DOM and SAX licenses for the interfaces it redistributes.LICENSE-bundledcurrently files it underApache Software License 1.1. I have kept a text for it rather than treating it as Apache-2.0-and-therefore-covered, which seemed the conservative reading, but the family heading may still be wrong.junitandhamcrest-coreare bundled at all. They arrive transitively at compile scope. Shipping test libraries in a production bundle is arguably the real defect, and excluding them would be better than licensing them.Scope
The coordinate listings are otherwise untouched, so this does not depend on #880. Nothing in
generate_shaded_license_metadata.pyorvalidate_shaded_license_coverage.shis modified.Testing
./mvnw apache-rat:check -B— passpython3 -m py_compileon the new script — passxtable-aws,xtable-hive-metastore,xtable-hudi-support-extensionsand ran the check — exit 0, output above