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

WASI not working on Windows #31461

Closed
RReverser opened this issue Jan 22, 2020 · 13 comments · Fixed by #31495
Closed

WASI not working on Windows #31461

RReverser opened this issue Jan 22, 2020 · 13 comments · Fixed by #31495

Comments

@RReverser
Copy link
Member

  • Version: 13.7.0
  • Platform: Windows 10 1903 x64
  • Subsystem: wasi

WASI preopen option fails on Windows, but works on Linux (including Linux subsystem on Windows in the same dir).

In the simplest case, to reproduce the issue open REPL with node --experimental-wasi-unstable-preview1 in any directory and try to construct a WASI object:

> process.cwd()
'C:\\Users\\rreverser\\Projects'
> const {WASI} = require('wasi')
undefined
> (node:18424) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time

> new WASI({ env: {}, args: [], preopens: { '/sandbox': process.cwd() } })
Uncaught Error: UVWASI_EISDIR, uvwasi_init
    at new WASI (wasi.js:59:18) {
  errno: 31,
  code: 'UVWASI_EISDIR',
  syscall: 'uvwasi_init'
}

Same error can be seen in a real code, too.

@cjihrig
Copy link
Contributor

cjihrig commented Jan 22, 2020

Out of curiosity, do the Node WASI tests pass on your machine? We do test preopens here.

@himself65
Copy link
Member

actually, it crashes on my Windows10 and success on Ubuntu WSL with the same node version 13.7.0 🤔

@RReverser
Copy link
Member Author

Out of curiosity, do the Node WASI tests

That might take some more time to set up... Or can I just run tests via locally installed Node?

@cjihrig
Copy link
Contributor

cjihrig commented Jan 23, 2020

@RReverser you should be able to run node ./test-wasi.js from that directory. On macOS, that works with node 13.7.0. I don't have a Windows setup at the moment, so I haven't been able to test at all on Windows and have been relying on the CI, which passes.

@himself65 do you mean node ./test-wasi.js fails on your Windows machine?

@himself65
Copy link
Member

C:\Users\Himself65\Desktop\github\node\test\wasi>node -v
v13.7.0

C:\Users\Himself65\Desktop\github\node\test\wasi>node ./test-wasi.js
executing cant_dotdot
(node:8064) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 69720)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 69720)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 69720)
environ_sizes_get(69724, 69720)
environ_get(134432, 131168)
fd_fdstat_get(3, 69672)
path_open(3, 1, 1033, 14, 0, 264240830, 268435455, 0, 69668)

executing clock_getres
(node:26608) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 69688)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 69688)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 69688)
environ_sizes_get(69692, 69688)
environ_get(134432, 131168)
clock_res_get(0, 69656)
clock_res_get(1, 69656)
clock_res_get(2, 69656)
clock_res_get(3, 69656)

executing exitcode
(node:14784) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 67080)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 67080)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 67080)
environ_sizes_get(67084, 67080)
environ_get(134432, 131168)
proc_exit(120)

executing fd_prestat_get_refresh
(node:20788) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 67080)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 67080)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 67080)
environ_sizes_get(67084, 67080)
environ_get(134432, 131168)
fd_fdstat_get(1, 67048)
fd_fdstat_get(1, 67048)

executing getentropy
(node:19848) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 69656)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 69656)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 69656)
environ_sizes_get(69660, 69656)
environ_get(134432, 131168)
random_get(69392, 256)

executing getrusage
(node:11104) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 69688)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 69688)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 69688)
environ_sizes_get(69692, 69688)
environ_get(134432, 131168)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)

executing gettimeofday
(node:25956) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 69688)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 69688)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 69688)
environ_sizes_get(69692, 69688)
environ_get(134432, 131168)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)

executing notdir
(node:5588) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 69704)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 69704)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 69704)
environ_sizes_get(69708, 69704)
environ_get(134432, 131168)
fd_fdstat_get(3, 69656)
path_open(3, 1, 1033, 7, 2, 264240830, 268435455, 4, 69652)

executing preopen_populates
(node:20044) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 67080)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 67080)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 67080)
environ_sizes_get(67084, 67080)
environ_get(134432, 131168)

