diff --git a/lib/wasi/src/lib.rs b/lib/wasi/src/lib.rs index ca439bfdb..712bfa4c7 100644 --- a/lib/wasi/src/lib.rs +++ b/lib/wasi/src/lib.rs @@ -142,7 +142,9 @@ pub fn generate_import_object_for_version( WasiVersion::Snapshot0 => { generate_import_object_snapshot0(args, envs, preopened_files, mapped_dirs) } - WasiVersion::Snapshot1 => generate_import_object(args, envs, preopened_files, mapped_dirs), + WasiVersion::Snapshot1 | WasiVersion::Latest => { + generate_import_object(args, envs, preopened_files, mapped_dirs) + } } } diff --git a/lib/wasi/src/utils.rs b/lib/wasi/src/utils.rs index b19a40488..9774abe20 100644 --- a/lib/wasi/src/utils.rs +++ b/lib/wasi/src/utils.rs @@ -7,13 +7,16 @@ pub fn is_wasi_module(module: &Module) -> bool { get_wasi_version(module).is_some() } -/// The version of WASI. This is determined by the namespace string +/// The version of WASI. This is determined by the imports namespace +/// string. #[derive(Debug, Clone, Copy, PartialEq)] pub enum WasiVersion { - /// "wasi_unstable" + /// `wasi_unstable`. Snapshot0, - /// "wasi_snapshot_preview1" + /// `wasi_snapshot_preview1`. Snapshot1, + /// Latest version (for the moment, an alias to `Snapshot1`). + Latest, } /// Detect the version of WASI being used from the namespace