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

[GL] Testing with the Android Emulator on CI #3604

Closed
wants to merge 2 commits into from

Conversation

Gordon-F
Copy link
Contributor

@Gordon-F Gordon-F commented Jan 19, 2021

Just a proof-of-concept of how we can run a quad example on CI with the Android Emulator.

All other jobs temporary removed (for speed up).

TODO:

  • Rollback all CI jobs
  • Investigate why half of builds panicked with error:
    thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/ndk-glue-0.2.1/src/lib.rs:255:34 Sometimes running apps panicked on the Android Emulator rust-mobile/ndk#116
  • Investigate how we can run quad on Android without code duplication
  • Add PR comments with results screenshot and logs

Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exciting stuff!

@@ -0,0 +1,935 @@
#[cfg(not(any(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this have to be a separate example? could we make it a part of the existing quad instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a separate example because we need to compile crate-type = ["cdylib"] for Android. This should be partially fixed, because I removed most of code duplication.

Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is starting to look great!

examples/quad_android/Cargo.toml Show resolved Hide resolved
@@ -0,0 +1,37 @@
[package]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another option, not necessarily a better one, is to have examples/src/lib.rs, so that the project is a cdylib library with binaries. The library would only be doing stuff on Android at this moment, but maybe we can find more use for this later?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cargo apk allows run apk file only from cargo workspace root. But cargo doesn't allow pass features in cargo workspace root.

error: --features is not allowed in the root of a virtual workspace

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is error already fixed in cargo-apk. I will try to remove more code duplication with examples/src/lib.rs.

@Gordon-F
Copy link
Contributor Author

I'm going to close this PR, since gfx-hal is deprecated. I will try to run this PR on top of wgpu or wgpu-hal when I had more free time.

@Gordon-F Gordon-F closed this Jul 27, 2021
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