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

wasi-common: add preopened_handle, to be able to open any handle #2569

Closed
wants to merge 1 commit into from

Conversation

Ekleog
Copy link
Contributor

@Ekleog Ekleog commented Jan 11, 2021

This is a follow-up to #1600 ; that also makes it possible to write custom Handles for directories. For my specific case, it is so as to be able to have a wasmtime-async-compatible WASI.

I've raised the question on zulip #wasmtime without answer yet (not sure whether #general should be preferred?), so I've just decided to go on with this PR, and will start using my fork and checking whether I can make things work properly with it starting now :)

@Ekleog
Copy link
Contributor Author

Ekleog commented Jan 12, 2021

Side-note: preopened_dir and preopened_virt could both be refactored to lower to preopened_handle if making it take a function instead of directly a handle. I'm not yet sure whether that's something you'd want so restrained myself for now but it would be possible too, though I'm not really sure what PendingPreopen actually brings in practice compared to just opening ahead-of-time (and thus seeing potential errors happen as soon as possible)

@pchickey
Copy link
Contributor

Hi. Sorry I missed your message on the bytecode alliance discord.

Your use case is important to me. I'm nearing completion of a complete rewrite of wasi-common that, among other things, redesigns the traits so that files and directories have distinct sets of methods. #2487 I expect this PR will land within a week or so. (When it is ready to land, i'll rename the wasi-c2 crate back to wasi-common, thats just a name under development.)

The new design of the ctx builder should support your use case possible - https://github.com/bytecodealliance/wasmtime/blob/pch/wasi_common_cap_std/crates/wasi-c2/src/ctx.rs#L104

Is it OK to close this PR and you can re-target your work at the rewritten wasi-common?

@Ekleog
Copy link
Contributor Author

Ekleog commented Jan 12, 2021

That sounds awesome, thank you! Is there a branch somewhere where wasmtime-wasi depends on this version of wasi-common so I could take a git-dependency and start developing against that version?

@Ekleog Ekleog closed this Jan 12, 2021
@pchickey
Copy link
Contributor

If you're on that branch and depend on wasi-c2-wasmtime it should work in the place of wasmtime-wasi

@Ekleog
Copy link
Contributor Author

Ekleog commented Jan 12, 2021 via email

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.

2 participants