mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
wasm_interp: Use String for CLI args. It was crashing with OsString.
This commit is contained in:
parent
b938648dad
commit
66aaa7c73c
1 changed files with 2 additions and 6 deletions
|
@ -1,11 +1,9 @@
|
|||
use bumpalo::{collections::Vec, Bump};
|
||||
use clap::ArgAction;
|
||||
use clap::{Arg, Command};
|
||||
use std::ffi::OsString;
|
||||
use std::fs;
|
||||
use std::io;
|
||||
use std::iter::once;
|
||||
use std::os::unix::prelude::OsStrExt;
|
||||
use std::process;
|
||||
|
||||
use roc_wasm_interp::{DefaultImportDispatcher, Instance};
|
||||
|
@ -64,10 +62,8 @@ fn main() -> io::Result<()> {
|
|||
let start_fn_name = matches.get_one::<String>(FLAG_FUNCTION).unwrap();
|
||||
let is_debug_mode = matches.get_flag(FLAG_DEBUG);
|
||||
let is_hex_format = matches.get_flag(FLAG_HEX);
|
||||
let start_arg_strings = matches
|
||||
.get_many::<OsString>(ARGS_FOR_APP)
|
||||
.unwrap_or_default();
|
||||
let wasm_path = matches.get_one::<OsString>(WASM_FILE).unwrap();
|
||||
let start_arg_strings = matches.get_many::<String>(ARGS_FOR_APP).unwrap_or_default();
|
||||
let wasm_path = matches.get_one::<String>(WASM_FILE).unwrap();
|
||||
// WASI expects the .wasm file to be argv[0]
|
||||
let wasi_argv_iter = once(wasm_path)
|
||||
.chain(start_arg_strings)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue