Conversation
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.
Supersedes #469.
jni 0.22 redesigned its environment and attachment model, so
crates/androidandcrates/platform/gpui-android(excluded from the workspace, built as a path dependency oftcode-android) move together:EnvUnownedand run their JNI work throughwith_env(...).resolve::<LogErrorAndDefault>(), which also catches panics at the FFI boundary and logs errors instead of the previous silentif let Okdrops. Exports that never touch the environment keep their plain bodies.JavaVM::from_rawis now infallible and registers the singleton; scopedattach_current_thread()/get_env()become closure-basedattach_current_thread(|env| …)(a no-op attachment on the Java main thread, which only pushes a local frame).JObject::from_rawnow takes theEnv.GlobalRef→Global<JObject<'static>>(no longerClone, soJniObjectholds it in anArc).jni_str!/jni_sig!(compile-time MUTF-8/parsed signatures) instead of runtime&str;with_activitytakes&'static JNIStr+MethodSignature.env.get_string/get_array_length/get_int_array_regionbecomeJString::try_to_string,JPrimitiveArray::len/get_region;JString::from(JObject)becomes the checkedJString::cast_local.jbooleanisboolin jni-sys 0.4, so theu8conversions go away.Cargo.lock only re-points the two crates at
jni 0.22.4(already in the graph);jni 0.21.1stays for its other consumer.Local evidence (macOS arm64, NDK 27.1.12297006):
RUSTFLAGS='-D warnings' CARGO_NDK_PLATFORM=26 cargo ndk -t arm64-v8a check -p tcode-android --locked✅ (the CI "Mobile and web checks" command)cargo fmt --all --check✅ (gpui-androidformatted withrustfmt --edition 2024since it is outside the workspace)cargo clippy --workspace --all-targets --locked -- -D warnings✅cargo build --workspace --locked✅cargo test -p tcode-android --locked✅ (no tests)cargo machete✅Not covered: no Android device/emulator run; the JNI bridge behaviour (IME, clipboard, camera QR results, preview host) was verified by compilation only.