Skip to content

Respect custom Cargo target dir in JNI build#672

Open
dannyward630 wants to merge 1 commit into
signalapp:mainfrom
dannyward630:codex/cargo-target-dir-jni
Open

Respect custom Cargo target dir in JNI build#672
dannyward630 wants to merge 1 commit into
signalapp:mainfrom
dannyward630:codex/cargo-target-dir-jni

Conversation

@dannyward630

Copy link
Copy Markdown

Summary

  • resolve Cargo's actual target directory with cargo metadata
  • copy desktop/server JNI libraries from that resolved directory instead of hard-coded target/...
  • keep Android artifact handling unchanged because it already uses --artifact-dir

Why

java/build_jni.sh respected Cargo's configured target directory during the build, but then copied desktop/server libraries from target/$triple/.... That breaks users who set CARGO_TARGET_DIR or configure build.target-dir, as reported in #655.

Validation

  • bash -n bin/build_helpers.sh java/build_jni.sh
  • git diff --check
  • fake-toolchain smoke: ran java/build_jni.sh desktop with a fake cargo/rustc and CARGO_TARGET_DIR set to a temp custom directory; the script copied libsignal_jni_amd64.dylib and libsignal_jni_testing_amd64.dylib from that custom target directory into java/client/src/main/resources

I could not run the full Rust/JNI build in this local environment because cargo is not installed on this machine.

Fixes #655.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

allow user-defined cargo target dir

1 participant