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

Granting access to files #17

Open
ibaryshnikov opened this issue Nov 13, 2019 · 5 comments · May be fixed by #19
Open

Granting access to files #17

ibaryshnikov opened this issue Nov 13, 2019 · 5 comments · May be fixed by #19

Comments

@ibaryshnikov
Copy link
Contributor

cargo wasi run -- --dir=. currently fails, but it's pretty close to working. I found out that after removing arg("--") the above command succeeds. Is it here intentionally?

cargo-wasi/src/lib.rs

Lines 180 to 183 in 8d1ed31

Command::new("wasmtime")
.arg("--")
.args(run.iter())
.run()

@alexcrichton
Copy link
Member

Yes the -- is currently intentional to ensure that any flags make their way to the binary rather than wasmtime, but it's true that there's not great handling of --dir right now.

The thinking is that eventually using interface types we can infer --dir and other flags, but it's probably good to support flags to wasmtime itself! What do you think of something like:

$ cargo wasi run --runtime-args "--dir=." -- --flag-to-wasm

or something like that?

@ibaryshnikov
Copy link
Contributor Author

Oh, I missed the point that wasm binaries may also receive args )
--runtime-args sounds great to me. To continue, is it feasible to support config file at some point? After wasi receives networking support, we would like to grant access to ports as well, and all of it reminds me of Dockerfile

@ibaryshnikov ibaryshnikov linked a pull request Nov 16, 2019 that will close this issue
@alexcrichton
Copy link
Member

Perhaps yeah! I'd prefer to not get too fancy right out the gate though, I would prefer to avoid making too many standards since this is getting to the point where it's probably good feedback for the general set of wasmtime folks to see how the CLI experience is envisioned long-term.

@clouds56
Copy link

any update?

@Robbepop
Copy link

I ran into this today and wondered if we couldn't do what other nested applications do here:
Namely allow for two different levels of -- where the first level provides arguments like --dir for Wasmtime and the second -- allows to provide arguments to the Wasm executable ran by Wasmtime.

For example:

cargo wasi run --arg-to-cargo-wasi -- --arg-to-wasmtime -- --arg-to-wasm-file

Sorry if this has already been discussed elsewhere.

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 a pull request may close this issue.

4 participants