Android gradle9 pin barcode scanner and its deps - #10846
Conversation
7d7c8f2 to
94c3bba
Compare
657b898 to
53f0ddf
Compare
- pin toolchain to container provided toolchain for BarcodeScannerView, CameraView and zxing-cpp - explicitly pin CMake in make_barcode_scanner.sh - this requires patching the checked out sources - upgrade zxing-cpp to 3.1.0.0 - upgrade CameraView to 1.10.2 (fixes potential NPE on visibiity change) - call all gradle builds with android.builder.sdkDownload=false to force use of pinned SDK, fail otherwise. - pin gradle itself using distributionSha256Sum Note: since gradle now refuses to use other SDKs than the one provided by P4A, the patches need (probably slight) maintenance when buildozer SDK is updated.
…ing locally built artifacts
53f0ddf to
8590849
Compare
… and zxing-cpp, pinning the dependency trees of these modules. also adds metadata generation script make_verification_metadata.sh, which should be run from within the build container.
| CAMERA_VIEW_VERSION="1.10.2" | ||
|
|
||
| ZXING_CPP_COMMIT_HASH="79f5adc6250e90de0bd635eb9181c5f8a18affda" # v2.3.0.4 using kotlin-stdlib 1.8.22 | ||
| ZXING_CPP_COMMIT_HASH="e88bb1d9e43502ad7073d29ee72cea4b758c1125" # v3.1.0.0 using kotlin-stdlib 2.2.10 |
There was a problem hiding this comment.
probably, but will need to test.
| android.gradle_dependencies = | ||
| androidx.core:core:1.16.0, | ||
| org.jetbrains.kotlin:kotlin-stdlib:1.8.22 | ||
| org.jetbrains.kotlin:kotlin-stdlib:2.2.10 |
There was a problem hiding this comment.
How come all the verification-metadata xml files are for the QR scanner? I would have expected some java deps to be pulled in through python-for-android, for the main Electrum code. For example, what about this androidx.core? How come that's not pinned in an xml file? Does gradle not download that?
There was a problem hiding this comment.
How come all the verification-metadata xml files are for the QR scanner? I would have expected some java deps to be pulled in through python-for-android, for the main Electrum code. For example, what about this
androidx.core? How come that's not pinned in an xml file? Does gradle not download that?
The QR scanner was the scope for this PR, pinning the dependencies above probably needs additional changes in our P4A fork.
There was a problem hiding this comment.
How many more dependencies would that represent? (the ones that are not pinned yet)
There was a problem hiding this comment.
This is madness. Are all these transitive deps really pulled in only for the QR scanner? 500+ deps. Completely unrealistic to vet/review. Thanks a lot for looking into pinning this -- without that I would not have realised we are apparently pulling in the world...
If we tried to switch to your PoC QtMultimedia scanner, could we drop all these?
(Maybe since switching to Qt 6.10, it would no longer be crashing?)
There was a problem hiding this comment.
This is madness. Are all these transitive deps really pulled in only for the QR scanner? 500+ deps. Completely unrealistic to vet/review. Thanks a lot for looking into pinning this -- without that I would not have realised we are apparently pulling in the world...
Agreed, it feels a bit.. fragile. I was in doubt whether to include the last commit in this PR for the same reasons, but on the other hand, what's the use of pinning only the top of the dep hierarchy..
If we tried to switch to your PoC QtMultimedia scanner, could we drop all these? (Maybe since switching to Qt 6.10, it would no longer be crashing?)
Yes. However, the last time I dug into this, I saw there were some patches upstream around Qt6.6-6.8 claiming to fix some stability problems with it. No idea if it's stable now, at least it seemed to received some eyeballs.
Note that there were issues on Android8 w.r.t QtMultimedia (don't remember exactly what, likely a NPE/SEGV at init) and was disabled in spesmilo/python-for-android@375a05d
BTW, It wasn't really a PoC scanner, it was the implementation we used while on Qt5.
This PR upgrades gradle used in P4A to 9.4.1 (AGP 9.1.0) and patches the barcode scanner components
to pin to the p4a provided toolchain, upgrades xzing-cpp to 3.1.0.0, CameraView to 1.10.2