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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit status of wa-compile not properly propagating #20

Open
aYuMatsuzawa opened this issue Jan 12, 2018 · 0 comments
Open

Exit status of wa-compile not properly propagating #20

aYuMatsuzawa opened this issue Jan 12, 2018 · 0 comments

Comments

@aYuMatsuzawa
Copy link

  • OS: macOS sierra 10.12.6
  • package version: 0.11.0
  • executing command: wa compile -Oo output/dir/target.wasm source.c
  • output:
$ npm run wasm # wa compile -Oo priv/static/dist/fib.wasm fib.c

> [email protected] wasm /Users/yumatsuzawa/Workspace/yubot
> wa compile -Oo priv/static/dist/fib.wasm wasm/src/fib.c

Compiling on darwin-x64 ...

clang wasm/src/fib.c
 -O
 -c
 --target=wasm32-unknown-unknown
 -emit-llvm
 -nostdinc
 -nostdlib
 -D WEBASSEMBLY
 -isystem /Users/yumatsuzawa/Workspace/yubot/node_modules/webassembly/include
 -o /var/folders/f0/03jcty091k3684vmw5qr8yf00000gp/T/wa1_92739CYGeomA1qYDj.tmp

llvm-link /var/folders/f0/03jcty091k3684vmw5qr8yf00000gp/T/wa1_92739CYGeomA1qYDj.tmp /Users/yumatsuzawa/Workspace/yubot/node_modules/webassembly/lib/webassembly.bc
 -only-needed
 -o /var/folders/f0/03jcty091k3684vmw5qr8yf00000gp/T/wa2_92739T8s4xIqm7bBx.tmp

llc /var/folders/f0/03jcty091k3684vmw5qr8yf00000gp/T/wa2_92739T8s4xIqm7bBx.tmp
 -march=wasm32
 -filetype=asm
 -asm-verbose=false
 -thread-model=single
 -data-sections
 -function-sections
 -o /var/folders/f0/03jcty091k3684vmw5qr8yf00000gp/T/wa1_92739CYGeomA1qYDj.tmp

s2wasm /var/folders/f0/03jcty091k3684vmw5qr8yf00000gp/T/wa1_92739CYGeomA1qYDj.tmp
 --import-memory
 --allocate-stack 10000
 -o /var/folders/f0/03jcty091k3684vmw5qr8yf00000gp/T/wa2_92739T8s4xIqm7bBx.tmp

wasm-opt /var/folders/f0/03jcty091k3684vmw5qr8yf00000gp/T/wa2_92739T8s4xIqm7bBx.tmp
 -O3
 --coalesce-locals-learning
 --dce
 --duplicate-function-elimination
 --inlining
 --local-cse
 --merge-blocks
 --optimize-instructions
 --reorder-functions
 --reorder-locals
 --vacuum
 -o priv/static/dist/fib.wasm

Failed opening 'priv/static/dist/fib.wasm'
FAILED Error: code 1
    at ChildProcess.<anonymous> (/Users/yumatsuzawa/Workspace/yubot/node_modules/webassembly/cli/util.js:38:24)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

$ echo $status
0

In this case, priv/static/dist directory does not exist yet, so wasm-opt failing on file opening.
It exited with error code 1, though wa compile command itself is exiting with exit status 0 as shown above (I'm using fish-shell so echo $status equals to echo $? in bash).

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