-
Notifications
You must be signed in to change notification settings - Fork 3
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
build question #139
Comments
|
One other mistake I had in the build instructions: |
Yes, I remember some "unable to strip" – but must admit I paid them not too much attention as I see them quite often (background: https://codeberg.org/IzzyOnDroid/rbtlog – as you can see, there are already hundreds of apps covered, and yours would be the second Rust one). Thanks for confirming I've picked the correct APK, and also for mentioning the flavor to include to skip the demo one. I could run the build again and provide you the full log if it helps. I've also kept the APK, so I can peek into it to compare sizes. Here're the
as compared to yours:
So yes, it's them (especially In case it matters: build was running on Debian bookworm with OpenJDK 17 and NDK 27.2.12479018 (which I've picked from your |
By any chance, are you building the latest tag (ndk version 26.3.11579264) but using the ndk version from master? I fixed some more issues in the build instructions and came across that problem. It seems stripping debug symbols is the only step that ignores |
Close. I built from the latest tag. I sometimes indeed forget to switch to the tag when checking (checking…) oof, straight hit: the tag specifies r26d, I've used 27, grmpf… OK, recipe adjusted, running another build now. Does the NDK used change often? Then I'd mark your app's recipe for manual check should the build be RB now, with a note telling me where to look for the NDK to be updated (well, in the (build reached gradlew meanwhile – I catch myself something to drink before I check again…) OK, looks much better: difference now is down to half a Megabyte now! -rw-r--r-- 0.0 unx 157720 b- 157720 stor 1981-01-01 01:01:02 7c30fd53 lib/arm64-v8a/libjnidispatch.so
- -rw-r--r-- 0.0 unx 1175000 b- 1175000 stor 1981-01-01 01:01:02 557494a7 lib/arm64-v8a/libopenscq30_android.so
+ -rw-r--r-- 0.0 unx 1339000 b- 1339000 stor 1981-01-01 01:01:02 7968c852 lib/arm64-v8a/libopenscq30_android.so
-rw-r--r-- 0.0 unx 7252 b- 7252 stor 1981-01-01 01:01:02 9a714d3a lib/armeabi-v7a/libandroidx.graphics.path.so
-rw-r--r-- 0.0 unx 112188 b- 112188 stor 1981-01-01 01:01:02 8f2cdb72 lib/armeabi-v7a/libjnidispatch.so
- -rw-r--r-- 0.0 unx 872652 b- 872652 stor 1981-01-01 01:01:02 34a67c71 lib/armeabi-v7a/libopenscq30_android.so
+ -rw-r--r-- 0.0 unx 1009576 b- 1009576 stor 1981-01-01 01:01:02 33b27c1e lib/armeabi-v7a/libopenscq30_android.so
-rw-r--r-- 0.0 unx 122784 b- 122784 stor 1981-01-01 01:01:02 4298d12a lib/armeabi/libjnidispatch.so
-rw-r--r-- 0.0 unx 150924 b- 150924 stor 1981-01-01 01:01:02 2d572a0c lib/mips/libjnidispatch.so
-rw-r--r-- 0.0 unx 141904 b- 141904 stor 1981-01-01 01:01:02 1a68d4c4 lib/mips64/libjnidispatch.so
-rw-r--r-- 0.0 unx 9284 b- 9284 stor 1981-01-01 01:01:02 3d9afc66 lib/x86/libandroidx.graphics.path.so
-rw-r--r-- 0.0 unx 112108 b- 112108 stor 1981-01-01 01:01:02 76982304 lib/x86/libjnidispatch.so
- -rw-r--r-- 0.0 unx 1211192 b- 1211192 stor 1981-01-01 01:01:02 9522fa41 lib/x86/libopenscq30_android.so
+ -rw-r--r-- 0.0 unx 1416072 b- 1416072 stor 1981-01-01 01:01:02 97848477 lib/x86/libopenscq30_android.so
-rw-r--r-- 0.0 unx 10760 b- 10760 stor 1981-01-01 01:01:02 81bd88ae lib/x86_64/libandroidx.graphics.path.so
-rw-r--r-- 0.0 unx 108632 b- 108632 stor 1981-01-01 01:01:02 e4a572de lib/x86_64/libjnidispatch.so
- -rw-r--r-- 0.0 unx 1235640 b- 1235640 stor 1981-01-01 01:01:02 e90c5cc8 lib/x86_64/libopenscq30_android.so
+ -rw-r--r-- 0.0 unx 1436800 b- 1436800 stor 1981-01-01 01:01:02 affc6ac7 lib/x86_64/libopenscq30_android.so
-rw---- 2.0 fat 1738 b- 782 defN 1981-01-01 01:01:02 d5ac4dc2 DebugProbesKt.bin Took 10min as I forgot to change |
OK, that didn't change much (except for build time being 1min less, around 9 min now). APK has the same size (to the byte) as it was with 1.25.1. |
My process for releases is:
Rust is installed using I generally update the ndk version as new versions are added to github actions runner images so that I can have the workflow use the latest ndk. For convenience, I added a script at Rust 1.80.1 was the latest stable version when OpenSCQ30 v1.13.1 was released, so that's the one that was used to build it. |
I can switch to building in a debian container if that would make things simpler. |
That's what I oriented on and took most of the steps from. Differences here are: Debian bookworm instead of Ubuntu (should not make a difference in my experience), OpenJDK-17 instead of Temurin (rarely makes a difference – and as the diff lies in the repository: https://github.com/Oppzippy/OpenSCQ30.git
updates: releases
notes:
- ends up with a bigger file (initially 64 MB due to NDK) than the expected 7.5 MB from upstream, see https://github.com/Oppzippy/OpenSCQ30/issues/139
- use assembleBluetoothRelease to skip building the demo APK
versions:
- tag: v1.13.1
apks:
- apk_pattern: openscq30_android\.apk
apk_url: https://github.com/Oppzippy/OpenSCQ30/releases/download/v1.13.1/openscq30_android.apk
build:
- git clone https://github.com/rust-lang/rustup.git -b 1.27.1
- export ANDROID_NDK=/opt/sdk/ndk/${PROVISIONING_NDK}
- ${BUILD_REPO_DIR}/rustup/rustup-init.sh -y --target armv7-linux-androideabi --target aarch64-linux-android --target i686-linux-android --target x86_64-linux-android
- source $HOME/.cargo/env
- cargo install cargo-ndk
- cd android
- ./gradlew assembleBluetoothRelease
- find . -name '*.apk'
- mv app/build/outputs/apk/bluetooth/release/app-bluetooth-release-unsigned.apk /outputs/unsigned.apk
build_cpus:
build_home_dir: /build
build_repo_dir: /build/repo
build_timeout:
build_user: build
provisioning:
android_home: /opt/sdk
build_tools:
cmake:
cmdline_tools:
version: '12.0'
url: https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
sha256: 2d2d50857e4eb553af5a6dc3ad507a17adf43d115264b1afc116f95c92e5e258
extra_packages:
- make
- g++
- cmake
- protobuf-compiler
image: debian:bookworm-slim
jdk: openjdk-17-jdk-headless
ndk: 26.3.11579264
platform:
platform_tools:
tools:
verify_gradle_wrapper: true And yeah, I could try with e.g. Resulting APK here has 8420837 bytes (instead of the 7731308 bytes the APK from your releases has).
Thanks, but I'll need to took that up manually anyway as installing the APK is part of provisioning, so it cannot be done inside the
Rust is installed by |
The rust version seems to be the issue. When building with rust 1.80.1, I get within a few hundred bytes of the expected size. When I use the latest stable, which rustup will install by default, I get within a few hundred bytes of the size you're getting. |
Strange. So how can we tell rustup to install the version we need? rust: 1.80.1
rustup: 1.27.1 Those I then could fetch in the build recipe here to match what you've used. Wow, that's indeed pretty close now: -rw-r--r-- 0.0 unx 157720 b- 157720 stor 1981-01-01 01:01:02 7c30fd53 lib/arm64-v8a/libjnidispatch.so
- -rw-r--r-- 0.0 unx 1175000 b- 1175000 stor 1981-01-01 01:01:02 557494a7 lib/arm64-v8a/libopenscq30_android.so
+ -rw-r--r-- 0.0 unx 1174504 b- 1174504 stor 1981-01-01 01:01:02 9b47c368 lib/arm64-v8a/libopenscq30_android.so
-rw-r--r-- 0.0 unx 7252 b- 7252 stor 1981-01-01 01:01:02 9a714d3a lib/armeabi-v7a/libandroidx.graphics.path.so
-rw-r--r-- 0.0 unx 112188 b- 112188 stor 1981-01-01 01:01:02 8f2cdb72 lib/armeabi-v7a/libjnidispatch.so
- -rw-r--r-- 0.0 unx 872652 b- 872652 stor 1981-01-01 01:01:02 34a67c71 lib/armeabi-v7a/libopenscq30_android.so
+ -rw-r--r-- 0.0 unx 871908 b- 871908 stor 1981-01-01 01:01:02 a8cb5df6 lib/armeabi-v7a/libopenscq30_android.so
-rw-r--r-- 0.0 unx 122784 b- 122784 stor 1981-01-01 01:01:02 4298d12a lib/armeabi/libjnidispatch.so
-rw-r--r-- 0.0 unx 150924 b- 150924 stor 1981-01-01 01:01:02 2d572a0c lib/mips/libjnidispatch.so
-rw-r--r-- 0.0 unx 141904 b- 141904 stor 1981-01-01 01:01:02 1a68d4c4 lib/mips64/libjnidispatch.so
-rw-r--r-- 0.0 unx 9284 b- 9284 stor 1981-01-01 01:01:02 3d9afc66 lib/x86/libandroidx.graphics.path.so
-rw-r--r-- 0.0 unx 112108 b- 112108 stor 1981-01-01 01:01:02 76982304 lib/x86/libjnidispatch.so
- -rw-r--r-- 0.0 unx 1211192 b- 1211192 stor 1981-01-01 01:01:02 9522fa41 lib/x86/libopenscq30_android.so
+ -rw-r--r-- 0.0 unx 1210064 b- 1210064 stor 1981-01-01 01:01:02 a109365e lib/x86/libopenscq30_android.so
-rw-r--r-- 0.0 unx 10760 b- 10760 stor 1981-01-01 01:01:02 81bd88ae lib/x86_64/libandroidx.graphics.path.so
-rw-r--r-- 0.0 unx 108632 b- 108632 stor 1981-01-01 01:01:02 e4a572de lib/x86_64/libjnidispatch.so
- -rw-r--r-- 0.0 unx 1235640 b- 1235640 stor 1981-01-01 01:01:02 e90c5cc8 lib/x86_64/libopenscq30_android.so
+ -rw-r--r-- 0.0 unx 1234600 b- 1234600 stor 1981-01-01 01:01:02 d0c2b4ae lib/x86_64/libopenscq30_android.so
-rw---- 2.0 fat 1738 b- 782 defN 1981-01-01 01:01:02 d5ac4dc2 DebugProbesKt.bin Recipe: build:
- git clone https://github.com/rust-lang/rustup.git -b 1.27.1
- export ANDROID_NDK=/opt/sdk/ndk/${PROVISIONING_NDK}
- ${BUILD_REPO_DIR}/rustup/rustup-init.sh -y --default-toolchain=1.80.1 --target armv7-linux-androideabi --target aarch64-linux-android --target i686-linux-android --target x86_64-linux-android
- source $HOME/.cargo/env
- cargo install cargo-ndk
- cd android
- ./gradlew assembleBluetoothRelease
- find . -name '*.apk'
- mv app/build/outputs/apk/bluetooth/release/app-bluetooth-release-unsigned.apk /outputs/unsigned.apk And now it gets funny. I've run |
PS: Your APK was built 2024-08-31, so rust 1.80.1 was not yet released (that came 5 days later), it must have been rust 1.80.0. I'll run again with that now… |
I think 1.80.1 should be correct, since it was tagged on August 8. Not sure why the github release says September 4. |
1.80.0 didn't make much difference (in fact it added a few bytes on top, though not many). OK, then maybe the diff rings a bell with you… Maybe something similar with cargo, a la |
cargo dependencies are pinned in Ok, I think this part of the diff explains the problem.
I think v1.13.1 was compiled with a mix of two ndk versions. I realized the other day that when it was released, I ran a build just now if you want to compare against the d1ef781 apk instead, which has that issue fixed. edit: fix ANDROID_NDK_HOME typo |
Apologies for the delay, I had a guest this weekend and close to no time for looking at my computer… Have been running the APK against the indicated commit, APK diff does not look much different unfortunately: -rw-r--r-- 0.0 unx 10096 b- 10096 stor 1981-01-01 01:01:02 9734baa0 lib/arm64-v8a/libandroidx.graphics.path.so
- -rw-r--r-- 0.0 unx 157800 b- 157800 stor 1981-01-01 01:01:02 786f7a35 lib/arm64-v8a/libjnidispatch.so
- -rw-r--r-- 0.0 unx 1209768 b- 1209768 stor 1981-01-01 01:01:02 76d4ca7f lib/arm64-v8a/libopenscq30_android.so
+ -rw-r--r-- 0.0 unx 168280 b- 168280 stor 1981-01-01 01:01:02 1b8c8cf5 lib/arm64-v8a/libjnidispatch.so
+ -rw-r--r-- 0.0 unx 17526928 b- 17526928 stor 1981-01-01 01:01:02 4d80d3a1 lib/arm64-v8a/libopenscq30_android.so
-rw-r--r-- 0.0 unx 7252 b- 7252 stor 1981-01-01 01:01:02 9a714d3a lib/armeabi-v7a/libandroidx.graphics.path.so
- -rw-r--r-- 0.0 unx 112248 b- 112248 stor 1981-01-01 01:01:02 29014005 lib/armeabi-v7a/libjnidispatch.so
- -rw-r--r-- 0.0 unx 857116 b- 857116 stor 1981-01-01 01:01:02 60682a23 lib/armeabi-v7a/libopenscq30_android.so
+ -rw-r--r-- 0.0 unx 122372 b- 122372 stor 1981-01-01 01:01:02 9534dcc0 lib/armeabi-v7a/libjnidispatch.so
+ -rw-r--r-- 0.0 unx 14353020 b- 14353020 stor 1981-01-01 01:01:02 081a57fc lib/armeabi-v7a/libopenscq30_android.so
-rw-r--r-- 0.0 unx 122856 b- 122856 stor 1981-01-01 01:01:02 f07f9e68 lib/armeabi/libjnidispatch.so
-rw-r--r-- 0.0 unx 151000 b- 151000 stor 1981-01-01 01:01:02 6551d6ea lib/mips/libjnidispatch.so
-rw-r--r-- 0.0 unx 142016 b- 142016 stor 1981-01-01 01:01:02 f478dc20 lib/mips64/libjnidispatch.so
-rw-r--r-- 0.0 unx 9284 b- 9284 stor 1981-01-01 01:01:02 3d9afc66 lib/x86/libandroidx.graphics.path.so
- -rw-r--r-- 0.0 unx 112164 b- 112164 stor 1981-01-01 01:01:02 7d966995 lib/x86/libjnidispatch.so
- -rw-r--r-- 0.0 unx 1292124 b- 1292124 stor 1981-01-01 01:01:02 0496d3ac lib/x86/libopenscq30_android.so
+ -rw-r--r-- 0.0 unx 120256 b- 120256 stor 1981-01-01 01:01:02 84023c8f lib/x86/libjnidispatch.so
+ -rw-r--r-- 0.0 unx 14012680 b- 14012680 stor 1981-01-01 01:01:02 bb059457 lib/x86/libopenscq30_android.so
-rw-r--r-- 0.0 unx 10760 b- 10760 stor 1981-01-01 01:01:02 81bd88ae lib/x86_64/libandroidx.graphics.path.so
- -rw-r--r-- 0.0 unx 108712 b- 108712 stor 1981-01-01 01:01:02 5aea9ee1 lib/x86_64/libjnidispatch.so
- -rw-r--r-- 0.0 unx 1321888 b- 1321888 stor 1981-01-01 01:01:02 1b3d2b77 lib/x86_64/libopenscq30_android.so
+ -rw-r--r-- 0.0 unx 118688 b- 118688 stor 1981-01-01 01:01:02 0f6cffbb lib/x86_64/libjnidispatch.so
+ -rw-r--r-- 0.0 unx 16861088 b- 16861088 stor 1981-01-01 01:01:02 3db7a330 lib/x86_64/libopenscq30_android.so
-rw---- 2.0 fat 1738 b- 782 defN 1981-01-01 01:01:02 d5ac4dc2 DebugProbesKt.bin Now I wanted to compare the output of
100 times more strings in my build it seems. Recipe was basically unchanged: - git clone https://github.com/rust-lang/rustup.git -b 1.27.1
- export ANDROID_NDK=/opt/sdk/ndk/${PROVISIONING_NDK}
- ${BUILD_REPO_DIR}/rustup/rustup-init.sh -y --default-toolchain=1.80.1 --target armv7-linux-androideabi --target aarch64-linux-android --target i686-linux-android --target x86_64-linux-android
- source $HOME/.cargo/env
- cargo install cargo-ndk
- cd android
- ./gradlew assembleBluetoothRelease Now I'm confused. Looked inside the strings files for clang version: - Android (12470979, +pgo, +bolt, +lto, +mlgo, based on r522817c) clang version 18.0.3 (https://android.googlesource.com/toolchain/llvm-project d8003a456d14a3deb8054cdaa529ffbf02d9b262)
+ Android (11349228, +pgo, +bolt, +lto, -mlgo, based on r487747e) clang version 17.0.2 (https://android.googlesource.com/toolchain/llvm-project d9f89f4d16663d5012e5c09495f3b30ece3d2362) Still a different version. I can specify a |
Sorry, guess I should have specified. The master build is using rust 1.82 and NDK version 27.2.12479018, so when comparing against that rather than v1.13.1, you'll need to change the versions. |
Oof… yeah, with those many apps I deal with daily, being explicit in such cases is helpful 🙈 ok, so this recipe: - git clone https://github.com/rust-lang/rustup.git -b 1.27.1
- export ANDROID_NDK=/opt/sdk/ndk/${PROVISIONING_NDK}
- ${BUILD_REPO_DIR}/rustup/rustup-init.sh -y --default-toolchain=1.82.0 --target armv7-linux-androideabi --target aarch64-linux-android --target i686-linux-android --target x86_64-linux-android
- source $HOME/.cargo/env
- cargo install cargo-ndk
- cd android
- ./gradlew assembleBluetoothRelease with ndk 27.2.12479018 and JDK 17. -rw-r--r-- 0.0 unx 157800 b- 157800 stor 1981-01-01 01:01:02 786f7a35 lib/arm64-v8a/libjnidispatch.so
- -rw-r--r-- 0.0 unx 1209768 b- 1209768 stor 1981-01-01 01:01:02 76d4ca7f lib/arm64-v8a/libopenscq30_android.so
+ -rw-r--r-- 0.0 unx 1209176 b- 1209176 stor 1981-01-01 01:01:02 1d0135f0 lib/arm64-v8a/libopenscq30_android.so
-rw-r--r-- 0.0 unx 7252 b- 7252 stor 1981-01-01 01:01:02 9a714d3a lib/armeabi-v7a/libandroidx.graphics.path.so
-rw-r--r-- 0.0 unx 112248 b- 112248 stor 1981-01-01 01:01:02 29014005 lib/armeabi-v7a/libjnidispatch.so
- -rw-r--r-- 0.0 unx 857116 b- 857116 stor 1981-01-01 01:01:02 60682a23 lib/armeabi-v7a/libopenscq30_android.so
+ -rw-r--r-- 0.0 unx 856540 b- 856540 stor 1981-01-01 01:01:02 c65e3528 lib/armeabi-v7a/libopenscq30_android.so
-rw-r--r-- 0.0 unx 122856 b- 122856 stor 1981-01-01 01:01:02 f07f9e68 lib/armeabi/libjnidispatch.so
-rw-r--r-- 0.0 unx 151000 b- 151000 stor 1981-01-01 01:01:02 6551d6ea lib/mips/libjnidispatch.so
-rw-r--r-- 0.0 unx 142016 b- 142016 stor 1981-01-01 01:01:02 f478dc20 lib/mips64/libjnidispatch.so
-rw-r--r-- 0.0 unx 9284 b- 9284 stor 1981-01-01 01:01:02 3d9afc66 lib/x86/libandroidx.graphics.path.so
-rw-r--r-- 0.0 unx 112164 b- 112164 stor 1981-01-01 01:01:02 7d966995 lib/x86/libjnidispatch.so
- -rw-r--r-- 0.0 unx 1292124 b- 1292124 stor 1981-01-01 01:01:02 0496d3ac lib/x86/libopenscq30_android.so
+ -rw-r--r-- 0.0 unx 1291532 b- 1291532 stor 1981-01-01 01:01:02 f94d5813 lib/x86/libopenscq30_android.so
-rw-r--r-- 0.0 unx 10760 b- 10760 stor 1981-01-01 01:01:02 81bd88ae lib/x86_64/libandroidx.graphics.path.so
-rw-r--r-- 0.0 unx 108712 b- 108712 stor 1981-01-01 01:01:02 5aea9ee1 lib/x86_64/libjnidispatch.so
- -rw-r--r-- 0.0 unx 1321888 b- 1321888 stor 1981-01-01 01:01:02 1b3d2b77 lib/x86_64/libopenscq30_android.so
+ -rw-r--r-- 0.0 unx 1321312 b- 1321312 stor 1981-01-01 01:01:02 ddeb6ddc lib/x86_64/libopenscq30_android.so
-rw---- 2.0 fat 1738 b- 782 defN 1981-01-01 01:01:02 d5ac4dc2 DebugProbesKt.bin Diff between the strings is 50k again. - Android (12470979, +pgo, +bolt, +lto, +mlgo, based on r522817c) clang version 18.0.3 (https://android.googlesource.com/toolchain/llvm-project d8003a456d14a3deb8054cdaa529ffbf02d9b262)
+ Android (12470979, +pgo, +bolt, +lto, +mlgo, based on r522817c) clang version 18.0.3 (https://android.googlesource.com/toolchain/llvm-project d8003a456d14a3deb8054cdaa529ffbf02d9b262) OK, that one seems to match this time. Something else must be amiss. -Foreign pointer not set. This is likely a uniffi bug./home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/uniffi_core-0.28.2/src/ffi/foreigncallbacks.rs/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/sync/mpsc/list.rs
+Foreign pointer not set. This is likely a uniffi bug./build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/uniffi_core-0.28.2/src/ffi/foreigncallbacks.rs/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.41.0/src/sync/mpsc/list.rs Ah, that gives me a clue this time, let me check… build_home_dir: /build
build_repo_dir: /build/repo Hm, and github actions, huh? So: build_home_dir: /home/runner
build_repo_dir: /home/runner/work/OpenSCQ30/OpenSCQ30 should do the trick. Now I'm curious… Ha! Look what I got there: "upstream_signed_apk_sha256": "654639d50123fd2cfc78ff49b90cdb1e1bbeabc67fde18873fb27b5c5f8b2905",
"built_unsigned_apk_sha256": "654639d50123fd2cfc78ff49b90cdb1e1bbeabc67fde18873fb27b5c5f8b2905",
"signature_copied_apk_sha256": "654639d50123fd2cfc78ff49b90cdb1e1bbeabc67fde18873fb27b5c5f8b2905" That means we succeeded with an RB (both signed APKs are byte-identical, thus showing the same hash) 🥳 Any ETA for the next release, based upon this? 😃 |
Nice, thanks for your work on this. There's not really anything major left for the next feature release, so it'll probably be in around a week or so. |
Cool! Please give me a ping then (err, I guess as this issue is solved, closing it once the release is up would serve that purpose as well). Glad we finally figured it out – and thanks a lot for all your help and patience with the process!!! 🤩 |
I've followed the build instructions from the Readme to my best understanding, ending up with this build recipe:
However, the only APKs found are:
not the
android/app/build/outputs/apk/release/app-release-unsigned.apk
the readme mentions. As I didn't want a demo, I took the other one – but that's a 64 MB APK instead of the expected 7.5 MB one your releases indicate.Can you please let me know what I might have done wrong there? Thanks in advance!
The text was updated successfully, but these errors were encountered: