This commit improved the stat test a bit by verifying that
S_ISDIR() works properly. It also adds missing coverage for
__wasi_path_remove_directory().
PR-URL: https://github.com/nodejs/node/pull/31413
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This test provides missing coverage for __wasi_path_symlink()
and __wasi_path_readlink().
PR-URL: https://github.com/nodejs/node/pull/31403
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit updates the uvwasi dependency to version 0.0.4. The
most notable change is a refactor of the way paths are resolved.
All paths, including symlinks, are now resolved in terms of
sandboxed paths instead of leaking host system paths.
PR-URL: https://github.com/nodejs/node/pull/31363
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Prior to this commit, if uvwasi_init() failed in any way, Node
would abort due to a failed CHECK_EQ(). This commit changes
that behavior to a thrown exception.
PR-URL: https://github.com/nodejs/node/pull/31076
Fixes: https://github.com/nodejs/node/issues/30878
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit covers the last remaining uncovered code in
lib/wasi.js.
PR-URL: https://github.com/nodejs/node/pull/31039
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
test-wasi-binding.js was added during the initial WASI
development, but it is now considered obsolete. It also does
not provide any additional test coverage. This commit removes
it.
PR-URL: https://github.com/nodejs/node/pull/30980
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
The WASI API has moved from preview0 to preview1. This commit
updates the CLI flag accordingly.
PR-URL: https://github.com/nodejs/node/pull/30980
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit updates to uvwasi 0.0.3, which implements a newer
version of the WASI spec, snapshot_1. Since the WASI API has
changed, this also requires updating the WebAssembly memory
interfacing logic and recompiling the WASI tests with a
version of wasi-libc that supports snapshot_1.
PR-URL: https://github.com/nodejs/node/pull/30980
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit removes an extra block scope, and avoid reading
the simple.wasm file for every test case.
PR-URL: https://github.com/nodejs/node/pull/30972
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit adds additional test cases to
test-wasi-start-validation.js, which gets the JS test coverage
of start() to 100%.
PR-URL: https://github.com/nodejs/node/pull/30972
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit ensures that the WASI module cannot be require()'ed
without a CLI flag while the module is still experimental.
This fixes a regression from
https://github.com/nodejs/node/pull/30778.
PR-URL: https://github.com/nodejs/node/pull/30963
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
test-wasi-start-validation.js should require the
--experimental-wasi-unstable-preview0 flag in order to run.
However, due to a recent regression, that hasn't been enforced.
https://github.com/nodejs/node/pull/30963 fixes the regression
and will cause this test to start (correctly) failing. This
commit adds the missing flag.
PR-URL: https://github.com/nodejs/node/pull/30971
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Add test coverage for options validation in WASI constructor.
PR-URL: https://github.com/nodejs/node/pull/30770
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>