Skip to content

Fix build error on Windows#17

Merged
devsnek merged 1 commit intodevsnek:masterfrom
dcodeIO:patch-1
Jul 16, 2019
Merged

Fix build error on Windows#17
devsnek merged 1 commit intodevsnek:masterfrom
dcodeIO:patch-1

Conversation

@dcodeIO
Copy link
Contributor

@dcodeIO dcodeIO commented Jul 16, 2019

This PR fixes the compile error seen on Windows as described in #16. Still unable to run the tests, but it compiles and the native module loads with the following exports:

{
  seek: [Function: seek],
  schedYield: [Function: schedYield],
  realtime: [Function: realtime],
  SEEK_SET: 0,
  SEEK_CUR: 1,
  SEEK_END: 2,
  path: 'XY\\node-wasi\\build\\Release\\wasi.node'
}

Instead of running the tests, I tried node run example/cowsay.wasm with some custom logging, which unfortunately yields

fd_prestat_get 3 1048560
 -> 0
fd_prestat_dir_name 3 1114248 1
 -> 0
fd_fdstat_get 3 1048536
 -> 0
fd_prestat_get 4 1048560
 -> 8
environ_sizes_get 1048560 1048572
 -> 0
environ_get 1114280 1114472
 -> 0
args_sizes_get 1048572 1048560
 -> 0
args_get 1114248 1117184
 -> 0
args_sizes_get 1047624 1047628
 -> 0
args_get 1117304 1117320
 -> 0
fd_read 0 1047528 1 1047500
 -> 31
fd_write 2 1048152 1 1048124
 -> 31
fd_write 2 1047816 1 1047788
 -> 31
fd_write 2 1047816 1 1047788
 -> 31

wasm-00401b0a:553

RuntimeError: unreachable
    at __rust_start_panic (wasm-function[552]:1)
    at rust_panic (wasm-function[547]:38)
    at _ZN3std9panicking20rust_panic_with_hook17h12b7239ed4348eaeE (wasm-function[542]:542)
    at _ZN3std9panicking18continue_panic_fmt17hfbe042bfacb6a5d7E (wasm-function[541]:151)
    at _ZN3std9panicking15begin_panic_fmt17hb49e9d7f7ff6a73dE (wasm-function[479]:108)
    at _ZN3std2io5stdio7_eprint17hb2d5f2878b4c5d81E (wasm-function[516]:827)
    at _ZN83_$LT$core..result..Result$LT$$u21$$C$E$GT$$u20$as$u20$std..process..Termination$GT$6report17hd3ad7ac212fc5219E (wasm-function[286]:220)
    at _ZN86_$LT$core..result..Result$LT$$LP$$RP$$C$E$GT$$u20$as$u20$std..process..Termination$GT$6report17h32d24a5b7a33fc9bE (wasm-function[287]:226)
    at _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h6f5d71df502e16ffE (wasm-function[81]:80)
    at _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h1f5c6d3d9bd1f408E (wasm-function[526]:8)

but that looks like it's a different issue - is it?

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

Successfully merging this pull request may close these issues.

2 participants