Merge pull request #2879 from peterhuene/allow-unknown-exports

Implement the `allow-unknown-exports` option for the run command.
This commit is contained in:
Peter Huene
2021-05-11 12:45:48 -07:00
committed by GitHub
3 changed files with 53 additions and 1 deletions

View File

@@ -78,6 +78,10 @@ pub struct RunCommand {
#[structopt(flatten)]
common: CommonOptions,
/// Allow unknown exports when running commands.
#[structopt(long = "allow-unknown-exports")]
allow_unknown_exports: bool,
/// Grant access to the given host directory
#[structopt(long = "dir", number_of_values = 1, value_name = "DIRECTORY")]
dirs: Vec<String>,
@@ -143,6 +147,8 @@ impl RunCommand {
let argv = self.compute_argv();
let mut linker = Linker::new(&store);
linker.allow_unknown_exports(self.allow_unknown_exports);
populate_with_wasi(
&mut linker,
preopen_dirs,