Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Egui almost certainly shouldn't be depending on android-activity #2829

Closed
rib opened this issue Mar 20, 2023 · 1 comment · Fixed by #2863 or ardocrat/egui#1
Closed

Egui almost certainly shouldn't be depending on android-activity #2829

rib opened this issue Mar 20, 2023 · 1 comment · Fixed by #2863 or ardocrat/egui#1

Comments

@rib
Copy link
Contributor

rib commented Mar 20, 2023

This dependency on the "native-activity" feature for android-activity means that applications can't use Egui with the game-activity backend and it also locks Egui applications to a specific version of android-activity which is probably not necessary.

android-activity = { version = "0.4", features = ["native-activity"] }

Unlike most crates it's strictly never possible to have more than one version of android-activity linked into an application and so ideally very few crates should be directly depending on a specific version (increasing the chance of conflicts).

The android-activity crate is re-exported from Winit so that most crates can avoid needing to specify a direct dependency.

E.g. see:
https://github.com/rust-mobile/rust-android-examples/blob/41e72ca9de45e2add4776ec004f916ad979cf781/agdk-egui/src/lib.rs#L4

I can't see anything depending on the android_activity API though, so hopefully this can be removed.

rib pushed a commit to rib/egui that referenced this issue Mar 20, 2023
This allows applications to use the game-activity backend and
avoids pinning Egui applications to a specific version of
android-activity (which isn't necessary since Egui doesn't directly
use the android-activity API)

Fixes: emilk#2829
@ardocrat
Copy link
Contributor

I made PR to use android-activity as optional dependency cause their CI is requiring it: #2834

rib added a commit to rib/egui that referenced this issue Mar 29, 2023
Instead of depending on android-activity directly, this exposes the
android-native-activity and android-game-activity features from Winit.

This ensures that applications can choose what android-backend they use
while also relying on Winit to decide what version of android-activity to
use - without increasing the risk of a version conflict by having a direct
dependency.

_(NB: Egui doesn't currently use the android-activity API itself)_

Since android-activity provides the `android_main()` entry point for
Android applications it's not possible to link in multiple version of
the android-activity crate and so it's particularly important to
avoid unnecessary direct dependencies that could cause a version
conflict in the future.

To help avoid the need for applications to directly depend on
android-activity the Winit crate re-exports the android-activity API
and exposes features to configure the backend so that application crates
can instead rely on Winit to pull in a compatible version of
android-activity. (This way version bumps for android-activity only
need to be synchronized with the Winit crate).

CI now enables the `android-native-activity` feature for testing.

Fixes: emilk#2829
Fixes: emilk#2720
Closes: emilk#2834
rib added a commit to rib/egui that referenced this issue Apr 1, 2023
Instead of depending on android-activity directly, this exposes the
android-native-activity and android-game-activity features from Winit.

This ensures that applications can choose what android-backend they use
while also relying on Winit to decide what version of android-activity to
use - without increasing the risk of a version conflict by having a direct
dependency.

_(NB: Egui doesn't currently use the android-activity API itself)_

Since android-activity provides the `android_main()` entry point for
Android applications it's not possible to link in multiple version of
the android-activity crate and so it's particularly important to
avoid unnecessary direct dependencies that could cause a version
conflict in the future.

To help avoid the need for applications to directly depend on
android-activity the Winit crate re-exports the android-activity API
and exposes features to configure the backend so that application crates
can instead rely on Winit to pull in a compatible version of
android-activity. (This way version bumps for android-activity only
need to be synchronized with the Winit crate).

CI now enables the `android-native-activity` feature for testing.

Fixes: emilk#2829
Fixes: emilk#2720
Closes: emilk#2834
emilk pushed a commit that referenced this issue Apr 18, 2023
Instead of depending on android-activity directly, this exposes the
android-native-activity and android-game-activity features from Winit.

This ensures that applications can choose what android-backend they use
while also relying on Winit to decide what version of android-activity to
use - without increasing the risk of a version conflict by having a direct
dependency.

_(NB: Egui doesn't currently use the android-activity API itself)_

Since android-activity provides the `android_main()` entry point for
Android applications it's not possible to link in multiple version of
the android-activity crate and so it's particularly important to
avoid unnecessary direct dependencies that could cause a version
conflict in the future.

To help avoid the need for applications to directly depend on
android-activity the Winit crate re-exports the android-activity API
and exposes features to configure the backend so that application crates
can instead rely on Winit to pull in a compatible version of
android-activity. (This way version bumps for android-activity only
need to be synchronized with the Winit crate).

CI now enables the `android-native-activity` feature for testing.

Fixes: #2829
Fixes: #2720
Closes: #2834
TicClick pushed a commit to TicClick/egui that referenced this issue Apr 18, 2023
Instead of depending on android-activity directly, this exposes the
android-native-activity and android-game-activity features from Winit.

This ensures that applications can choose what android-backend they use
while also relying on Winit to decide what version of android-activity to
use - without increasing the risk of a version conflict by having a direct
dependency.

_(NB: Egui doesn't currently use the android-activity API itself)_

Since android-activity provides the `android_main()` entry point for
Android applications it's not possible to link in multiple version of
the android-activity crate and so it's particularly important to
avoid unnecessary direct dependencies that could cause a version
conflict in the future.

To help avoid the need for applications to directly depend on
android-activity the Winit crate re-exports the android-activity API
and exposes features to configure the backend so that application crates
can instead rely on Winit to pull in a compatible version of
android-activity. (This way version bumps for android-activity only
need to be synchronized with the Winit crate).

CI now enables the `android-native-activity` feature for testing.

Fixes: emilk#2829
Fixes: emilk#2720
Closes: emilk#2834
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants