wasm3 / wasm3-rs

Rust wrapper for Wasm3, the fastest WebAssembly interpreter
MIT License
160 stars 44 forks source link

doesn't compile #16

Closed pventuzelo closed 4 years ago

pventuzelo commented 4 years ago

Hey,

I was trying to use it and I got:

error: failed to run custom build command for `wasm3-sys v0.1.1 (https://github.com/Veykril/wasm3-rs#7a5199ef)`

Caused by:
  process didn't exit successfully: `/home/scop/Documents/workspace/release/build/wasm3-sys-9fe8ce7aeab78f43/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'Unable to generate bindings: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /home/scop/.cargo/git/checkouts/wasm3-rs-136514b8b4045c53/7a5199e/wasm3-sys/build.rs:78:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I've tried both:

wasm3 = { git = "https://github.com/Veykril/wasm3-rs" }
# and using
wasm3 = "0.1.1"
Veykril commented 4 years ago

It seems like you do not have bindgen installed on your machine. To build the wrapper you currently need Clang 9 installed as well as Bindgen. You can skip installing bindgen and make the crate build it for you by specifying the build-bindgen feature.

pventuzelo commented 4 years ago

Thanks for the response, I tried with:

wasm3 = { git = "https://github.com/Veykril/wasm3-rs", features=["build-bindgen"]}

but I get this error now:

error[E0425]: cannot find value `WHITELIST_REGEX` in this scope
  --> /home/scop/.cargo/git/checkouts/wasm3-rs-136514b8b4045c53/7a5199e/wasm3-sys/build.rs:97:29
   |
10 | const WHITELIST_REGEX_VAR: &str = WHITELIST_REGEX_TYPE;
   | ------------------------------------------------------- similarly named constant `WHITELIST_REGEX_VAR` defined here
...
97 |         .whitelist_function(WHITELIST_REGEX)
   |                             ^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `WHITELIST_REGEX_VAR`

error[E0425]: cannot find value `WHITELIST_REGEX` in this scope
  --> /home/scop/.cargo/git/checkouts/wasm3-rs-136514b8b4045c53/7a5199e/wasm3-sys/build.rs:98:25
   |
10 | const WHITELIST_REGEX_VAR: &str = WHITELIST_REGEX_TYPE;
   | ------------------------------------------------------- similarly named constant `WHITELIST_REGEX_VAR` defined here
...
98 |         .whitelist_type(WHITELIST_REGEX)
   |                         ^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `WHITELIST_REGEX_VAR`

error[E0425]: cannot find value `WHITELIST_REGEX` in this scope
  --> /home/scop/.cargo/git/checkouts/wasm3-rs-136514b8b4045c53/7a5199e/wasm3-sys/build.rs:99:24
   |
10 | const WHITELIST_REGEX_VAR: &str = WHITELIST_REGEX_TYPE;
   | ------------------------------------------------------- similarly named constant `WHITELIST_REGEX_VAR` defined here
...
99 |         .whitelist_var(WHITELIST_REGEX)
   |                        ^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `WHITELIST_REGEX_VAR`

error: aborting due to 3 previous errors
Veykril commented 4 years ago

Looks like there was an error in the build script for when the feature was set, it should now compile with 9676702

pventuzelo commented 4 years ago

Awesome, that's working ;) Thanks