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

error: could not compile sapio-wasm-plugin-example due to 4 previous errors; 2 warnings emitted #150

Closed
bnonni opened this issue Nov 4, 2021 · 2 comments

Comments

@bnonni
Copy link

bnonni commented Nov 4, 2021

Resolving error: failed to build archive: section too large #146 by installing llvm and running AR=/usr/local/opt/llvm/bin/llvm-ar CC=/usr/local/opt/llvm/bin/clang wasm-pack build has led me to this error upon running this command:

Running on macOS Big Sur 11.6
Darwin alpha.local 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64

% AR=/usr/local/opt/llvm/bin/llvm-ar CC=/usr/local/opt/llvm/bin/clang wasm-pack build
[INFO]: 🎯  Checking for the Wasm target...
[INFO]: 🌀  Compiling to Wasm...
   Compiling proc-macro2 v1.0.32
   Compiling unicode-xid v0.2.2
   Compiling autocfg v1.0.1
   Compiling syn v1.0.81
   Compiling autocfg v0.1.7
   Compiling rand_core v0.4.2
   Compiling serde_derive v1.0.130
   Compiling serde v1.0.130
   Compiling ryu v1.0.5
   Compiling serde_json v1.0.68
   Compiling itoa v0.4.8
   Compiling schemars v0.8.6
   Compiling cc v1.0.71
   Compiling dyn-clone v1.0.4
   Compiling memchr v2.4.1
   Compiling cfg-if v1.0.0
   Compiling log v0.4.14
   Compiling bech32 v0.7.3
   Compiling wasm-bindgen-shared v0.2.78
   Compiling tinyvec_macros v0.1.0
   Compiling matches v0.1.9
   Compiling version_check v0.9.3
   Compiling parking_lot_core v0.8.5
   Compiling bumpalo v3.8.0
   Compiling scopeguard v1.1.0
   Compiling lazy_static v1.4.0
   Compiling smallvec v1.7.0
   Compiling unicode-bidi v0.3.7
   Compiling percent-encoding v2.1.0
   Compiling bit-vec v0.6.3
   Compiling regex-syntax v0.6.25
   Compiling time-macros v0.2.3
   Compiling base64 v0.13.0
   Compiling once_cell v1.8.0
   Compiling num-cmp v0.1.0
   Compiling wasm-bindgen v0.2.78
   Compiling paste v1.0.5
   Compiling hex v0.4.3
   Compiling rand_core v0.3.1
   Compiling rand_jitter v0.1.4
   Compiling rand_os v0.1.3
   Compiling instant v0.1.12
   Compiling rand_pcg v0.1.2
   Compiling rand_chacha v0.1.1
   Compiling rand v0.6.5
   Compiling tinyvec v1.5.0
   Compiling num-traits v0.2.14
   Compiling num-integer v0.1.44
   Compiling num-bigint v0.2.6
   Compiling num-iter v0.1.42
   Compiling num-complex v0.2.4
   Compiling num-rational v0.2.4
   Compiling lock_api v0.4.5
   Compiling form_urlencoded v1.0.1
   Compiling bit-set v0.5.2
   Compiling ahash v0.7.6
   Compiling rand_hc v0.1.0
   Compiling rand_isaac v0.1.1
   Compiling rand_xorshift v0.1.1
   Compiling secp256k1-sys v0.4.1
   Compiling quote v1.0.10
   Compiling aho-corasick v0.7.18
   Compiling parking_lot v0.11.2
   Compiling unicode-normalization v0.1.19
   Compiling time v0.3.4
   Compiling regex v1.5.4
   Compiling idna v0.2.3
   Compiling url v2.2.2
   Compiling fancy-regex v0.7.1
   Compiling num v0.2.1
   Compiling fraction v0.8.0
   Compiling serde_derive_internals v0.25.0
   Compiling wasm-bindgen-backend v0.2.78
   Compiling wasm-bindgen-macro-support v0.2.78
   Compiling schemars_derive v0.8.6
   Compiling sapio_macros v0.1.0 (/Users/hu5ky5n0w/Projects/Bitcoin/sapio/sapio_macros)
   Compiling wasm-bindgen-macro v0.2.78
   Compiling jsonschema v0.12.2
   Compiling sapio-secp256k1 v0.20.1
   Compiling bitcoin_hashes v0.9.7
   Compiling sapio-bitcoin v0.26.0
   Compiling sapio-miniscript v5.1.0
   Compiling sapio-base v0.1.0 (/Users/hu5ky5n0w/Projects/Bitcoin/sapio/sapio-base)
   Compiling sapio-ctv-emulator-trait v0.1.2 (/Users/hu5ky5n0w/Projects/Bitcoin/sapio/emulator-trait)
   Compiling sapio-trait v0.1.0 (/Users/hu5ky5n0w/Projects/Bitcoin/sapio/sapio-trait)
   Compiling sapio v0.1.2 (/Users/hu5ky5n0w/Projects/Bitcoin/sapio/sapio)
   Compiling sapio-wasm-plugin v0.1.4 (/Users/hu5ky5n0w/Projects/Bitcoin/sapio/plugins)
   Compiling batching-trait v0.1.0 (/Users/hu5ky5n0w/Projects/Bitcoin/sapio/plugin-example/batching-trait)
