Skip to content

Commit 3cf0e81

Browse files
timsaucerclaude
andcommitted
build: consolidate Rust crates into a Cargo workspace + extract native-common
Move the standalone `native` crate into a root Cargo workspace and extract shared JNI plumbing (error->exception mapping, Tokio runtime singleton, StreamingReader) into a new `datafusion-jni-common` crate under `native-common/`. `native/src/errors.rs` moves to `native-common/src/errors.rs`; the nine native modules now import error/runtime helpers from `datafusion_jni_common`. Build glue follows: single root `Cargo.lock`, `.cargo/config.toml` redirects output to `rust-target/`, Makefile/CI/poms updated to build `--workspace` and target `-p datafusion-jni`. Core javadoc build commands updated to match. Pure refactor; no behavior change. First of a 6-PR stack splitting the Spark DataSource V2 connector work. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 051b00b commit 3cf0e81

28 files changed

Lines changed: 444 additions & 248 deletions

‎.cargo/config.toml‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Keep Cargo's workspace output out of `target/` so `mvn clean` (which deletes
19+
# the root `target/`) does not nuke the Rust build cache.
20+
[build]
21+
target-dir = "rust-target"

‎.github/workflows/build.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ jobs:
8383
path: |
8484
~/.cargo/registry
8585
~/.cargo/git
86-
native/target
87-
key: ${{ runner.os }}-cargo-${{ hashFiles('native/Cargo.lock') }}
86+
rust-target
87+
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
8888
restore-keys: ${{ runner.os }}-cargo-
8989

9090
- name: Build native and run tests

‎.github/workflows/lint.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
run: ./mvnw -q spotless:check
5555

5656
- name: Check Rust formatting
57-
run: cd native && cargo fmt --all -- --check
57+
run: cargo fmt --all -- --check
5858

5959
clippy:
6060
name: Clippy
@@ -81,9 +81,9 @@ jobs:
8181
path: |
8282
~/.cargo/registry
8383
~/.cargo/git
84-
native/target
85-
key: ${{ runner.os }}-clippy-${{ hashFiles('native/Cargo.lock') }}
84+
rust-target
85+
key: ${{ runner.os }}-clippy-${{ hashFiles('Cargo.lock') }}
8686
restore-keys: ${{ runner.os }}-clippy-
8787

8888
- name: Run clippy
89-
run: cd native && cargo clippy --all-targets -- -D warnings
89+
run: cargo clippy --workspace --all-targets -- -D warnings

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
target/
2+
rust-target/
23
*.class
34
.idea/
45
.vscode/

0 commit comments

Comments
 (0)