tinysearch: Error: failed to execute "wasm-pack" "build"

When trying to build nightly with docker build --build-arg RUST_IMAGE=rustlang/rust:nightly-alpine -t tinysearch/cli:nightly . I’m getting the following error:

thread 'main' panicked at 'crate directory should exist', src/readme.rs:11:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Well, this is embarrassing.

wasm-pack had a problem and crashed. To help us diagnose the problem you can send us a crash report.


We have generated a report file at "/tmp/report-2ec64b30-c702-4581-a790-5d71fb2f66fe.toml". Submit an issue or email with the subject of "wasm-pack Crash Report" and include the report as an attachment.

- Authors: Ashley Williams <ashley666ashley@gmail.com>, Jesper Håkansson <jesper@jesperh.se>

We take privacy seriously, and do not perform any automated error collection. In order to improve the software, we rely on people to submit reports.

Thank you kindly!
Error: failed to execute "wasm-pack" "build" "/tmp/.tmpzklwBA/engine" "--target" "web" "--release" "--out-dir" "/tmp"
status: exit status: 101

In spite of the message no report file was generated at tmp/report-2ec64b30-c702-4581-a790-5d71fb2f66fe.toml

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21 (11 by maintainers)

Most upvoted comments

It works fo me with cargo run --force wasm-pack --vers=^0.9, but we should fix that error

@Jieiku For the moment, my branch requires using this option: -e, --engine-version.

So, to refactor your script, you would need to run:

cd
wget https://raw.githubusercontent.com/tinysearch/tinysearch/master/fixtures/index.json
~/tinysearch/target/release/tinysearch -e "path=\"$HOME/tinysearch/tinysearch\"" --optimize index.json

@ASMfreaK combined the bin and library in the same crate in their branch. You need

cargo build --release --features=bin

to build the binary.

Can you run the test again with this branch? https://github.com/tinysearch/tinysearch/pull/168

If that works, can you publish tinysearch from this branch on crates.io, e.g. as tinysearch-tmp and then test again with cargo install tinysearch-tmp? It’s a big ask, but it would help a lot to unblock the project. I’m inclined to merge that PR if it fixes the issue, even if I don’t have the time to fix the failing tests right now.

On 0.6.4 I get:

Unpacking tinysearch WASM engine into temporary directory "/tmp/.tmpJuEao6"
Starting unpack
Copying index into crate
Compiling WASM module using wasm-pack
Error: crate directory is missing a `Cargo.toml` file; is `/tmp/.tmpJuEao6/engine` the wrong directory?
Error: failed to execute "wasm-pack" "build" "/tmp/.tmpJuEao6/engine" "--target" "web" "--release" "--out-dir" "/home/amousset/projects/rustsec/admin/wasm_output"
status: exit status: 1

which is not exactly the same error but looks close.