Skip to content

Upgrade android-activity 0.6.0 → 0.6.1#9340

Draft
ErichDonGubler wants to merge 1 commit intogfx-rs:trunkfrom
erichdongubler-mozilla:android_activity-0.6.1
Draft

Upgrade android-activity 0.6.0 → 0.6.1#9340
ErichDonGubler wants to merge 1 commit intogfx-rs:trunkfrom
erichdongubler-mozilla:android_activity-0.6.1

Conversation

@ErichDonGubler
Copy link
Copy Markdown
Member

@ErichDonGubler ErichDonGubler commented Mar 30, 2026

2026-03-30 EDIT: There are some complications noted by @rib below that mean I will likely not be driving this to completion. A new champion of upgrading this piece (or not) is welcome to appear!

@ErichDonGubler ErichDonGubler changed the title Android activity 0.6.1 Upgrade android-activity 0.6.0 → 0.6.1 Mar 30, 2026
@ErichDonGubler
Copy link
Copy Markdown
Member Author

CC @MarijnS95.

@ErichDonGubler ErichDonGubler force-pushed the android_activity-0.6.1 branch 2 times, most recently from 554fbf6 to c3b929a Compare March 30, 2026 19:04
@rib
Copy link
Copy Markdown
Contributor

rib commented Mar 30, 2026

Btw, this probably doesnt need to be blocked on a new ndk release.

The ndk crate only really depends on the jni-sys crate (it just has an optional dependency on the jni crate for documentation).

We have a series of dependencies from winit 0.30 -> android-activity 0.6 -> ndk 0.9 -> jni-sys 0.3 that block us from updating the jni-sys dependency for the ndk 0.9 crate without breaking compatibility with winit 0.30

Since the ndk crate exposes the jni-sys 0.3 JNIEnv pointer type in its public API, it would be a semver breaking change to update it to jni-sys 0.4

In turn the android-activity crate re-exports the ndk 0.9 API and it would be a semver breaking change to update to an ndk 0.10 release.

Finally, winit 0.30 depends on android-activity 0.6 and so I'm currently quite reluctant to make any semver breaking changes in android-activity while winit 0.30 is the most widely used stable release.

Although it's not ideal that we currently end up pulling in jni-sys 0.3 and 0.4, this shouldn't be too bad in practice while these sys crates only contain a relatively small number of type definitions (no code). jni-sys types are only referenced in a few unsafe ndk APIs and could be easily cast from the corresponding jni-sys 0.4 pointer type.

For reference jni-sys 0.3.1 uses the semver trick to re-export compatible types like jobject from jni-sys 0.4 but sice the JNIEnv type definition changes from being a struct to a union in jni-sys 0.4, we can't use the semver trick here.

@ErichDonGubler
Copy link
Copy Markdown
Member Author

With those complications in mind, I'm going to move this PR to draft, and invite somebody to champion its work (perhaps in their own PR). I want the PR open as a signal that there's some interest in doing it. However, that interest will ultimately need to manifest from the community in the form of additional work that I don't expect I'll be doing myself. Unfortunately, I can't justify doing this with Mozilla's current priorities. 😅

@ErichDonGubler ErichDonGubler marked this pull request as draft March 30, 2026 19:23
@rib
Copy link
Copy Markdown
Contributor

rib commented Mar 30, 2026

My comment was only really intending to point out that this isnt blocked on a ndk release. There's hopefully no other complication here except to tell cargo-deny know that it's expected that there will be two versions of the jni-sys crate. So I guess your PR was pretty much done.

Pulling in two versions of the jni-sys crate should be reasonable, considering that these crates contain no code. Considering that jni-sys uses the semver trick then anyone depending on jni-sys 0.3 will also bring in jni-sys 0.4 anyway.

@ErichDonGubler ErichDonGubler force-pushed the android_activity-0.6.1 branch from c3b929a to 473305b Compare April 6, 2026 23:39
@ErichDonGubler ErichDonGubler force-pushed the android_activity-0.6.1 branch from 473305b to 78f8a38 Compare April 7, 2026 22:11
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.

2 participants