Feat: Android support#158
Conversation
|
This looks nice, can you rebase this? |
55272e4 to
378a3bc
Compare
|
Changelog:
|
a2c959f to
0f3252f
Compare
|
I reduced a lot the code and i think this is the concise version to support android |
|
|
alexanderwiederin
left a comment
There was a problem hiding this comment.
From what I understand the ubuntu boost packages don't ship with the cmake config that core needs when cross-compiling.
Am I right that you got it working on nix locally? If so, can we stick with with only supporting the nix build for android?
Edit: see the comment below |
|
Correction, I changed my mind... The idea is that the |
479401e to
30f44a8
Compare
|
Okay the android build being exclusive for nix made things easier for this PR, the changes on build.rs are minimal... I included some inline doc comments so the reviewer can follow why each line were added. I added a section on the readme explaining the android build but its not that explanatory in a level that one can learn how to build this lib to android, do you guys think thats needed ? I can extend the docs to include instructions for one to reproduce it on a downstream |
There was a problem hiding this comment.
Great to see this working.
If we land the hand-written bindings PR (#163) first, the changes in build.rs should become simpler. I would suggest we wait for it.
|
@jaoleal I'm interested in getting this change through. Can you rebase it and address Alex' comments? |
Yes, sorry for taking long... I was waiting for the bindgen pr to be merged so we had sure what that would imply here without rebasing on a pr |
f1fed04 to
5387332
Compare
|
Addressed suggestions @sedited @alexanderwiederin |
| ## [0.2.1] 2026-05-20 | ||
|
|
||
| ### Added | ||
| - Added Nix package outputs for Android with bundled NDK r27, Rust toolchains, Boost, and cmake. |
There was a problem hiding this comment.
This needs to go in a new ###Added entry in the unreleased section.
|
@jaoleal how are you testing the build artifacts? Are you running the tests in some emulated environment, or do you just link the kernel crate into an existing project and observe that there are no failures? |
None of these, I got satisfied by the build succeeding since testing this can be tricky... Are you looking into CI tests for this ? But youre correct, we should be testing the outputs. Testing it using floresta will be hard but ill look into it. |
|
Ah, I thought this was intended for eventual floresta integration. Or what was your motivation for working on it? |
Well, yes, im fixing a "floresta-issue" here but allow me to expose the whole picture. Floresta uses bitcoin-kernel only for script validation, whitout the bitcoin-kernel feature, floresta just skips script validation. Mandacaru, basically a port of floresta to android, needs floresta running on android, and is currently skipping script validation. To test this using floresta i would need to: 1. Make floresta use this current And this would not result in a satisfatory test because floresta would only exercise script validation. Too hard for basically useless results. AFAIK the best solution to be sure that bitcoin-kernel is indeed working on android is by adding a test in CI running inside an emulated environment, ill push it and lets see how it goes |
|
I'm also fine with just leaving it be for now and handling that in a follow-up pull request. Having something link is already a good assurance :) |
Build instructions for targeting android expecting it to be executed in nix move internal changelog to unreleased
Outputs and environment setup for building android. move nix changelog to unreleased
9eb3d5c to
d5724e1
Compare
This commit introduces preparation for testing in both Nix and CI. Testing android outputs is restricted to x86_64-linux machines for simplicity. QEMU user-mode emulation is configured as the Cargo test runner for cross-compiled Android targets. fix formatting
|
Ok, done. 32115fc Addressed suggestions:
cc @sedited take a look on https://github.com/sedited/rust-bitcoinkernel/actions/runs/26413972282/job/77754301637#step:4:6483 |
This pr contain 3 commits:
This is just a PoC, the main commit is the third one and the CI job containing the android building at that point should run fine.
For more context read #156