andygrove opened a new pull request, #6998:
URL: https://github.com/apache/datafusion-comet/pull/6998

   ## Which issue does this PR close?
   
   No issue filed.
   
   ## Rationale for this change
   
   `native/shuffle/Cargo.toml` declared `jni = "0.21"`, while `core`, 
`jni-bridge` and `spark-expr` declared `0.22.4`. Cargo treats those as 
incompatible releases, so `Cargo.lock` held both `jni` 0.21.1 and 0.22.4, along 
with `jni-sys` 0.3.1 and 0.4.1.
   
   The shuffle crate only uses `jni::sys::{jint, jlong}`, in 
`spark_unsafe/row.rs`. Those are aliases for `i32` and `i64` in both `jni-sys` 
versions, so nothing needed the old major. The cost was a second compile of the 
binding on every build (five extra crates on non-Windows targets), and a trap 
for later: `JObject` and the env handle from the two majors are different 
types, so a `JObject` handed from `jni-bridge` to shuffle would not have 
type-checked.
   
   Each crate repeated its own version string, which is how they drifted. 
Declaring the version once in the workspace keeps them together.
   
   ## What changes are included in this PR?
   
   - `native/Cargo.toml` adds `jni = "0.22.4"` to `[workspace.dependencies]`, 
with a comment on why it is shared.
   - `shuffle`, `core`, `jni-bridge` and `spark-expr` now use `jni = { 
workspace = true }`. The `invocation` feature that `core` and `jni-bridge` 
enable under `[dev-dependencies]` is kept as `jni = { workspace = true, 
features = ["invocation"] }`.
   - `native/Cargo.lock` loses 14 packages and gains none: `jni` 0.21.1, 
`jni-sys` 0.3.1, `cesu8`, `thiserror` and `thiserror-impl` 1.0.69, 
`windows-sys` 0.45.0 and the eight 0.42.2 crates beneath it (`windows-targets` 
and seven `windows_*`). No remaining package changes version. Some dependency 
entries drop their version suffix because only one version of that crate is 
left.
   
   There is no Rust source change.
   
   ## How are these changes tested?
   
   No new tests, since behavior does not change. `jint` and `jlong` are the 
same primitive types under both versions, and the existing tests cover the code 
that uses them.
   
   - `cargo metadata --offline --locked` passes. Comparing the name and version 
of every package in `Cargo.lock` before and after shows only the 14 removals.
   - `cargo tree` shows one `jni` (0.22.4) and one `jni-sys` (0.4.1) for all 
targets.
   - `cargo clippy --all-targets --workspace -- -D warnings`, the lint command 
CI runs, is clean on Rust 1.97.0.
   - `cargo test -p datafusion-comet-shuffle --lib` passes (187 tests).
   - `cargo machete` reports no unused dependencies.
   
   I did not run the `jni-bridge` and `core` tests that start a JVM. The 
workspace entry resolves to the same version and features they had before, and 
the Rust test job in CI runs them.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to