Description
🐛 Bug description
This bug affects some v0.6.0 users who will upgrade to v0.6.1, including #497 and #503.
The wasm-bindgen
cache falsely reports a hit when the cache directory exists, but the binary does not.
This causes wasm-pack
to fail on all subsequent builds requiring a cargo install
(at least until the next wasm-bindgen
version is released!).
🤔 Expected Behavior
When the wasm-bindgen
binary is missing, a new cache should be created that overwrites the old one.
👟 Steps to reproduce
Occurs when all four are present:
wasm-bindgen
is not in$PATH
.- A prebuilt binary is not available (e.g. no Internet, no Windows build).
wasm-bindgen
has been installed previously to the cache.- The
wasm-bindgen
binary in the cache has been removed.
MAC reproduction (Linux is similar)
In any WASM project:
cargo uninstall wasm-bindgen
(removeswasm-bindgen
from$PATH
)cargo build
(creates the lockfile)rm -rf ~/Library/Caches/.wasm_pack
(removes existing cache)mkdir -p ~/Library/Caches/.wasm_pack/wasm-bindgen-cargo-install-0.2.32
(creates a fake cargo install without a binary)- Disconnect from the Internet (makes the pre-built binary unavailable)
wasm-pack build
<-- Use master
Should fail with:
Error: /Users/<username>/Library/Caches/.wasm_pack/wasm-bindgen-cargo-install-0.2.32/wasm-bindgen binary does not exist
WINDOWS reproduction (easier!)
In any WASM project:
cargo uninstall wasm-bindgen
(removeswasm-bindgen
from$PATH
)rm -rf ~\AppData\Local\.wasm_pack
(removes existing cache)wasm-pack build
<-- Use v0.6.0 (should fail at end)wasm-pack build
<-- Use master
Note: This is shorter because the current version of
wasm-bindgen
does not have pre-built Windows binaries. So, it always defaults tocargo install
. Inwasm-pack v0.6.0
, the correct cache directory is created, yet the binaries are not copied from/bin
.
Should fail with:
Error: C:\Users\<username>\Local\.wasm_pack\wasm-bindgen-cargo-install-0.2.32\wasm-bindgen.exe binary does not exist
🌍 Your environment
Include the relevant details of your environment.
wasm-pack version: master branch
rustc version: rustc 1.33.0-nightly (8e2063d02 2019-01-07)