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

[wasm] Host should separate arguments for engine, mono and application #88760

Open
pavelsavara opened this issue Jul 12, 2023 · 3 comments
Open
Labels
arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript os-browser Browser variant of arch-wasm
Milestone

Comments

@pavelsavara
Copy link
Member

pavelsavara commented Jul 12, 2023

Possible designs
A) use multiple -- to separate it
node --enable-source-maps main.js -- hello.dll --setenv=XXX=1 -- -fromCity=Prague to Ilona

--enable-source-maps is nodeJS engine flag
--setenv=XXX=1 is mono engine flag
-fromCity=Prague is application argument
to is application arg
Ilona is application arg

dotnet run --engine=node -- --enable-source-maps main.js -- hello.dll --setenv=XXX=1 -- -fromCity=Prague to Ilona

this assumes that main.js which is user will call .withRuntimeOptionsFromArguments() to consume it.

B) use well know pass-thru arguments

wasmtime run --env MONO_OPTIONS="values" dotnet.wasm

dotnet run --engine=wasmtime --engine-arg='--env MONO_OPTIONS="values"' dotnet.wasm

escaping becomes nasty.

Also, from #85674 (comment)
Perhaps there should be pass-thru argument like --host:xxx=yyyand--runtime:aaa=bbbbefore application -- ? As an alternative to multiple -- .

More details discussed here #70892

@pavelsavara pavelsavara added arch-wasm WebAssembly architecture os-browser Browser variant of arch-wasm labels Jul 12, 2023
@pavelsavara pavelsavara added this to the 8.0.0 milestone Jul 12, 2023
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jul 12, 2023
@ghost
Copy link

ghost commented Jul 12, 2023

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Possible designs
A) use multiple -- to separate it
node --enable-source-maps main.js -- hello.dll --setenv=XXX=1 -- -fromCity=Prague to Ilona

--enable-source-maps is nodeJS engine flag
--setenv=XXX=1 is mono engine flag
-fromCity=Prague is application argument
to is application arg
Ilona is application arg

dotnet run --engine=node -- --enable-source-maps main.js -- hello.dll --setenv=XXX=1 -- -fromCity=Prague to Ilona

this assumes that main.js which is user will call .withRuntimeOptionsFromArguments() to consume it.

B) use well know pass-thru arguments

wasmtime run --env MONO_OPTIONS="values" dotnet.wasm

dotnet run --engine=wasmtime --engine-arg='--env MONO_OPTIONS="values"' dotnet.wasm

escaping becomes nasty.

More details discussed here #70892

Author: pavelsavara
Assignees: radical
Labels:

arch-wasm, os-browser

Milestone: 8.0.0

@radical
Copy link
Member

radical commented Aug 14, 2023

Moving this to 9.0, so we can get an agreement on how this should be done, as it should be consistent with how dotnet run handles these kinda cases.

@radical radical modified the milestones: 8.0.0, 9.0.0 Aug 14, 2023
@pavelsavara
Copy link
Member Author

cc @richlander

@radical radical removed their assignment Feb 27, 2024
@pavelsavara pavelsavara modified the milestones: 9.0.0, Future Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript os-browser Browser variant of arch-wasm
Projects
None yet
Development

No branches or pull requests

5 participants