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

Wasm errors building bindings locally #1

Closed
galderz opened this issue Feb 5, 2021 · 4 comments
Closed

Wasm errors building bindings locally #1

galderz opened this issue Feb 5, 2021 · 4 comments

Comments

@galderz
Copy link
Contributor

galderz commented Feb 5, 2021

I've tried to build the bindings locally but I got some errors:

With debug=true:

❯ ./genbindings.sh /opt/matt-rust-lightning "-I/opt/java-11/include/ -I/opt/java-11/include/linux/" true false
Creating Java bindings...
Building Java bindings...
Creating TS bindings...
Building TS bindings...
clang-11: error: no such file or directory: '/opt/matt-rust-lightning/lightning-c-bindings/target/wasm32-wasi/debug/libldk.a'

With debug=false:

❯ ./genbindings.sh /opt/matt-rust-lightning "-I/opt/java-11/include/ -I/opt/java-11/include/linux/" true false
Creating Java bindings...
Building Java bindings...
Creating TS bindings...
Building TS bindings...
clang-11: error: no such file or directory: '/opt/matt-rust-lightning/lightning-c-bindings/target/wasm32-wasi/debug/libldk.a'
@TheBlueMatt
Copy link
Collaborator

Oops, right, I need to push the changes that also support building wasm rust binaries. A cargo build --target=wasm32-wasi in lightning-c-bindings should do it, but note that rust-lightning needs to depend on a newer version of rust-bitcoin (or pull the patch from rust-bitcoin/rust-secp256k1#242) and you need rustc nightly to get the new wasm32-wasi ABI (which matches clang's ABI).

@galderz
Copy link
Contributor Author

galderz commented Feb 8, 2021

Fair enough. TBH, I don't need wasm stuff right now. I didn't check it in detail, but it'd appear that in spite of the error, the Java bindings would be generated. They're the ones I'm looking to try out and the ones I'd like to make sure I can build locally in case I need to modify anything.

@TheBlueMatt
Copy link
Collaborator

Correct, the Java bindings should be generated fine in spite of the WASM build failures.

@TheBlueMatt
Copy link
Collaborator

This should now work with latest upstream as long as you use rustc nightly/beta.

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

No branches or pull requests

2 participants