warning: function is never used: `json_wrapped_string`
  --> /Users/hu5ky5n0w/Projects/Bitcoin/sapio/plugins/src/lib.rs:15:4
   |
15 | fn json_wrapped_string<'de, D, T>(d: D) -> Result<T, D::Error>
   |    ^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: unused return value of `std::ffi::CString::from_raw` that must be used
  --> /Users/hu5ky5n0w/Projects/Bitcoin/sapio/plugins/src/client/exports.rs:48:5
   |
48 |     CString::from_raw(s);
   |     ^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_must_use)]` on by default
   = note: call `drop(from_raw(ptr))` if you intend to drop the `CString`

warning: `sapio-wasm-plugin` (lib) generated 2 warnings
   Compiling sapio-wasm-plugin-example v0.1.0 (/Users/hu5ky5n0w/Projects/Bitcoin/sapio/plugin-example/treepay)
error: cannot find macro `then` in this scope
  --> treepay/src/plugin.rs:76:5
   |
76 |     then! {
   |     ^^^^
   |
note: `then` is imported here, but it is an attribute: `#[then]`
  --> treepay/src/plugin.rs:11:5
   |
11 | use sapio::*;
   |     ^^^^^^^^

error: cannot find macro `then` in this scope
  --> treepay/src/plugin.rs:50:5
   |
50 |     then! {
   |     ^^^^
   |
note: `then` is imported here, but it is an attribute: `#[then]`
  --> treepay/src/plugin.rs:11:5
   |
11 | use sapio::*;
   |     ^^^^^^^^

warning: unused import: `sapio::util::amountrange::*`
  --> treepay/src/plugin.rs:10:5
   |
10 | use sapio::util::amountrange::*;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: unused import: `std::collections::VecDeque`
  --> treepay/src/plugin.rs:17:5
   |
17 | use std::collections::VecDeque;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0599]: no function or associated item named `expand` found for struct `PayThese` in the current scope
  --> treepay/src/plugin.rs:72:27
   |
44 | struct PayThese {
   | --------------- function or associated item `expand` not found for this
...
72 |     declare! {then, Self::expand}
   |                           ^^^^^^ function or associated item not found in `PayThese`

error[E0599]: no function or associated item named `expand` found for struct `TreePay` in the current scope
   --> treepay/src/plugin.rs:117:27
    |
24  | pub struct TreePay {
    | ------------------ function or associated item `expand` not found for this
...
117 |     declare! {then, Self::expand}
    |                           ^^^^^^ function or associated item not found in `TreePay`

For more information about this error, try `rustc --explain E0599`.
warning: `sapio-wasm-plugin-example` (lib) generated 2 warnings
error: could not compile `sapio-wasm-plugin-example` due to 4 previous errors; 2 warnings emitted
Error: Compiling your crate to WebAssembly failed
Caused by: failed to execute `cargo build`: exited with exit status: 101
  full command: "cargo" "build" "--lib" "--release" "--target" "wasm32-unknown-unknown"
@JeremyRubin
Copy link
Collaborator

should be fixed? are you on master?

@bnonni
Copy link
Author

bnonni commented Nov 5, 2021

Just pulled. All fixed! Thank you! Closing issue. Going to look through the commit to see what the fix was. @JeremyRubin

@bnonni bnonni closed this as completed Nov 5, 2021
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