Skip to content

Implement some more of the WASI API - #12704

Merged
sbc100 merged 1 commit into
mainfrom
implement_some_wasi
Apr 1, 2023
Merged

Implement some more of the WASI API#12704
sbc100 merged 1 commit into
mainfrom
implement_some_wasi

Conversation

@sbc100

@sbc100 sbc100 commented Nov 5, 2020

Copy link
Copy Markdown
Collaborator

In order to test our WASI API implementation I've added
wasi-test-suite as submodule. This submodule is only
needed for testing.

@sbc100
sbc100 force-pushed the implement_some_wasi branch 4 times, most recently from 3b8b688 to 701830c Compare November 5, 2020 05:15
@sbc100
sbc100 requested a review from kripken November 5, 2020 23:58
@sbc100
sbc100 force-pushed the implement_some_wasi branch from 701830c to f6f415f Compare November 6, 2020 00:01
Comment thread emscripten.py Outdated
# TODO(sbc): Find a better way to identify wasi syscalls
syscall_prefixes = ('__sys', 'fd_')
syscalls = [d for d in declares if d.startswith(syscall_prefixes)]
syscalls = [d for d in declares if d.startswith(syscall_prefixes) or d in ['path_open']]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

building.py's metadce() has a WASI_IMPORTS list - maybe we can move that to a global position?

Comment thread src/library_syscall.js
Comment thread tests/test_other.py Outdated
Comment thread src/library_wasi.js Outdated
},

#ifdef PURE_WASI
$preopens: "{3: '/'}",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what is 3, and why is it /?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Clearly this needs work yes :)

This basically says expose the whole of emscriptens VFS (the virtual filesytem created by the FS code) and make that available to WASI via the preopen system. Pre-open file descriptors start at 3, right after stdin, stdout and stderr.

This really needs integration with the FS layer... I think I should probably fix that even before landing this..

Comment thread src/library_wasi.js
Comment thread src/library_wasi.js Outdated
@caspervonb

Copy link
Copy Markdown

Is this blocked on anything? Anything I can do on the tests side? 🙃

@sbc100

sbc100 commented Dec 10, 2020

Copy link
Copy Markdown
Collaborator Author

Is this blocked on anything? Anything I can do on the tests side?

No, just lack time :) I will try to get this landed before the end of the year.

@sbc100 sbc100 mentioned this pull request Dec 14, 2020
@sbc100
sbc100 force-pushed the implement_some_wasi branch from f6f415f to 127cac8 Compare January 15, 2021 13:16
Base automatically changed from master to main March 8, 2021 23:49
@sbc100
sbc100 force-pushed the implement_some_wasi branch from 127cac8 to db450d7 Compare April 14, 2021 22:25
@stale

stale Bot commented Apr 16, 2022

Copy link
Copy Markdown

This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.

@stale stale Bot added the wontfix label Apr 16, 2022
@sbc100
sbc100 force-pushed the implement_some_wasi branch 4 times, most recently from 38511a2 to 9fe8743 Compare March 20, 2023 03:02
@stale stale Bot removed the wontfix label Mar 20, 2023
@sbc100
sbc100 force-pushed the implement_some_wasi branch 3 times, most recently from e3f66a4 to 09d0f62 Compare March 20, 2023 23:07
@sbc100
sbc100 force-pushed the implement_some_wasi branch 2 times, most recently from 4f70dc0 to 3346632 Compare April 1, 2023 00:01
@sbc100

sbc100 commented Apr 1, 2023

Copy link
Copy Markdown
Collaborator Author

@kripken I'm trying to revive this old PR. I've improved it a bunch and it runs more tests now.

@sbc100
sbc100 requested a review from kripken April 1, 2023 00:04

@kripken kripken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm % questions

Comment thread src/library_syscall.js Outdated
Comment thread src/library_wasi.js Outdated
Comment thread src/shell.js
@sbc100
sbc100 force-pushed the implement_some_wasi branch 3 times, most recently from e15be6a to fce6a0f Compare April 1, 2023 06:34
In order to test our WASI API implementation I've added
`wasi-test-suite` as submodule.  This submodule is only
needed for testing.
@sbc100
sbc100 force-pushed the implement_some_wasi branch from fce6a0f to 530aca7 Compare April 1, 2023 19:33
@sbc100 sbc100 changed the title Implement some more of the wasi API Implement some more of the WASI API Apr 1, 2023
@sbc100
sbc100 merged commit 574034b into main Apr 1, 2023
@sbc100
sbc100 deleted the implement_some_wasi branch April 1, 2023 21:24
@kripken

kripken commented Apr 3, 2023

Copy link
Copy Markdown
Member

The emscripten roller seems to be erroring after this landed. Seems like something with the new submodule directory?

https://logs.chromium.org/logs/emscripten-releases/buildbucket/cr-buildbucket/8784982667442317537/+/u/Emscripten_testsuite__cores_/stdout

@sbc100

sbc100 commented Apr 3, 2023

Copy link
Copy Markdown
Collaborator Author

sbc100 added a commit that referenced this pull request Apr 3, 2023
sbc100 added a commit to sbc100/emscripten that referenced this pull request Jan 3, 2025
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.

3 participants