executing read_file
(node:5656) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 70888)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 70888)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 70888)
environ_sizes_get(70892, 70888)
environ_get(134432, 131168)
fd_fdstat_get(3, 70840)
path_open(3, 1, 1033, 9, 0, 264240830, 268435455, 0, 70836)
fd_read(5, 70840, 1, 70836)
fd_fdstat_get(1, 70840)
fd_write(1, 70848, 2, 70844)
fd_read(5, 70840, 1, 70836)

executing read_file_twice
(node:4392) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 70888)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 70888)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 70888)
environ_sizes_get(70892, 70888)
environ_get(134432, 131168)
fd_fdstat_get(3, 70824)
path_open(3, 1, 1033, 9, 0, 264240830, 268435455, 0, 70820)
fd_read(5, 70824, 1, 70820)
fd_fdstat_get(1, 70824)
fd_write(1, 70832, 2, 70828)
fd_read(5, 70824, 1, 70820)
fd_fdstat_get(3, 70824)
path_open(3, 1, 1033, 9, 0, 264240830, 268435455, 0, 70820)
fd_read(6, 70824, 1, 70820)
fd_read(6, 70824, 1, 70820)
fd_write(1, 70880, 2, 70876)

executing stat
(node:6128) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 69832)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 69832)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 69832)
environ_sizes_get(69836, 69832)
environ_get(134432, 131168)
path_create_directory(4, 1029, 7)
fd_fdstat_get(4, 69592)
path_open(4, 1, 1065, 18, 1, 268419069, 268435455, 0, 69588)
fd_seek(5, 499, 0, 69624)
fd_write(5, 69624, 1, 69620)
fd_filestat_get(5, 69536)
fd_close(5)
path_filestat_get(4, 1065, 18, 8252232, 8252232)
fd_fdstat_get(4, 69528)
path_filestat_get(4, 1065, 18, -2080521144, 1722233688)
path_unlink_file(4, 1065, 18)
path_filestat_get(4, 1065, 18, 1750698400, 1750561056)
path_filestat_get(4, 1029, 7, 8252176, -383254528)
path_remove_directory(4, 1029, 7)
path_filestat_get(4, 1029, 7, 1750698400, 1750561056)

executing write_file
(node:11052) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 69752)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 69752)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 69752)
environ_sizes_get(69756, 69752)
environ_get(134432, 131168)
fd_fdstat_get(4, 69688)
path_open(4, 1, 1029, 10, 9, 268419069, 268435455, 0, 69684)
fd_fdstat_get(5, 69672)
fd_write(5, 69712, 2, 69708)
fd_close(5)

@himself65
Copy link
Member

himself65 commented Jan 23, 2020

C:\Users\Himself65\Desktop\github\node\test\wasi>node --experimental-wasi-unstable-preview1 ./test-wasi-options-validation.js
wasi.js:59
    const wrap = new _WASI(args, envPairs, preopenArray);
                 ^

Error: UVWASI_EISDIR, uvwasi_init
?[90m    at new WASI (wasi.js:59:18)?[39m
    at Object.<anonymous> (C:\Users\Himself65\Desktop\github\node\test\wasi\test-wasi-options-validation.js:10:1)
?[90m    at Module._compile (internal/modules/cjs/loader.js:1151:30)?[39m
?[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10)?[39m
?[90m    at Module.load (internal/modules/cjs/loader.js:1000:32)?[39m
?[90m    at Function.Module._load (internal/modules/cjs/loader.js:899:14)?[39m
?[90m    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)?[39m
?[90m    at internal/main/run_main_module.js:17:47?[39m {
  errno: ?[33m31?[39m,
  code: ?[32m'UVWASI_EISDIR'?[39m,
  syscall: ?[32m'uvwasi_init'?[39m
}

// If args is undefined, it should default to [] and should not throw.
new WASI({});

@cjihrig
Copy link
Contributor

cjihrig commented Jan 23, 2020

@himself65 thank you for the information. Do the same errors happen with the latest master? If so, that is concerning because the tests consistently pass on Windows (including Windows 10) in the CI.

@himself65
Copy link
Member

same problem

C:\Users\Himself65\Desktop\github\node\Release>node.exe -v
v14.0.0-pre

C:\Users\Himself65\Desktop\github\node\Release>node.exe C:\Users\Himself65\Desktop\github\node\test\wasi\test-wasi.js
executing cant_dotdot
(node:24956) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 69720)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 69720)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 69720)
environ_sizes_get(69724, 69720)
environ_get(134432, 131168)
fd_fdstat_get(3, 69672)
path_open(3, 1, 1033, 14, 0, 264240830, 268435455, 0, 69668)

executing clock_getres
(node:26708) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 69688)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 69688)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 69688)
environ_sizes_get(69692, 69688)
environ_get(134432, 131168)
clock_res_get(0, 69656)
clock_res_get(1, 69656)
clock_res_get(2, 69656)
clock_res_get(3, 69656)

executing exitcode
(node:29528) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 67080)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 67080)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 67080)
environ_sizes_get(67084, 67080)
environ_get(134432, 131168)
proc_exit(120)

executing fd_prestat_get_refresh
(node:28780) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 67080)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 67080)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 67080)
environ_sizes_get(67084, 67080)
environ_get(134432, 131168)
fd_fdstat_get(1, 67048)
fd_fdstat_get(1, 67048)

executing getentropy
(node:28172) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 69656)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 69656)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 69656)
environ_sizes_get(69660, 69656)
environ_get(134432, 131168)
random_get(69392, 256)

executing getrusage
(node:27480) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 69688)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 69688)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 69688)
environ_sizes_get(69692, 69688)
environ_get(134432, 131168)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)
clock_time_get(2, 1000, 69560)

executing gettimeofday
(node:11448) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 69688)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 69688)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 69688)
environ_sizes_get(69692, 69688)
environ_get(134432, 131168)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)
clock_time_get(0, 1000, 69592)

executing notdir
(node:30268) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 69704)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 69704)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 69704)
environ_sizes_get(69708, 69704)
environ_get(134432, 131168)
fd_fdstat_get(3, 69656)
path_open(3, 1, 1033, 7, 2, 264240830, 268435455, 4, 69652)

executing preopen_populates
(node:9288) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 67080)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 67080)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 67080)
environ_sizes_get(67084, 67080)
environ_get(134432, 131168)

executing read_file
(node:27236) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 70888)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 70888)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 70888)
environ_sizes_get(70892, 70888)
environ_get(134432, 131168)
fd_fdstat_get(3, 70840)
path_open(3, 1, 1033, 9, 0, 264240830, 268435455, 0, 70836)
fd_read(5, 70840, 1, 70836)
fd_fdstat_get(1, 70840)
fd_write(1, 70848, 2, 70844)
fd_read(5, 70840, 1, 70836)

executing read_file_twice
(node:28280) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 70888)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 70888)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 70888)
environ_sizes_get(70892, 70888)
environ_get(134432, 131168)
fd_fdstat_get(3, 70824)
path_open(3, 1, 1033, 9, 0, 264240830, 268435455, 0, 70820)
fd_read(5, 70824, 1, 70820)
fd_fdstat_get(1, 70824)
fd_write(1, 70832, 2, 70828)
fd_read(5, 70824, 1, 70820)
fd_fdstat_get(3, 70824)
path_open(3, 1, 1033, 9, 0, 264240830, 268435455, 0, 70820)
fd_read(6, 70824, 1, 70820)
fd_read(6, 70824, 1, 70820)
fd_write(1, 70880, 2, 70876)

executing stat
(node:24936) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 69832)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 69832)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 69832)
environ_sizes_get(69836, 69832)
environ_get(134432, 131168)
path_create_directory(4, 1029, 7)
fd_fdstat_get(4, 69592)
path_open(4, 1, 1065, 18, 1, 268419069, 268435455, 0, 69588)
fd_seek(5, 499, 0, 69624)
fd_write(5, 69624, 1, 69620)
fd_filestat_get(5, 69536)
fd_close(5)
path_filestat_get(4, 1065, 18, 0, 4)
fd_fdstat_get(4, 69528)
path_filestat_get(4, 1065, 18, -745259911, 4)
path_unlink_file(4, 1065, 18)
path_filestat_get(4, 1065, 18, -572100496, 4)
path_filestat_get(4, 1029, 7, 724624864, 4)
path_remove_directory(4, 1029, 7)
path_filestat_get(4, 1029, 7, -572100496, 4)

