-
Notifications
You must be signed in to change notification settings - Fork 411
0.0.13 Bindings Updates #829
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
0.0.13 Bindings Updates #829
Conversation
8fd57fe
to
ef889b1
Compare
Codecov Report
@@ Coverage Diff @@
## main #829 +/- ##
=======================================
Coverage 90.98% 90.98%
=======================================
Files 48 48
Lines 26538 26538
=======================================
Hits 24145 24145
Misses 2393 2393
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm... getting some errors. Presumably I'll need to install something. Should the README
be updated with instructions?
+ cargo rustc -v --target=wasm32-wasi -- -C embed-bitcode=yes
Fresh cc v1.0.65
Compiling bech32 v0.7.2
Compiling bitcoin_hashes v0.9.4
Running `rustc --crate-name bech32 /Users/jkczyz/.cargo/registry/src/i.8713187.xyz-1ecc6299db9ec823/bech32-0.7.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C panic=abort -Cembed-bitcode=no -C debuginfo=2 -C metadata=92a5811ea903a31d -C extra-filename=-92a5811ea903a31d --out-dir /Users/jkczyz/src/rust-lightning-review/lightning-c-bindings/target/wasm32-wasi/debug/deps --target wasm32-wasi -L dependency=/Users/jkczyz/src/rust-lightning-review/lightning-c-bindings/target/wasm32-wasi/debug/deps -L dependency=/Users/jkczyz/src/rust-lightning-review/lightning-c-bindings/target/debug/deps --cap-lints allow`
Running `rustc --crate-name bitcoin_hashes /Users/jkczyz/.cargo/registry/src/i.8713187.xyz-1ecc6299db9ec823/bitcoin_hashes-0.9.4/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C panic=abort -Cembed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=f887dca6f663bbeb -C extra-filename=-f887dca6f663bbeb --out-dir /Users/jkczyz/src/rust-lightning-review/lightning-c-bindings/target/wasm32-wasi/debug/deps --target wasm32-wasi -L dependency=/Users/jkczyz/src/rust-lightning-review/lightning-c-bindings/target/wasm32-wasi/debug/deps -L dependency=/Users/jkczyz/src/rust-lightning-review/lightning-c-bindings/target/debug/deps --cap-lints allow`
Compiling secp256k1-sys v0.4.0 (https://github.com/TheBlueMatt/rust-secp256k1?rev=15a0d4195a20355f6b1e8f54c84eba56abc15cbd#15a0d419)
Running `/Users/jkczyz/src/rust-lightning-review/lightning-c-bindings/target/debug/build/secp256k1-sys-26c8f0d1d2fb5878/build-script-build`
The following warnings were emitted during compilation:
warning: error: unable to create target: 'No available targets are compatible with this triple.'
warning: 1 error generated.
error: failed to run custom build command for `secp256k1-sys v0.4.0 (https://github.com/TheBlueMatt/rust-secp256k1?rev=15a0d4195a20355f6b1e8f54c84eba56abc15cbd#15a0d419)`
Caused by:
process didn't exit successfully: `/Users/jkczyz/src/rust-lightning-review/lightning-c-bindings/target/debug/build/secp256k1-sys-26c8f0d1d2fb5878/build-script-build` (exit code: 1)
--- stdout
TARGET = Some("wasm32-wasi")
OPT_LEVEL = Some("0")
HOST = Some("x86_64-apple-darwin")
CC_wasm32-wasi = None
CC_wasm32_wasi = None
TARGET_CC = None
CC = None
CFLAGS_wasm32-wasi = None
CFLAGS_wasm32_wasi = None
TARGET_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CC_wasm32-wasi = None
CC_wasm32_wasi = None
TARGET_CC = None
CC = None
CFLAGS_wasm32-wasi = None
CFLAGS_wasm32_wasi = None
TARGET_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
running: "clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=wasm32-wasi" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-I" "wasm-sysroot" "-Wall" "-Wextra" "-DSECP256K1_BUILD=1" "-DENABLE_MODULE_ECDH=1" "-DENABLE_MODULE_SCHNORRSIG=1" "-DENABLE_MODULE_EXTRAKEYS=1" "-DECMULT_GEN_PREC_BITS=4" "-DUSE_NUM_NONE=1" "-DUSE_FIELD_INV_BUILTIN=1" "-DUSE_SCALAR_INV_BUILTIN=1" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-DENABLE_MODULE_RECOVERY=1" "-o" "/Users/jkczyz/src/rust-lightning-review/lightning-c-bindings/target/wasm32-wasi/debug/build/secp256k1-sys-2767aebdf7cf1ca9/out/depend/secp256k1/contrib/lax_der_parsing.o" "-c" "depend/secp256k1/contrib/lax_der_parsing.c"
cargo:warning=error: unable to create target: 'No available targets are compatible with this triple.'
cargo:warning=1 error generated.
exit code: 1
--- stderr
error occurred: Command "clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=wasm32-wasi" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-I" "wasm-sysroot" "-Wall" "-Wextra" "-DSECP256K1_BUILD=1" "-DENABLE_MODULE_ECDH=1" "-DENABLE_MODULE_SCHNORRSIG=1" "-DENABLE_MODULE_EXTRAKEYS=1" "-DECMULT_GEN_PREC_BITS=4" "-DUSE_NUM_NONE=1" "-DUSE_FIELD_INV_BUILTIN=1" "-DUSE_SCALAR_INV_BUILTIN=1" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-DENABLE_MODULE_RECOVERY=1" "-o" "/Users/jkczyz/src/rust-lightning-review/lightning-c-bindings/target/wasm32-wasi/debug/build/secp256k1-sys-2767aebdf7cf1ca9/out/depend/secp256k1/contrib/lax_der_parsing.o" "-c" "depend/secp256k1/contrib/lax_der_parsing.c" with args "clang" did not execute successfully (status code exit code: 1).
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for `std`
|
= note: the `wasm32-wasi` target may not be installed
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `std`
|
= note: the `wasm32-wasi` target may not be installed
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
error: build failed
+ echo 'WARNING: Failed to generate WASM LLVM-bitcode-embedded library'
WARNING: Failed to generate WASM LLVM-bitcode-embedded library
+ CARGO_PROFILE_RELEASE_LTO=true
+ cargo rustc -v --release --target=wasm32-wasi -- -C opt-level=s -C linker-plugin-lto -C lto
Fresh cc v1.0.65
Compiling bech32 v0.7.2
Compiling bitcoin_hashes v0.9.4
Running `rustc --crate-name bech32 /Users/jkczyz/.cargo/registry/src/i.8713187.xyz-1ecc6299db9ec823/bech32-0.7.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C panic=abort -Clinker-plugin-lto -C metadata=eddf55f3d9fa7cac -C extra-filename=-eddf55f3d9fa7cac --out-dir /Users/jkczyz/src/rust-lightning-review/lightning-c-bindings/target/wasm32-wasi/release/deps --target wasm32-wasi -L dependency=/Users/jkczyz/src/rust-lightning-review/lightning-c-bindings/target/wasm32-wasi/release/deps -L dependency=/Users/jkczyz/src/rust-lightning-review/lightning-c-bindings/target/release/deps --cap-lints allow`
Compiling secp256k1-sys v0.4.0 (https://github.com/TheBlueMatt/rust-secp256k1?rev=15a0d4195a20355f6b1e8f54c84eba56abc15cbd#15a0d419)
Running `rustc --crate-name bitcoin_hashes /Users/jkczyz/.cargo/registry/src/i.8713187.xyz-1ecc6299db9ec823/bitcoin_hashes-0.9.4/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C panic=abort -Clinker-plugin-lto --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=baef145ce6ae43f7 -C extra-filename=-baef145ce6ae43f7 --out-dir /Users/jkczyz/src/rust-lightning-review/lightning-c-bindings/target/wasm32-wasi/release/deps --target wasm32-wasi -L dependency=/Users/jkczyz/src/rust-lightning-review/lightning-c-bindings/target/wasm32-wasi/release/deps -L dependency=/Users/jkczyz/src/rust-lightning-review/lightning-c-bindings/target/release/deps --cap-lints allow`
Running `rustc --crate-name build_script_build /Users/jkczyz/.cargo/git/checkouts/rust-secp256k1-4eba1ec55b4aaf08/15a0d41/secp256k1-sys/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -Cembed-bitcode=no --cfg 'feature="recovery"' --cfg 'feature="std"' -C metadata=913d5e27f89a4b0c -C extra-filename=-913d5e27f89a4b0c --out-dir /Users/jkczyz/src/rust-lightning-review/lightning-c-bindings/target/release/build/secp256k1-sys-913d5e27f89a4b0c -L dependency=/Users/jkczyz/src/rust-lightning-review/lightning-c-bindings/target/release/deps --extern cc=/Users/jkczyz/src/rust-lightning-review/lightning-c-bindings/target/release/deps/libcc-eb00dbf091a70778.rlib --cap-lints allow`
error[E0463]: can't find crate for `std`
|
= note: the `wasm32-wasi` target may not be installed
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
error: could not compile `bech32`.
Caused by:
process didn't exit successfully: `rustc --crate-name bech32 /Users/jkczyz/.cargo/registry/src/i.8713187.xyz-1ecc6299db9ec823/bech32-0.7.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C panic=abort -Clinker-plugin-lto -C metadata=eddf55f3d9fa7cac -C extra-filename=-eddf55f3d9fa7cac --out-dir /Users/jkczyz/src/rust-lightning-review/lightning-c-bindings/target/wasm32-wasi/release/deps --target wasm32-wasi -L dependency=/Users/jkczyz/src/rust-lightning-review/lightning-c-bindings/target/wasm32-wasi/release/deps -L dependency=/Users/jkczyz/src/rust-lightning-review/lightning-c-bindings/target/release/deps --cap-lints allow` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for `std`
|
= note: the `wasm32-wasi` target may not be installed
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
error: build failed
ef889b1
to
98e791f
Compare
Correct me if I'm wrong, but the error you got shouldn't be fatal? In any case, I added a check before calling the wasm cargo build's so you shouldn't see it anymore at all. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct me if I'm wrong, but the error you got shouldn't be fatal? In any case, I added a check before calling the wasm cargo build's so you shouldn't see it anymore at all.
Correct, not fatal, but now it is. :P Looks like the error might be misleading or we're checking for the wrong thing.
$ rustc --print target-list | grep wasm32-wasi
wasm32-wasi
98e791f
to
45b21a6
Compare
Oops, right, its not a rustc issue, its a clang issue. I pushed a fix that works on linux but let me know how it looks on OSX (it should always fail unless you update clang to point to a locally-installed version that supports wasm32). |
All good now.
|
`wait` doesn't capture enough of what's going on, but also Java Java doesn't accpet methods just called `wait`, as it conflicts with existing sync primitives on all Objects.
When the (somewhat anti-pattern) `impl Deref for X { type Target = X; .. }` is used, this avoids an infinite dereference exception trying to figure out what type to resolve `is_null` against.
Specifically, this is required for some paths which use `Option<msgs::Message>`.
This is largely useful for bindings, and the off-github discussion around lightningdevkit#814 concluded these should be pub, but the PR was not updated to capture this. Now that the bindings support generation for the structs, expose them.
Squashed the bindings updates (with no change from the previous commit - The full non-bindings updates in this PR are:
|
45b21a6
to
f1b4534
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️ genbindings works
✔️ wait
rename seems reasonable, didn't miss any renames
✔️ pub
peer_handler.rs
changes seem reasonable
Few minor things to get bindings working on the changes slated for 0.0.13 and one non-bindings function rename (the function name
wait
can't be used in Java, and while we could rename it on the Java end, adding more context in Rust didn't seem bad to me).