Wasm-pack: regression: wasm-pack init requires you pass a directory

Created on 1 Jun 2018  ยท  6Comments  ยท  Source: rustwasm/wasm-pack

โฏ strace -e trace=open -- wasm-pack init
open("/proc/sys/vm/overcommit_memory", O_RDONLY) = 3
open("/sys/kernel/mm/transparent_hugepage/enabled", O_RDONLY) = 3
open(".", O_WRONLY|O_CREAT|O_APPEND|O_CLOEXEC, 0666) = -1 EISDIR (Is a directory)
Is a directory (os error 21)
Caused by: Is a directory (os error 21)
+++ exited with 1 +++

I'm getting this error (with the release musl 0.3.0 or building it locally), on Debian.

cargo test passes all the tests locally.

bug

Most helpful comment

workaround - run wasm-pack init . (can confirm this works, but this should not have to be what happened)

All 6 comments

How are you trying to use this? wasm-pack init already expects you to have a rust project. What's likely happening is that it's checking the current directory for the Cargo.toml but can't find it. So if you haven't already you'll need to create a new project using cargo.

@mgattozzi thank you for your reply. It has a simple Cargo.toml with lib and dependencies as described in the readme file.

Would this be enough to get it working?

cargo new wat --lib ;  cd wat
wasm-pack init

@jbolila hrm, that is what should work- would you mind giving us the output of ls wat?

welp! can confirm that this is true. i think this may be a bug and i'll be working on a fix now!

workaround - run wasm-pack init . (can confirm this works, but this should not have to be what happened)

it works :) thank you! ... after adding code to src/lib.rs enough to produce the target/wasm32-unknown-unknown/release/??.wasm file.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Bernd-L picture Bernd-L  ยท  3Comments

rbtcollins picture rbtcollins  ยท  3Comments

grovesNL picture grovesNL  ยท  4Comments

RReverser picture RReverser  ยท  3Comments

rpjohnst picture rpjohnst  ยท  5Comments