Closed zoedberg closed 3 years ago
I don't know the reason of many of the reported problems encountered while debugging.
But I've figured out why the library produced from rgb-sdk
(with the cargo build
on top of build_rust.sh
) wasn't linking correctly the libraries. I was accidentally overriding the librgb.so
generated from clang++
with the one generated by cargo
, by forgetting to remove a cp
from build_rust.sh
(was necessary only when the project was inside rgb-node
).
Now the library gets successfully loaded by the android app. :)
P.S. I'll open a dedicated PR for the mentioned Dockerfile, it still needs some fixes
Zoe, the work you've done in investigating and describing thos issues is really important. I am quite sure that many may run into them, and having them sorted out once and for all is really needed. So thank you very much for your efforts!
I am glad that you've managed to fix builder code to get android app linked properly. Just a few comments on the parts of issues above that I've encountered myself and know how to fix, for the history record.
secp256k1 version problem is unrelated to everything else and is caused by downstream dependency bug, which will be solved with the next release. More details can be found here: https://github.com/rust-bitcoin/rust-miniscript/pull/152#issuecomment-706180804 (+ comments above) and the fix tracking issue is here: https://github.com/rust-bitcoin/rust-secp256k1/pull/237#issuecomment-706180042
Before we will do a first full release of both LNP/BP Core Library and RGB Node crates to crates.io we have to rely on fixes for upstream dependencies appended in Cago.toml
patch section. This have to be done in every crate using either LNP/BP Core or RGB Node, including SDK. Without it you will get a plenty of cargo complains and error reports. Samples and more details:
After updating android integration in this project, trying run
./gradlew build
I've encountered this error:After a
cargo clean
the same error can appear forlnpbp_derive
. Both dependencies areproc-macro
and are lnp-bp forks. The symbol__errno
is defined inlibc.so
but inlibamplify_derive_xxx.so
andliblnpbp_derive_xxx.so
the symbol is actually undefined and unlinked (inspected withnm
). Same error happens when building fromrgb-node
v0.1.0-rc.1
.To avoid mixing possible project update errors (since integrations have been moved to separate project, there's the possibility I forgot/mistaken to update some paths/commands), I re-added android integration on
rgb-node
master
(as it was before removing it, see this branch) and I receive a different error:Which is pretty strange since
miniscript v2.0.0
(commitba436de
) has definedbitcoin v0.25.0
(taglnpbp-v0.1.0-rc1
) in itsCargo.toml
, notv0.24.0
as the error message reports.I've tried to cross-compile
rust-lnpbp
, since it seems to be the package that's causing these problems, and it returns the first error I've reported (undefined symbol: __errno
on(lnpbp|amplify)_derive
).On
rgb-sdk
, inffi/android/build_rust.sh
, I've added acargo build
(without--target
, so amd64) on top of the file. That causes the android build to succeed. But then, when loading thelibrary-debug.aar
on the android react native demo I receive this error:That's strange too, since that symbol should be in
libc++_shared.so
. In order to verify this, I've done the following:I've added a Dockerfile that may help debugging the situation, both in
rgb-sdk
and inrgb-node
. Onrgb-node
the behavior is consistent with the local one (fail caused bysecp256k1-sys
). Onrgb-sdk
the behavior is inconsistent with the local one, the build is still successful, but the package doesn't contain thejni
directory with the*.so
files:This actually happened to me also locally, but I haven't determined what causes and fixes that yet.