You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can build the rust wasm project successffuly. But when I write same dependencies, such as url, reqwest, openssl, I build failed. This error looks like the reason for using the rust2015 version, such as following:
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
Compiling net2 v0.2.33
Compiling failure_derive v0.1.5
Compiling ryu v0.2.8
Compiling serde v1.0.91
Compiling foreign-types v0.3.2
Compiling httparse v1.3.3
Compiling regex v1.1.6
Compiling regex-syntax v0.6.6
Compiling crc32fast v1.2.0
Compiling miniz_oxide v0.2.1
Compiling encoding_rs v0.8.17
Compiling rustc_version v0.2.3
Compiling rand_pcg v0.1.2
Compiling rand_chacha v0.1.1
Compiling rand v0.6.5
error[E0432]: unresolved import `sys`
--> /home/zmant/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/net2-0.2.33/src/tcp.rs:18:5
|
18 | use sys::c;
| ^^^ maybe a missing `extern crate sys;`?
error[E0432]: unresolved import `sys`
--> /home/zmant/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/net2-0.2.33/src/udp.rs:18:5
|
18 | use sys::c;
| ^^^ maybe a missing `extern crate sys;`?
error[E0432]: unresolved import `sys`
--> /home/zmant/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/net2-0.2.33/src/socket.rs:22:5
|
22 | use sys;
| ^^^ no `sys` in the root
error[E0432]: unresolved import `sys`
--> /home/zmant/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/net2-0.2.33/src/socket.rs:23:5
|
23 | use sys::c;
| ^^^ maybe a missing `extern crate sys;`?
error[E0432]: unresolved import `sys`
--> /home/zmant/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/net2-0.2.33/src/ext.rs:19:5
|
19 | use sys;
| ^^^ no `sys` in the root
error[E0432]: unresolved import `sys`
--> /home/zmant/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/net2-0.2.33/src/ext.rs:20:5
|
20 | use sys::c;
| ^^^ maybe a missing `extern crate sys;`?
Compiling rand_isaac v0.1.1
Compiling rand_xorshift v0.1.1
Compiling rand_hc v0.1.0
Compiling libc v0.2.55
error[E0412]: cannot find type `c_int` in this scope
--> /home/zmant/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/net2-0.2.33/src/socket.rs:30:24
|
30 | pub fn new(family: c_int, ty: c_int) -> io::Result<Socket> {
| ^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
|
11 | use std::os::raw::c_int;
But the relevant build tools are the latest, such as following:
I have been working on this problem for several days, and I haven't found a solution on other websites, such as stackoverflow. Can someone please help me to find out what the problem is.
Thanks you very much.
🐛 Bug description
When I clone the project template with this command:
I can build the rust wasm project successffuly. But when I write same dependencies, such as url, reqwest, openssl, I build failed. This error looks like the reason for using the rust2015 version, such as following:
But the relevant build tools are the latest, such as following:
I can successfully build net2 crates with
cargo build
commandI have been working on this problem for several days, and I haven't found a solution on other websites, such as stackoverflow. Can someone please help me to find out what the problem is.
Thanks you very much.
🤔 Expected Behavior
Build success
👟 Steps to reproduce
enter:
and then go to the
wasm-pack-template
floder.Edit the
Cargo.toml
such as:use
wasm-pack build
to build, will build failed! 100% reproduceDoes anyone have the same problem?
🌍 Your environment
wasm-pack version: wasm-pack 0.8.1
rustc version: rustc 1.36.0-nightly (73a3a90d2 2019-05-17)
The text was updated successfully, but these errors were encountered: