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

add experimental wasi module support on top of wasm modules #27850

Closed
wants to merge 1 commit into from

Conversation

devsnek
Copy link
Member

@devsnek devsnek commented May 24, 2019

@lukewagner @linclark @guybedford @tschneidereit @ofrobots

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@devsnek devsnek added experimental Issues and PRs related to experimental features. esm Issues and PRs related to the ECMAScript Modules implementation. wasm Issues and PRs related to WebAssembly. labels May 24, 2019
@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented May 24, 2019

@nodejs-github-bot nodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label May 24, 2019
@devsnek devsnek force-pushed the feature/wasi branch 2 times, most recently from 6cb5900 to 9304df9 Compare May 24, 2019 13:47
@devsnek
Copy link
Member Author

devsnek commented May 24, 2019

i tried to set up the test/wasi directory but the test runner isn't recognizing test/wasi/test.js as a test file @nodejs/testing

test/wasi/test.js Outdated Show resolved Hide resolved
lib/internal/wasi.js Outdated Show resolved Hide resolved

Compile with `clang c/x.c -target wasm32-unknown-wasi -o wasm/x.wasm`

The clang version used must be built with wasi-sysroot.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\o/ \o/ Really excited this is testing and running vanilla clang/wasi-sysroot output.

Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

src/node_options.cc Outdated Show resolved Hide resolved
Copy link
Contributor

@ofrobots ofrobots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great! Thanks for putting this together. I'm experimenting with some 'real world' code that relies on this over at https://github.com/ofrobots/brotli-wasm.

src/node_options.cc Outdated Show resolved Hide resolved
test/wasi/test.js Outdated Show resolved Hide resolved
@syrusakbary
Copy link

This is awesome! Great work on the PR 👏

@Trott
Copy link
Member

Trott commented Jun 1, 2019

i tried to set up the test/wasi directory but the test runner isn't recognizing test/wasi/test.js as a test file @nodejs/testing

Did this get resolved or is it still a problem?

@devsnek
Copy link
Member Author

devsnek commented Jun 1, 2019

@Trott still a problem

@cjihrig
Copy link
Contributor

cjihrig commented Jun 1, 2019

@devsnek, rename test/wasi/test.js to test/wasi/test-wasi.js (or something else that begins with test-) and it should work.

@devsnek
Copy link
Member Author

devsnek commented Jun 2, 2019

@cjihrig i attempted to add seeking but the native function keeps returning undefined on success instead of the new offset ;(.

if anyone better with napi sees the bug please let me know

src/node_wasi.cc Outdated Show resolved Hide resolved
cjihrig added a commit to nodejs/wasi that referenced this pull request Oct 9, 2019
This commit adds support for resolving symlinks during
path resolution. This commit also ports all of the remaining
tests from nodejs/node#27850, with
the 'poll' test currently disabled.
@devsnek devsnek closed this Oct 11, 2019
@devsnek devsnek deleted the feature/wasi branch October 11, 2019 23:04
cjihrig added a commit to nodejs/wasi that referenced this pull request Oct 14, 2019
This commit ports the following tests from
nodejs/node#27850.

- clock_getres
- getentropy (currently disabled)
- getrusage
- gettimeofday
- notdir
- preopen_populates
- read_file_twice
- stat
- stdin
- write_file

This commit completes the implementations of
fd_filestat_get() and path_filestat_get(), which
are needed for the stat test. This commit also
adds clock_res_get() and partial clock_time_get()
support.
cjihrig added a commit to nodejs/wasi that referenced this pull request Oct 14, 2019
This commit adds support for resolving symlinks during
path resolution. This commit also ports all of the remaining
tests from nodejs/node#27850, with
the 'poll' test currently disabled.
cjihrig added a commit to nodejs/wasi that referenced this pull request Oct 15, 2019
This commit ports the following tests from
nodejs/node#27850.

- clock_getres
- getentropy (currently disabled)
- getrusage
- gettimeofday
- notdir
- preopen_populates
- read_file_twice
- stat
- stdin
- write_file

This commit completes the implementations of
fd_filestat_get() and path_filestat_get(), which
are needed for the stat test. This commit also
adds clock_res_get() and partial clock_time_get()
support.
cjihrig added a commit to nodejs/wasi that referenced this pull request Oct 15, 2019
This commit adds support for resolving symlinks during
path resolution. This commit also ports all of the remaining
tests from nodejs/node#27850, with
the 'poll' test currently disabled.
cjihrig added a commit to nodejs/wasi that referenced this pull request Oct 28, 2019
This commit ports the following tests from
nodejs/node#27850.

- clock_getres
- getentropy (currently disabled)
- getrusage
- gettimeofday
- notdir
- preopen_populates
- read_file_twice
- stat
- stdin
- write_file

This commit completes the implementations of
fd_filestat_get() and path_filestat_get(), which
are needed for the stat test. This commit also
adds clock_res_get() and partial clock_time_get()
support.
cjihrig added a commit to nodejs/wasi that referenced this pull request Oct 28, 2019
This commit adds support for resolving symlinks during
path resolution. This commit also ports all of the remaining
tests from nodejs/node#27850, with
the 'poll' test currently disabled.
cjihrig added a commit to nodejs/wasi that referenced this pull request Oct 30, 2019
This commit ports the following tests from
nodejs/node#27850.

- clock_getres
- getentropy (currently disabled)
- getrusage
- gettimeofday
- notdir
- preopen_populates
- read_file_twice
- stat
- stdin
- write_file

This commit completes the implementations of
fd_filestat_get() and path_filestat_get(), which
are needed for the stat test. This commit also
adds clock_res_get() and partial clock_time_get()
support.
cjihrig added a commit to nodejs/wasi that referenced this pull request Oct 30, 2019
This commit adds support for resolving symlinks during
path resolution. This commit also ports all of the remaining
tests from nodejs/node#27850, with
the 'poll' test currently disabled.
cjihrig added a commit to nodejs/wasi that referenced this pull request Oct 31, 2019
This commit ports the following tests from
nodejs/node#27850.

- clock_getres
- getentropy (currently disabled)
- getrusage
- gettimeofday
- notdir
- preopen_populates
- read_file_twice
- stat
- stdin
- write_file

This commit completes the implementations of
fd_filestat_get() and path_filestat_get(), which
are needed for the stat test. This commit also
adds clock_res_get() and partial clock_time_get()
support.
cjihrig added a commit to nodejs/wasi that referenced this pull request Oct 31, 2019
This commit adds support for resolving symlinks during
path resolution. This commit also ports all of the remaining
tests from nodejs/node#27850, with
the 'poll' test currently disabled.
cjihrig added a commit to nodejs/wasi that referenced this pull request Nov 2, 2019
This commit ports the following tests from
nodejs/node#27850.

- clock_getres
- getentropy (currently disabled)
- getrusage
- gettimeofday
- notdir
- preopen_populates
- read_file_twice
- stat
- stdin
- write_file

This commit completes the implementations of
fd_filestat_get() and path_filestat_get(), which
are needed for the stat test. This commit also
adds clock_res_get() and partial clock_time_get()
support.
cjihrig added a commit to nodejs/wasi that referenced this pull request Nov 2, 2019
This commit adds support for resolving symlinks during
path resolution. This commit also ports all of the remaining
tests from nodejs/node#27850, with
the 'poll' test currently disabled.
cjihrig added a commit to nodejs/wasi that referenced this pull request Nov 4, 2019
This commit ports the following tests from
nodejs/node#27850.

- clock_getres
- getentropy (currently disabled)
- getrusage
- gettimeofday
- notdir
- preopen_populates
- read_file_twice
- stat
- stdin
- write_file

This commit completes the implementations of
fd_filestat_get() and path_filestat_get(), which
are needed for the stat test. This commit also
adds clock_res_get() and partial clock_time_get()
support.
cjihrig added a commit to nodejs/wasi that referenced this pull request Nov 4, 2019
This commit adds support for resolving symlinks during
path resolution. This commit also ports all of the remaining
tests from nodejs/node#27850, with
the 'poll' test currently disabled.
cjihrig added a commit to nodejs/wasi that referenced this pull request Nov 5, 2019
This commit ports the following tests from
nodejs/node#27850.

- clock_getres
- getentropy (currently disabled)
- getrusage
- gettimeofday
- notdir
- preopen_populates
- read_file_twice
- stat
- stdin
- write_file

This commit completes the implementations of
fd_filestat_get() and path_filestat_get(), which
are needed for the stat test. This commit also
adds clock_res_get() and partial clock_time_get()
support.
cjihrig added a commit to nodejs/wasi that referenced this pull request Nov 5, 2019
This commit adds support for resolving symlinks during
path resolution. This commit also ports all of the remaining
tests from nodejs/node#27850, with
the 'poll' test currently disabled.
cjihrig added a commit to nodejs/wasi that referenced this pull request Nov 6, 2019
This commit ports the following tests from
nodejs/node#27850.

- clock_getres
- getentropy (currently disabled)
- getrusage
- gettimeofday
- notdir
- preopen_populates
- read_file_twice
- stat
- stdin
- write_file

This commit completes the implementations of
fd_filestat_get() and path_filestat_get(), which
are needed for the stat test. This commit also
adds clock_res_get() and partial clock_time_get()
support.
cjihrig added a commit to nodejs/wasi that referenced this pull request Nov 6, 2019
This commit adds support for resolving symlinks during
path resolution. This commit also ports all of the remaining
tests from nodejs/node#27850, with
the 'poll' test currently disabled.
addaleax pushed a commit that referenced this pull request Nov 30, 2019
Co-authored-by: Gus Caplan <me@gus.host>
Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com>
Co-authored-by: Jiawen Geng <technicalcute@gmail.com>
Co-authored-by: Tobias Nießen <tniessen@tnie.de>
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>

PR-URL: #30258
Refs: #27850
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
targos pushed a commit that referenced this pull request Dec 1, 2019
Co-authored-by: Gus Caplan <me@gus.host>
Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com>
Co-authored-by: Jiawen Geng <technicalcute@gmail.com>
Co-authored-by: Tobias Nießen <tniessen@tnie.de>
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>

PR-URL: #30258
Refs: #27850
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
targos pushed a commit that referenced this pull request Jan 14, 2020
Co-authored-by: Gus Caplan <me@gus.host>
Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com>
Co-authored-by: Jiawen Geng <technicalcute@gmail.com>
Co-authored-by: Tobias Nießen <tniessen@tnie.de>
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>

PR-URL: #30258
Refs: #27850
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
BethGriggs pushed a commit that referenced this pull request Feb 6, 2020
Co-authored-by: Gus Caplan <me@gus.host>
Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com>
Co-authored-by: Jiawen Geng <technicalcute@gmail.com>
Co-authored-by: Tobias Nießen <tniessen@tnie.de>
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>

PR-URL: #30258
Refs: #27850
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
@nodejs nodejs deleted a comment from tacoto12 Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
esm Issues and PRs related to the ECMAScript Modules implementation. experimental Issues and PRs related to experimental features. lib / src Issues and PRs related to general changes in the lib or src directory. semver-minor PRs that contain new features and should be released in the next minor version. wasm Issues and PRs related to WebAssembly.
Projects
None yet
Development

Successfully merging this pull request may close these issues.