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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wasm-opt endless loop #1356

Open
freopen opened this issue Jan 3, 2024 · 0 comments
Open

Wasm-opt endless loop #1356

freopen opened this issue Jan 3, 2024 · 0 comments

Comments

@freopen
Copy link

freopen commented Jan 3, 2024

馃悰 Bug description

wasm-pack stuck running wasm-opt for the same file over and over:

[INFO  wasm_pack::command::build] executing wasm-opt with ["-O"]
[INFO]: found wasm-opt at "/nix/store/bpbyjl98gyjlbkxskrz9l4r6ykill285-binaryen-116/bin/wasm-opt"
[INFO]: Optimizing wasm binaries with `wasm-opt`...
[INFO  wasm_pack::child] Running "/nix/store/bpbyjl98gyjlbkxskrz9l4r6ykill285-binaryen-116/bin/wasm-opt" "/tmp/nix-build-chess_erdos.drv-0/generated/wasm-building/chess_erdos_bg.wasm" "-o" "/tmp/nix-build-chess_erdos.drv-0/generated/wasm-building/chess_erdos_bg.wasm-opt.wasm" "-O"
[INFO  wasm_pack::child] Running "/nix/store/bpbyjl98gyjlbkxskrz9l4r6ykill285-binaryen-116/bin/wasm-opt" "/tmp/nix-build-chess_erdos.drv-0/generated/wasm-building/chess_erdos_bg.wasm" "-o" "/tmp/nix-build-chess_erdos.drv-0/generated/wasm-building/chess_erdos_bg.wasm-opt.wasm" "-O"
[INFO  wasm_pack::child] Running "/nix/store/bpbyjl98gyjlbkxskrz9l4r6ykill285-binaryen-116/bin/wasm-opt" "/tmp/nix-build-chess_erdos.drv-0/generated/wasm-building/chess_erdos_bg.wasm" "-o" "/tmp/nix-build-chess_erdos.drv-0/generated/wasm-building/chess_erdos_bg.wasm-opt.wasm" "-O"
[INFO  wasm_pack::child] Running "/nix/store/bpbyjl98gyjlbkxskrz9l4r6ykill285-binaryen-116/bin/wasm-opt" "/tmp/nix-build-chess_erdos.drv-0/generated/wasm-building/chess_erdos_bg.wasm" "-o" "/tmp/nix-build-chess_erdos.drv-0/generated/wasm-building/chess_erdos_bg.wasm-opt.wasm" "-O"
...

馃 Expected Behavior

wasm-opt running once.

馃憻 Steps to reproduce

It looks like /tmp mounted as a tmpfs is a problem. It stopped working when I switched my /tmp folder to tmpfs and it does not reproduce when I try to run wasm-opt somewhere else. So I guess steps are:

  1. Mount some folder as tmpfs
  2. Try to run wasm-pack -d <tmpfs_folder>

What happens is probably tmpfs behaves weird with .read_dir() and .rename() here: src/wasm_opt.rs#L34, resulting in newly moved file to be picked up by the next iteration of the .read_dir(). Maybe it should extract the full list of files to process first, then process all files in a separate loop?

馃實 Your environment

Include the relevant details of your environment.
wasm-pack version: 0.12.1
rustc version: 1.77.0-nightly 2023-12-30

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

1 participant