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

Make WasiCtx overridable #3895

Merged

Conversation

rvolosatovs
Copy link
Member

@rvolosatovs rvolosatovs commented Mar 7, 2022

In some use cases it is desirable to provide a custom snapshot WASI
context. Facilitate this by depending on a combination of traits
required rather than concrete type in the signature.

This change allows for e.g. wrapping WasiCtx into a struct and providing custom implementations for traits

@npmccallum
Copy link
Member

@pchickey Any chance this can land in tomorrow's release? We'd hate to lose a month on this.

@pchickey
Copy link
Contributor

pchickey commented Mar 7, 2022

If @alexcrichton is ok holding up the release I am happy to get this in

@github-actions github-actions bot added the wasi Issues pertaining to WASI label Mar 7, 2022
@github-actions
Copy link

github-actions bot commented Mar 7, 2022

Subscribe to Label Action

cc @kubkon

This issue or pull request has been labeled: "wasi"

Thus the following users have been cc'd because of the following labels:

  • kubkon: wasi

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@rvolosatovs
Copy link
Member Author

Sorry, didn't account for case with multiple bounds (when tokio is enabled), fix incoming

@rvolosatovs rvolosatovs force-pushed the feature/generic-wasi-ctx branch from 73d0442 to 3ac1581 Compare March 7, 2022 19:37
crates/wasi/src/lib.rs Outdated Show resolved Hide resolved
@rvolosatovs rvolosatovs force-pushed the feature/generic-wasi-ctx branch from 3ac1581 to ea5ebee Compare March 7, 2022 19:47
In some use cases it is desirable to provide a custom snapshot WASI
context. Facilitate this by depending on a combination of traits
required rather than concrete type in the signature.

Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
@rvolosatovs rvolosatovs force-pushed the feature/generic-wasi-ctx branch from ea5ebee to adf702c Compare March 7, 2022 20:20
@alexcrichton alexcrichton merged commit e81d4ce into bytecodealliance:main Mar 7, 2022
@rvolosatovs rvolosatovs deleted the feature/generic-wasi-ctx branch March 7, 2022 21:36
@jeffparsons
Copy link
Contributor

Should this be added to the 0.35.0 release notes?

@alexcrichton
Copy link
Member

Sure if you'd like to send a PR I can take a look.

jeffparsons added a commit to jeffparsons/wasmtime that referenced this pull request Mar 13, 2022
This is a follow-up to bytecodealliance#3895,
which landed after the release notes were written.
alexcrichton pushed a commit that referenced this pull request Mar 14, 2022
This is a follow-up to #3895,
which landed after the release notes were written.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasi Issues pertaining to WASI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants