-
Notifications
You must be signed in to change notification settings - Fork 416
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
Cache hits even if wasm-bindgen
binary is missing
#508
Comments
Issue rustwasm#508 1. Tests the cache for the `wasm-bindgen` binary. Previously, only tested for the directory. 2. Removes the `wasm-bindgen` cache directory if it already exists, prior to renaming the temporary cache directory.
Fixed in #509 |
just for some posterity I was running into this somehow and I was getting weird errors trying to use the hello-world example in wasm-bindgen starter guide e.g. I would download the hello-world example, run npm run serve, then open the browser to http://localhost:8080 and there would be nothing except this in the dev console
in the npm run serve output it would say
I had to look closely to see that it was not a success (everything was green) but a failure because of
The fixI manually ran
possibly I had an older wasm-pack or something that caused this (I had one from february this year) but I just thought I'd add these notes in case it helps someone |
random other note: it was odd that it was not giving a 404 from the .wasm file or some different error in the browser, it was unclear that it was actually not able to compile the wasm at all |
🐛 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 acargo install
(at least until the nextwasm-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
.wasm-bindgen
has been installed previously to the cache.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)wasm-pack build
<-- Use masterShould fail with:
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 masterShould fail with:
🌍 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)
The text was updated successfully, but these errors were encountered: