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

Run build-artifacts from Ubuntu and Windows in the emulator #169

Merged
merged 4 commits into from
Aug 8, 2021

Conversation

MarijnS95
Copy link
Member

@MarijnS95 MarijnS95 commented Aug 6, 2021

For #162 (comment)

TODO: We're not testing cargo apk run functionality anymore, how do we want to work that into here? We can place the commands inside rust.yml in a third emulator run. This is now happening in a third local run.

Note that this PR is intentionally not based on the merge of #168 to demonstrate it actually failing! This would have caught the bogus refactor in #162.

@MarijnS95 MarijnS95 requested a review from msiglreith August 6, 2021 09:49
@MarijnS95 MarijnS95 force-pushed the emulator-artifacts branch 2 times, most recently from 9c419a3 to c42aa9b Compare August 6, 2021 10:28
@MarijnS95 MarijnS95 force-pushed the emulator-artifacts branch 2 times, most recently from 7d62136 to a15e659 Compare August 7, 2021 21:53
@MarijnS95 MarijnS95 force-pushed the emulator-artifacts branch from a15e659 to 93ea00a Compare August 8, 2021 16:16
Copy link
Contributor

@dvc94ch dvc94ch left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

cargo-apk/Cargo.toml Outdated Show resolved Hide resolved
ndk-build/src/apk.rs Outdated Show resolved Hide resolved
@MarijnS95
Copy link
Member Author

@dvc94ch immediately resolving your comments: I intentionally pushed a revert of @msiglreith's fix to showcase that this improved Emulator setup indeed catches that issue :)

Without having to download the artifact.  Output is limited to errors
and app-specific output anyway.
@MarijnS95 MarijnS95 force-pushed the emulator-artifacts branch from 577305d to 19ce285 Compare August 8, 2021 18:10
@dvc94ch
Copy link
Contributor

dvc94ch commented Aug 8, 2021

looks good now

@MarijnS95
Copy link
Member Author

Now that we have a failure case clearly visible and linked: https://github.com/rust-windowing/android-ndk-rs/runs/3274663232?check_suite_focus=true this PR is now running with the fix in place and should succeed. Ready for review and merge :)

@MarijnS95 MarijnS95 force-pushed the emulator-artifacts branch from 19ce285 to 03aa316 Compare August 8, 2021 21:00
@MarijnS95
Copy link
Member Author

The script strangely has a tendency to get stuck, on a different matrix.source_os even. Added set -x to figure out what's going on. It gets stuck here:

2021-08-08T18:21:16.0576230Z Emulator booted.
2021-08-08T18:21:16.0599730Z [command]/Users/runner/Library/Android/sdk/platform-tools/adb shell input keyevent 82
2021-08-08T18:21:16.9240320Z Disabling animations.
2021-08-08T18:21:16.9277890Z [command]/Users/runner/Library/Android/sdk/platform-tools/adb shell settings put global window_animation_scale 0.0
2021-08-08T18:21:17.4115870Z [command]/Users/runner/Library/Android/sdk/platform-tools/adb shell settings put global transition_animation_scale 0.0
2021-08-08T18:21:17.6868170Z [command]/Users/runner/Library/Android/sdk/platform-tools/adb shell settings put global animator_duration_scale 0.0
2021-08-08T18:21:17.7762760Z [command]/bin/sh -c ./.github/workflows/android_test.sh "ubuntu-latest" "/Users/runner/work/android-ndk-rs/android-ndk-rs"
2021-08-08T18:21:17.9564350Z emulator: INFO: boot completed
2021-08-08T18:21:17.9567220Z emulator: INFO: boot time 64960 ms
2021-08-08T18:21:17.9567880Z emulator: Increasing screen off timeout, logcat buffer size to 2M.
2021-08-08T18:21:17.9580040Z emulator: Revoking microphone permissions for Google App.
2021-08-08T18:21:43.0403370Z emulator: ### WARNING: /etc/localtime does not point to zoneinfo-compatible timezone name
2021-08-08T18:21:43.0505090Z 
2021-08-08T20:39:47.6888850Z ##[error]The operation was canceled.

A working build looks like:

2021-08-08T18:21:08.9113400Z Emulator booted.
2021-08-08T18:21:08.9168200Z [command]/Users/runner/Library/Android/sdk/platform-tools/adb shell input keyevent 82
2021-08-08T18:21:11.1096720Z emulator: INFO: boot completed
2021-08-08T18:21:11.1198330Z emulator: INFO: boot time 53960 ms
2021-08-08T18:21:11.1299610Z emulator: Increasing screen off timeout, logcat buffer size to 2M.
2021-08-08T18:21:11.1396130Z emulator: Revoking microphone permissions for Google App.
2021-08-08T18:21:11.9884620Z Disabling animations.
2021-08-08T18:21:11.9907410Z [command]/Users/runner/Library/Android/sdk/platform-tools/adb shell settings put global window_animation_scale 0.0
2021-08-08T18:21:12.3787490Z [command]/Users/runner/Library/Android/sdk/platform-tools/adb shell settings put global transition_animation_scale 0.0
2021-08-08T18:21:12.5684550Z [command]/Users/runner/Library/Android/sdk/platform-tools/adb shell settings put global animator_duration_scale 0.0
2021-08-08T18:21:12.7914430Z [command]/bin/sh -c ./.github/workflows/android_test.sh "local" ""
2021-08-08T18:21:13.3565060Z Warning: You use environment variable ANDROID_HOME that is deprecated. Please, remove it and use ANDROID_SDK_ROOT instead. Now ANDROID_HOME is used
2021-08-08T18:21:14.5924190Z     Updating crates.io index
... andsoforth

@MarijnS95
Copy link
Member Author

MarijnS95 commented Aug 8, 2021

Warning: An error occurred while preparing SDK package Intel x86 Atom_64 System Image: Operation timed out (Read failed).
/Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5554 emu kill
error: could not connect to TCP port 5554: Connection refused
The process '/Users/runner/Library/Android/sdk/platform-tools/adb' failed with exit code 1

Ehh, let's try one more time...?

Is this something preventing us from running >2 emulators in a single CI run? None of these errors appear related to our scripts at all.

EDIT: This was the run on my local fork (because we have on: push), the run here in on: pull_request seems to have succeeded. I'm keeping the set -x, we'll have to monitor over time if the emulator remains stable or if we should play with its configuration for a bit longer.

@MarijnS95 MarijnS95 merged commit b665be0 into rust-mobile:master Aug 8, 2021
@MarijnS95 MarijnS95 deleted the emulator-artifacts branch August 8, 2021 21:16
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.

3 participants