wasm-pack
wasm-pack copied to clipboard
failed to download binaryen-version_90-x86-windows.tar.gz
🐛 Bug description
Describe your issue in detail.
wasm-pack
download error
🤔 Expected Behavior
What should have happened? I am beginner for Rust and Webassembly , I follow the Hello, World! to do
I am run
$ wasm-pack build
λ wasm-pack build
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
warning: function is never used: `set_panic_hook`
--> src\utils.rs:1:8
|
1 | pub fn set_panic_hook() {
| ^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: 1 warning emitted
Finished release [optimized] target(s) in 0.10s
Error: failed to download from https://github.com/WebAssembly/binaryen/releases/download/version_90/binaryen-version_90-x86-windows.tar.gz
To disable `wasm-opt`, add `wasm-opt = false` to your package metadata in your `Cargo.toml`.
My Internet is so bad that I want manually install binaryen-version_90-x86-windows.tar.gz
OS: Window10
Now I have binaryen-version_90-x86-windows.tar.gz
asm2wasm.exe binaryen.dll wasm-as.exe wasm-ctor-eval.exe wasm-dis.exe wasm-emscripten-finalize.exe wasm-metadce.exe wasm-opt.exe wasm-reduce.exe wasm-shell.exe wasm2js.exe
Where should I put in this file ?
And I try to wasm-pack
again
It's will stop in
λ wasm-pack.exe build
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
warning: function is never used: `set_panic_hook`
--> src\utils.rs:1:8
|
1 | pub fn set_panic_hook() {
| ^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: 1 warning emitted
Finished release [optimized] target(s) in 0.25s
👟 Steps to reproduce
Clear steps describing how to reproduce the issue, including commands and flags run. If you are seeing an error, please include the full error message and stack trace.
🌍 Your environment
Include the relevant details of your environment.
wasm-pack version:wasm-pack 0.9.1
rustc version:rustc 1.44.0 (49cae5576 2020-06-01)
I have the same problem.I download binaryen-version_90-x86-windows.tar.gz
via web browser while I don't know where to install it.Can you share it with me? As for the problem you mentioned, it should not be a serious one.It just mean function set_panic_hook
is not used. It just a tip for program optimization.
By the way , wasm-pack
don't generate package.json
file so When I npm install
npm ERR! Could not install from "..\pkg" as it does not contain a package.json file.
And wasm-pack
retry ,It's stop What I say above.
So, can you tell me where binaryen-version_90-x86-windows.tar.gz
should be installed?
@asurance open Assets find version_90
Assets
and click
I know where to download and I had downloaded.I just don't know where to install.I tried C:\Users\***\.cargo\bin
, but it took no effect.
as same
I find it can be skipped by cargo install wasm-bindgen-cli
.Maybe you can try too.
@asurance
λ cargo install wasm-bindgen-cli
Updating `https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git` index
error: binary `wasm-bindgen-test-runner.exe` already exists in destination
binary `wasm-bindgen.exe` already exists in destination
binary `wasm2es6js.exe` already exists in destination
Add --force to overwrite
don't work
I have the same error. For now I've disabled optimization by adding this in my Cargo.toml
[package.metadata.wasm-pack.profile.release]
wasm-opt = false
I hope someone give a proper answer.
This issue is a duplicate of https://github.com/rustwasm/wasm-pack/issues/886 I believe
This issue is a duplicate of #886 I believe
I don't think so, because #886 was fixed/closed, but this problem persists
I met the same problem in Ubuntu 20.04 LTS. Hope to find the way to solve it. Here is my configuration:
- rustwasmc 0.1.29
- cargo 1.50.0 (f04e7fab7 2021-02-04)
I met the same problem in Ubuntu 20.04 LTS. Hope to find the way to solve it. Here is my configuration:
- rustwasmc 0.1.29
- cargo 1.50.0 (f04e7fab7 2021-02-04)
add more infomation:
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
Finished release [optimized] target(s) in 0.03s
:-) [WARN]: origin crate has no README
[INFO]: Installing wasm-bindgen...
[INFO]: Installing wasm-opt...
Error: failed to download from https://github.com/WebAssembly/binaryen/releases/download/version_90/binaryen-version_90-x86_64-linux.tar.gz
To disable `wasm-opt`, add `wasm-opt = false` to your package metadata in your `Cargo.toml`.
My cargo.toml is:
[package]
name = "rust_mobilenet_food"
version = "0.1.0"
authors = ["ubuntu"]
edition = "2018"
[lib]
name = "rust_mobilenet_food_lib"
path = "src/lib.rs"
crate-type = ["cdylib"]
[dependencies]
wasm-bindgen = "=0.2.61"
wasmedge_tensorflow_interface = "^0.2.0"
image = { version = "0.23.0", default-features = false, features = ["jpeg", "png", "gif"] }
imageproc = "0.21.0"
serde = { version = "^1.0.59", features = ["derive"] }
serde_json = "^1.0.51"
urlencoding = "1.3.3"
my env:
- rustc 1.50.0 (cb75ad5db 2021-02-10)
- cargo 1.50.0 (f04e7fab7 2021-02-04)
- rustwasmc 0.1.29
This recently has started failing for me using Github Actions. The workarounds mentioned in https://github.com/rustwasm/wasm-pack/issues/886 do not fix this, only disabling wasm-opt = false
Error: failed to download from https://github.com/WebAssembly/binaryen/releases/download/version_90/binaryen-version_90-x86-linux.tar.gz
To disable `wasm-opt`, add `wasm-opt = false` to your package metadata in your `Cargo.toml`.
Error: Process completed with exit code 1.
My current workaround is to manually download and run wasm-opt:
wget -O /tmp/binaryen-version_90-x86-linux.tar.gz https://github.com/WebAssembly/binaryen/releases/download/version_90/binaryen-version_90-x86-linux.tar.gz
tar -xvf /tmp/binaryen-version_90-x86-linux.tar.gz -C /tmp
/tmp/binaryen-version_90/wasm-opt <file>.wasm -o <file>.wasm -Oz
replace dependency with the latest version wasm-bindgen = "0.2.78" works for me, i don`t know why
@asurance I'm not sure what went wrong on your side, but manually installing into C:\Users\<user-name>\.cargo\bin
worked for me.
the lastest version 0.2.83
worked successfully.
change the dependence version from specifiy to 0.2
, such as change 0.2.63
to 0.2
@tafia do you happen to know how to set the metadata for Cargo workspaces in order to work around this?
The file seems to be truly missing from the location it is expecting to download it from . Running the following to install from source resolved the wasm-opt error:
cargo install wasm-bindgen-cli
Maybe you use npm/yarn install wasm-pack.
Just remove it and use cargo install instead.
yarn global remove wasm-pack
cargo install wasm-pack
This work for me(Macos):
wget -O /tmp/binaryen.tar.gz https://github.com/WebAssembly/binaryen/releases/download/version_111/binaryen-version_111-x86_64-macos.tar.gz
tar -xvf /tmp/binaryen.tar.gz -C /tmp
cp /tmp/binaryen-version_111/bin/wasm-opt ~/.cargo/bin/
cp -r /tmp/binaryen-version_111/lib ~/.cargo/
rm -rf /tmp/binaryen.tar.gz /tmp/binaryen-version_111/
wired,i can download the file by using browser, but clion just failed.
我也遇到了相同的问题,不过我已经解决了。
我的环境是windows,但是我想其他系统的解决方式应该差不多,因为我是在查看wasm-pack的源码时,发现的一个可行的处理办法。
如果你想知道具体源码是什么,建议自行前往并寻找,这并不复杂。
关键在于,wasm-pack在下载前,会使用 which::which("wasm-opt")
查找相关的可执行文件位置。而which会在环境变量的PATH中进行寻找。
所以最后的解决办法很简单,在windows上,请把你下载的binaryen-version_90-x86-windows.tar.gz
压缩包内的内容,放置到一个提前准备好wasm-opt
的文件夹内,例如:D:\rust\binaryen\wasm-opt
。
最后将这个路径加入系统环境变量PATH中:D:\rust\binaryen\wasm-opt\bin
。
注意设置好环境变量后,需要重新打开一个新的命令控制台。
en I had the same problem, but I already solved it.
My environment is Windows, but I think the solution for other systems should be similar, because I found a feasible solution when I was viewing the source code of wasm-pack
.
If you want to know the specific source code, it is recommended to go and find it yourself, which is not complicated.
The key is that before downloading, wasm-pack
will use which::which("wasm-opt")
to find the location of the relevant executable file. And which
will look in the PATH environment variable.
So the final solution is very simple, on Windows, please place the contents of the downloaded binaryen-version_90-x86-windows.tar.gz
compressed package into a folder prepared in advance named wasm-opt
, for example: D:\rust\binaryen\wasm-opt
.
Finally, add this path to the system environment variable PATH: D:\rust\binaryen\wasm-opt\bin
.
Note that after setting the environment variable, you need to reopen a new command console.
我也遇到了相同的问题,不过我已经解决了。 我的环境是windows,但是我想其他系统的解决方式应该差不多,因为我是在查看wasm-pack的源码时,发现的一个可行的处理办法。 如果你想知道具体源码是什么,建议自行前往并寻找,这并不复杂。 关键在于,wasm-pack在下载前,会使用
which::which("wasm-opt")
查找相关的可执行文件位置。而which会在环境变量的PATH中进行寻找。 所以最后的解决办法很简单,在windows上,请把你下载的binaryen-version_90-x86-windows.tar.gz
压缩包内的内容,放置到一个提前准备好wasm-opt
的文件夹内,例如:D:\rust\binaryen\wasm-opt
。最后将这个路径加入系统环境变量PATH中:
D:\rust\binaryen\wasm-opt\bin
。注意设置好环境变量后,需要重新打开一个新的命令控制台。
en I had the same problem, but I already solved it.
My environment is Windows, but I think the solution for other systems should be similar, because I found a feasible solution when I was viewing the source code of
wasm-pack
.If you want to know the specific source code, it is recommended to go and find it yourself, which is not complicated.
The key is that before downloading,
wasm-pack
will usewhich::which("wasm-opt")
to find the location of the relevant executable file. Andwhich
will look in the PATH environment variable.So the final solution is very simple, on Windows, please place the contents of the downloaded
binaryen-version_90-x86-windows.tar.gz
compressed package into a folder prepared in advance namedwasm-opt
, for example:D:\rust\binaryen\wasm-opt
.Finally, add this path to the system environment variable PATH:
D:\rust\binaryen\wasm-opt\bin
.Note that after setting the environment variable, you need to reopen a new command console.
这个方法好使,我曾经想试试这种方法,但觉得不太可能是这样吧,就没有去试。。。。。
"This method works well. I once thought about trying this approach, but I didn't think it would work like this, so I didn't try it..."
我也遇到了相同的问题,不过我已经解决了。 我的环境是windows,但是我想其他系统的解决方式应该差不多,因为我是在查看wasm-pack的源码时,发现的一个可行的处理办法。 如果你想知道具体源码是什么,建议自行前往并寻找,这并不复杂。 关键在于,wasm-pack在下载前,会使用
which::which("wasm-opt")
查找相关的可执行文件位置。而which会在环境变量的PATH中进行寻找。 所以最后的解决办法很简单,在windows上,请把你下载的binaryen-version_90-x86-windows.tar.gz
压缩包内的内容,放置到一个提前准备好wasm-opt
的文件夹内,例如:D:\rust\binaryen\wasm-opt
。最后将这个路径加入系统环境变量PATH中:
D:\rust\binaryen\wasm-opt\bin
。注意设置好环境变量后,需要重新打开一个新的命令控制台。
en I had the same problem, but I already solved it.
My environment is Windows, but I think the solution for other systems should be similar, because I found a feasible solution when I was viewing the source code of
wasm-pack
.If you want to know the specific source code, it is recommended to go and find it yourself, which is not complicated.
The key is that before downloading,
wasm-pack
will usewhich::which("wasm-opt")
to find the location of the relevant executable file. Andwhich
will look in the PATH environment variable.So the final solution is very simple, on Windows, please place the contents of the downloaded
binaryen-version_90-x86-windows.tar.gz
compressed package into a folder prepared in advance namedwasm-opt
, for example:D:\rust\binaryen\wasm-opt
.Finally, add this path to the system environment variable PATH:
D:\rust\binaryen\wasm-opt\bin
.Note that after setting the environment variable, you need to reopen a new command console.
这个方法好使,我曾经想试试这种方法,但觉得不太可能是这样吧,就没有去试。。。。。
"This method works well. I once thought about trying this approach, but I didn't think it would work like this, so I didn't try it..."
我先用一个空项目跑了一下witch相同逻辑的空项目,确实能拿到,就直接用了,然后一次成功。但是这个总是下载失败的问题是真的绷不住(host,VPN等等都试了),只能先这样解决了。
Maybe you use npm/yarn install wasm-pack.
Just remove it and use cargo install instead.
yarn global remove wasm-pack cargo install wasm-pack
It does not work