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

failed to download binaryen-version_90-x86-windows.tar.gz #864

Open
WingDust opened this issue Jun 18, 2020 · 26 comments
Open

failed to download binaryen-version_90-x86-windows.tar.gz #864

WingDust opened this issue Jun 18, 2020 · 26 comments

Comments

@WingDust
Copy link

🐛 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)

@asurance
Copy link

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.

@WingDust
Copy link
Author

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.

@asurance
Copy link

So, can you tell me where binaryen-version_90-x86-windows.tar.gz should be installed?

@WingDust
Copy link
Author

@asurance open Assets find version_90 Assets and click

@asurance
Copy link

asurance commented Jun 18, 2020

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.

@WingDust
Copy link
Author

as same

@asurance
Copy link

I find it can be skipped by cargo install wasm-bindgen-cli.Maybe you can try too.

@WingDust
Copy link
Author

@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

@tafia
Copy link

tafia commented Jun 23, 2020

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.

@SebastienGllmt
Copy link

This issue is a duplicate of #886 I believe

@ZosoDerGoldene
Copy link

This issue is a duplicate of #886 I believe

I don't think so, because #886 was fixed/closed, but this problem persists

@xlcbingo1999
Copy link

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)

@xlcbingo1999
Copy link

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

@tkmcmaster
Copy link

tkmcmaster commented Nov 2, 2021

This recently has started failing for me using Github Actions. The workarounds mentioned in #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

tkmcmaster added a commit to FamilySearch/pewpew that referenced this issue Nov 3, 2021
* Updated wasm-pack to 0.10.1

* Changed the log_level parameter to be optional rather than required (with undefined allowed)

* Fixed a css rule that was giving errors

* Fixed clipy and fmt warnings

* Added fix for Github Actions issue

* Fixed the wasm-opt failure by manually downloading and running wasm-opt

rustwasm/wasm-pack#864

* Updated npm dependencies to fix vulnerabilities

Holding pack parcel still due to no support in parcel 2 for Web Assemblies

* Cleaned up the logic in model to account for requestTimeouts being optional

Fixed several methods that either weren't returning errors, or would return the first success and not look at further checks

* There is a cargo deny error, but there is no fixed version we can move to
@ghost
Copy link

ghost commented Nov 6, 2021

replace dependency with the latest version wasm-bindgen = "0.2.78" works for me, i don`t know why

@hillin
Copy link

hillin commented Jul 19, 2022

@asurance I'm not sure what went wrong on your side, but manually installing into C:\Users\<user-name>\.cargo\bin worked for me.

@1714080902120
Copy link

1714080902120 commented Jan 26, 2023

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

@Qix-
Copy link

Qix- commented Feb 12, 2023

@tafia do you happen to know how to set the metadata for Cargo workspaces in order to work around this?

@stash763
Copy link

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

@voidmozx
Copy link

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

@magicwenli
Copy link

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/

@hidoudou
Copy link

wired,i can download the file by using browser, but clion just failed.

@ypwxxx
Copy link

ypwxxx commented Jan 5, 2024

我也遇到了相同的问题,不过我已经解决了。
我的环境是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.

@61go
Copy link

61go commented Jan 9, 2024

我也遇到了相同的问题,不过我已经解决了。 我的环境是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.

这个方法好使,我曾经想试试这种方法,但觉得不太可能是这样吧,就没有去试。。。。。

"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..."

@ypwxxx
Copy link

ypwxxx commented Jan 9, 2024

我也遇到了相同的问题,不过我已经解决了。 我的环境是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.

这个方法好使,我曾经想试试这种方法,但觉得不太可能是这样吧,就没有去试。。。。。

"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等等都试了),只能先这样解决了。

@golanguage
Copy link

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

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