-
Notifications
You must be signed in to change notification settings - Fork 824
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
wasix: Switch Console to WasiRunner + Various WASI Improvements #3996
Conversation
f852325
to
dad91ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're setting up WasiRunner
correctly as far as I can tell. The optional root_fs
in CommonWasiOptions::prepare_webc_env()
is a bit of a code smell, but I think that says more about the complexity of what we're trying to do and the limitations of our filesystem layer.
I've left a couple trivial suggestions about using structured logs a bit more because it'll help when spelunking through logs later on.
I don't think we should merge this without adding some tests to the Console
, though. Try adding a test for something non-trivial like python/python
to make sure the filesystem is being set up properly. Unit tests in the console
module would be best, but I understand Console
isn't in the most testable state at the moment.
Depending on when we merge this, I think we can also just remove the console now. It is only used by Deploy, and now it has become a very simple wrapper that does almost nothing, so I should be able to switch Deploy away from it. |
bc16131
to
84fe8da
Compare
@theduke when you get back to this PR, can you apply the change mentioned in #4019 (review)? |
f27ccbd
to
16124c0
Compare
b53917d
to
f14f07a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left some suggestions, but there's nothing blocking this PR from merging 👍
3cc1331
to
b8a15ff
Compare
b8a15ff
to
681686d
Compare
Doesn't seem to be used anywhere, so it's removed...
Needed in some cases for customization of the root fs.
Remove code duplication by reusing code paths
Remove he webc_runner and webc_runner_rt_wasi features from the wasmer_wasix crate. These features do not require any additional dependencies, and just add complexity for no good reason. There was historical motivation for these features, because the wasmer::Engine did not support module compilation on all target architectures in the past, but now it is no longer neccessary.
Add Runtime::load_module / Runtime::load_module_sync methods that are responsible for loading (compiling + caching) Webassembly modules. This allows implementers to customize module compilation and caching, for example to prevent concurrent compilation of the same module.
Reduce code duplicaton.
Adds a simple test that runs dash through the console.
Use Box<dyn Error> instead of a string. Also adds an AnyhowStdError wrapper to allow converting an anyhow::Error to a Box<dyn Error>. Needed for better error handling/propagation.
Remove duplicated code.
681686d
to
63d223d
Compare
Needed to enable the package loader.
Commits from this PR were included in #4050 and hence are already merged. |
Pull request was closed
This PR switches the wasix Console to use the WasiRunner instead of custom
setup.
This removes code duplication, and prevents potential resulting from differences
in bootstrapping for WASI environments.
To make this happen, the PR also extends the WasiRunner with an option to provide
a custom TmpFileSystem.
NOTE: this PR is based on #3989, which
must be merged first.