Stream: git-wasmtime

Topic: wasmtime / issue #8955 Overriding `argv[0]` for `wasmtime...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2024 at 13:52):

whitequark opened issue #8955:

Feature

I would like it to be possible to override argv[0] for commands executed with wasmtime run. E.g.:

wasmtime run --argv0=clang++ bin/clang.wasm ...

Benefit

Certain applications use the value of argv[0] to:

In general I think the path passed to wasmtime run is only meaningful on the host and will rarely if ever mean anything within the sandbox.

Implementation

A new option --argv0= would work for me, but really anything that gets the job done is fine.

Alternatives

I can't think of any besides not having the functionality.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2024 at 13:52):

whitequark edited issue #8955:

Feature

I would like it to be possible to override argv[0] for commands executed with wasmtime run. E.g.:

wasmtime run --argv0=clang++ bin/clang.wasm ...

Benefit

Certain applications use the value of argv[0] to:

In general I think the path passed to wasmtime run is only meaningful on the host and will rarely if ever mean anything within the sandbox.

Implementation

A new option --argv0= would work for me, but really anything that gets the job done is fine.

Alternatives

I can't think of any besides not having the functionality.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 15 2024 at 14:22):

alexcrichton commented on issue #8955:

This sounds reasonable to me to implement as well, and I think --argv0 is a fine name as well. We already infer it from the provided wasm module so providing the ability to customize that seems like a good idea.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 15 2024 at 14:29):

whitequark commented on issue #8955:

I was going to implement it originally, but unfortunately I lost the direct motivation for this as I've moved to shipping the combined LLVM compiler driver (the llvm command, if you've seen it, as it's a bit obscure... it's like busybox) which takes the command to invoke as argv[1].

view this post on Zulip Wasmtime GitHub notifications bot (Jul 15 2024 at 14:29):

whitequark edited a comment on issue #8955:

I was going to implement it originally, but unfortunately I lost the direct motivation for this as I've moved to shipping the combined LLVM compiler driver (the llvm command, if you've seen it, as it's a bit obscure... it's like busybox) which takes the command to invoke as argv[1]. The combined binary is about 25% smaller so it's clearly preferable to ship.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 15 2024 at 14:30):

whitequark edited a comment on issue #8955:

I was going to implement it originally, but unfortunately I lost the direct motivation for this as I've moved to shipping the combined LLVM compiler driver (the llvm command, if you've seen it, as it's a bit obscure... it's like busybox with every single tool compiled into it) which takes the command to invoke as argv[1]. The combined binary is about 25% smaller so it's clearly preferable to ship.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 15 2024 at 21:57):

alexcrichton closed issue #8955:

Feature

I would like it to be possible to override argv[0] for commands executed with wasmtime run. E.g.:

wasmtime run --argv0=clang++ bin/clang.wasm ...

Benefit

Certain applications use the value of argv[0] to:

In general I think the path passed to wasmtime run is only meaningful on the host and will rarely if ever mean anything within the sandbox.

Implementation

A new option --argv0= would work for me, but really anything that gets the job done is fine.

Alternatives

I can't think of any besides not having the functionality.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 15 2024 at 23:47):

whitequark commented on issue #8955:

Thank you!


Last updated: Nov 22 2024 at 16:03 UTC