← Back to Pull requests

fix: include licenses for bundled lz4_flex and Zstandard #7382

Closed
unknown closed this pull request without merging on Nov 07, 2026 17:12 UTC
View on GitHub
unknown unknown commented on Nov 01, 2026 06:00 UTC
Author

Which issue does this PR close?

No separate issue. This addresses two native binary licensing omissions found while verifying 1.2.0-rc1.

Rationale for this change

The 1.2.0-rc1 JARs bundle lz4_flex and Zstandard code through libcomet, but their license and copyright texts are absent from the JAR legal resources.

What changes are included in this PR?

  • Add a maintained binary LICENSE containing the existing Apache license and the upstream lz4_flex 0.14.0 MIT and Zstandard 1.5.7 BSD-3-Clause texts and copyrights. Preserve the existing project NOTICE.

  • Use the existing Maven Shade packaging to put that LICENSE into the main and sources JARs, excluding input copies so incremental builds retain exactly one entry.

  • Extend the existing artifact checker and Maven invocation to verify the complete LICENSE and reject drift from the two versions in native/Cargo.lock. The sources-JAR path is configurable through comet.spark.sources.jar; an expected missing JAR fails explicitly, while maven.source.skip=true intentionally skips its verification. The checker lists each JAR once for all its checks and fails explicitly if a JAR cannot be listed.
  • This fixes the two confirmed omissions. It does not claim a complete audit of every bundled native dependency. The remaining audit is tracked in #7383.

    How are these changes tested?

  • dev/ci/test-jar-contents.py has 14 tests against real ZIP files. They run in Preflight, which passed at 75e0bb448. They cover valid main and sources JARs; non-native JARs, which keep their own legal resources; missing, duplicate and truncated LICENSE entries; a LICENSE without the native attributions, the omission in 1.2.0-rc1; each upstream copyright line removed; lz4_flex or Zstandard versions in native/Cargo.lock that differ from the LICENSE; missing, ambiguous or unparseable lock versions; a missing sources JAR, with and without maven.source.skip; a JAR that cannot be listed; a listing larger than a pipe buffer; and the source-only allowlist in both artifact roles. Breaking each check in the script fails the tests written for it.

  • Every test but one runs a copy of the checker against a fixture Cargo.lock, so an unrelated dependency bump does not break them. test_license_matches_cargo_lock reads the repository's lock file on purpose: a bump of lz4_flex, or of zstd-sys to a new Zstandard release, fails Preflight until LICENSE-binary.txt is updated.

  • On locally built Spark 4.1 main and sources JARs, the single-listing checker reports the same results as before, and a copy with the binary LICENSE passes.

  • Spark 3.4/Scala 2.12 and Spark 4.1/Scala 2.13 root release-profile clean verify -DskipTests passed with real macOS native payloads, as did incremental Spark 4.1 packaging. All four main/sources JARs have exactly one matching LICENSE and the unchanged project NOTICE. Committed-source Apache RAT and formatting passed.

  • Linux CI at an earlier head passed at 82b1ed3ba615997d4f2a77b301104ded557c794f on attempt 1: 23 successful jobs, 18 skipped and no failures. Native build, Clippy, Rust tests (2,732 default; 15 Python-UDF; five jemalloc), all four Spark 4.1 shards (5,531 passed; 31 canceled; 18 ignored), TPC-H/TPC-DS result verification, and real Linux main/sources JAR license checks passed.
  • Diff: 429 lines (+321 / -108) across 5 files Reviewer: sunchao Review duration: 9311m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 429 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.363
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #7382"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.1% (MEDIUM) · Higher = larger blast radius
    45.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.8% · Safe to merge
    17.8%