executing write_file
(node:10696) ExperimentalWarning: WASI is an experimental feature. This feature could change at any time
fd_prestat_get(3, 69752)
fd_prestat_dir_name(3, 131088, 9)
fd_prestat_get(4, 69752)
fd_prestat_dir_name(4, 131152, 5)
fd_prestat_get(5, 69752)
environ_sizes_get(69756, 69752)
environ_get(134432, 131168)
fd_fdstat_get(4, 69688)
path_open(4, 1, 1029, 10, 9, 268419069, 268435455, 0, 69684)
fd_fdstat_get(5, 69672)
fd_write(5, 69712, 2, 69708)
fd_close(5)


C:\Users\Himself65\Desktop\github\node\Release>node.exe C:\Users\Himself65\Desktop\github\node\test\wasi\test-wasi-options-validation.js
NOTE: The test started as a child_process using these flags: [ '--experimental-wasi-unstable-preview1' ] Use NODE_SKIP_FLAG_CHECK to run the test with the original
 flags.
wasi.js:59
    const wrap = new _WASI(args, envPairs, preopenArray);
                 ^

Error: UVWASI_EISDIR, uvwasi_init
    at new WASI (wasi.js:59:18)
    at Object.<anonymous> (C:\Users\Himself65\Desktop\github\node\test\wasi\test-wasi-options-validation.js:10:1)
    at Module._compile (internal/modules/cjs/loader.js:1208:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1228:10)
    at Module.load (internal/modules/cjs/loader.js:1057:32)
    at Function.Module._load (internal/modules/cjs/loader.js:952:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  errno: 31,
  code: 'UVWASI_EISDIR',
  syscall: 'uvwasi_init'
}

cjihrig added a commit to nodejs/uvwasi that referenced this issue Jan 24, 2020
uv_fs_fstat() fails on TTYs on Windows. This commit updates
uvwasi__get_filetype_by_fd() to detect this case and map
the fd to the WASI character device type.

Refs: nodejs/node#31461
@cjihrig
Copy link
Contributor

cjihrig commented Jan 24, 2020

Proposed fix in nodejs/uvwasi#92.

I guess this wasn't detected by the CI because stdin isn't a TTY in the CI. I was able to get a Windows 10 environment setup, reproduced the issue, and was able to get all of the Node WASI tests passing with that patch. I also verified that the REPL example from the OP worked as expected.

@RReverser
Copy link
Member Author

@cjchoi Awesome, thanks!

stdin isn't a TTY in the CI

Does this mean it's not possible to add a regression test for this?

@lundibundi
Copy link
Member

@cjihrig @RReverser could pseudo-tty test perhaps suffice?

@richardlau
Copy link
Member

pseudo-tty tests are skipped on Windows:

if utils.IsWindows():
print ("Skipping pseudo-tty tests, as pseudo terminals are not available"
" on Windows.")

cjihrig added a commit to nodejs/uvwasi that referenced this issue Jan 24, 2020
uv_fs_fstat() fails on TTYs on Windows. This commit updates
uvwasi__get_filetype_by_fd() to detect this case and map
the fd to the WASI character device type.

Refs: nodejs/node#31461
@cjihrig
Copy link
Contributor

cjihrig commented Jan 24, 2020

FWIW, there is a libuv feature request for pseudo-tty support that may (or may not) help the situation in the future.

PR to fix this in Node: #31495

codebytere pushed a commit that referenced this issue Feb 17, 2020
Original commit message:
    allow windows to detect tty types

    uv_fs_fstat() fails on TTYs on Windows. This commit updates
    uvwasi__get_filetype_by_fd() to detect this case and map
    the fd to the WASI character device type.

    Refs: #31461

Fixes: #31461
PR-URL: #31495
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
codebytere pushed a commit that referenced this issue Mar 15, 2020
Original commit message:
    allow windows to detect tty types

    uv_fs_fstat() fails on TTYs on Windows. This commit updates
    uvwasi__get_filetype_by_fd() to detect this case and map
    the fd to the WASI character device type.

    Refs: #31461

Fixes: #31461
PR-URL: #31495
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
codebytere pushed a commit that referenced this issue Mar 17, 2020
Original commit message:
    allow windows to detect tty types

    uv_fs_fstat() fails on TTYs on Windows. This commit updates
    uvwasi__get_filetype_by_fd() to detect this case and map
    the fd to the WASI character device type.

    Refs: #31461

Fixes: #31461
PR-URL: #31495
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
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 a pull request may close this issue.

5 participants