-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update to wasi-cli 0.2.0-rc-2023-12-05 snapshot
- Loading branch information
1 parent
bc70287
commit 65ceb08
Showing
36 changed files
with
408 additions
and
574 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,48 +15,33 @@ fn get_wasi_clock_fns() -> &'static Vec<(&'static str, FuncParams, FuncResults)> | |
WASI_CLOCK_FNS.get_or_init(|| { | ||
Vec::from([ | ||
( | ||
"wasi:clocks/[email protected]10-18#now", | ||
"wasi:clocks/[email protected]11-10#now", | ||
vec![], | ||
vec![ValType::I64], | ||
), | ||
( | ||
"wasi:clocks/[email protected]10-18#resolution", | ||
"wasi:clocks/[email protected]11-10#resolution", | ||
vec![], | ||
vec![ValType::I64], | ||
), | ||
( | ||
"wasi:clocks/[email protected]10-18#subscribe", | ||
vec![ValType::I64, ValType::I32], | ||
"wasi:clocks/[email protected]11-10#subscribe-instant", | ||
vec![ValType::I64], | ||
vec![ValType::I32], | ||
), | ||
( | ||
"wasi:clocks/wall[email protected]10-18#now", | ||
vec![], | ||
"wasi:clocks/monotonic[email protected]11-10#subscribe-duration", | ||
vec![ValType::I64], | ||
vec![ValType::I32], | ||
), | ||
( | ||
"wasi:clocks/[email protected]10-18#resolution", | ||
"wasi:clocks/[email protected]11-10#now", | ||
vec![], | ||
vec![ValType::I32], | ||
), | ||
( | ||
"wasi:clocks/[email protected]#subscribe", | ||
vec![ValType::I64, ValType::I32], | ||
vec![ValType::I32], | ||
), | ||
( | ||
"wasi:clocks/[email protected]#display", | ||
vec![ValType::I64, ValType::I32], | ||
vec![ValType::I32], | ||
), | ||
( | ||
"cabi_post_wasi:clocks/[email protected]#display", | ||
vec![ValType::I32], | ||
"wasi:clocks/[email protected]#resolution", | ||
vec![], | ||
), | ||
( | ||
"wasi:clocks/[email protected]#utc-offset", | ||
vec![ValType::I64, ValType::I32], | ||
vec![ValType::I32], | ||
), | ||
]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ static WASI_EXIT_FNS: OnceLock<Vec<(&str, FuncParams, FuncResults)>> = OnceLock: | |
fn get_wasi_exit_fns() -> &'static Vec<(&'static str, FuncParams, FuncResults)> { | ||
WASI_EXIT_FNS.get_or_init(|| { | ||
Vec::from([( | ||
"wasi:cli/[email protected]10-18#exit", | ||
"wasi:cli/[email protected]12-05#exit", | ||
vec![ValType::I32], | ||
vec![], | ||
)]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,37 +13,37 @@ fn get_wasi_random_fns() -> &'static Vec<(&'static str, FuncParams, FuncResults) | |
WASI_RANDOM_FNS.get_or_init(|| { | ||
Vec::from([ | ||
( | ||
"wasi:random/[email protected]10-18#get-random-bytes", | ||
"wasi:random/[email protected]11-10#get-random-bytes", | ||
vec![ValType::I64], | ||
vec![ValType::I32], | ||
), | ||
( | ||
"cabi_post_wasi:random/[email protected]10-18#get-random-bytes", | ||
"cabi_post_wasi:random/[email protected]11-10#get-random-bytes", | ||
vec![ValType::I32], | ||
vec![], | ||
), | ||
( | ||
"wasi:random/[email protected]10-18#get-random-u64", | ||
"wasi:random/[email protected]11-10#get-random-u64", | ||
vec![], | ||
vec![ValType::I64], | ||
), | ||
( | ||
"wasi:random/[email protected]10-18#get-insecure-random-bytes", | ||
"wasi:random/[email protected]11-10#get-insecure-random-bytes", | ||
vec![ValType::I64], | ||
vec![ValType::I32], | ||
), | ||
( | ||
"cabi_post_wasi:random/[email protected]10-18#get-insecure-random-bytes", | ||
"cabi_post_wasi:random/[email protected]11-10#get-insecure-random-bytes", | ||
vec![ValType::I32], | ||
vec![], | ||
), | ||
( | ||
"wasi:random/[email protected]10-18#get-insecure-random-u64", | ||
"wasi:random/[email protected]11-10#get-insecure-random-u64", | ||
vec![], | ||
vec![ValType::I64], | ||
), | ||
( | ||
"wasi:random/[email protected]10-18#insecure-seed", | ||
"wasi:random/[email protected]11-10#insecure-seed", | ||
vec![], | ||
vec![ValType::I32], | ||
), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -222,7 +222,7 @@ pub(crate) fn stub_env_virt(module: &mut Module) -> Result<()> { | |
module.replace_imported_func( | ||
module | ||
.imports | ||
.get_func("wasi:cli/[email protected]10-18", fn_name)?, | ||
.get_func("wasi:cli/[email protected]12-05", fn_name)?, | ||
|(body, _)| { | ||
body.unreachable(); | ||
}, | ||
|
@@ -240,7 +240,7 @@ pub(crate) fn strip_env_virt(module: &mut Module) -> Result<()> { | |
|
||
for fn_name in WASI_ENV_FNS { | ||
if let Ok(fid) = module.exports.get_func(format!( | ||
"wasi:cli/[email protected]10-18#{fn_name}" | ||
"wasi:cli/[email protected]12-05#{fn_name}" | ||
)) { | ||
module.replace_exported_func(fid, |(body, _)| { | ||
body.unreachable(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,20 +4,25 @@ use walrus::Module; | |
use super::StubRequirement; | ||
|
||
/// Imports exposed by WASI for clocks functionality which are allowed to be | ||
const WASI_CLOCKS_IMPORTS: [(&str, &str, &StubRequirement); 3] = [ | ||
const WASI_CLOCKS_IMPORTS: [(&str, &str, &StubRequirement); 4] = [ | ||
( | ||
"wasi:clocks/[email protected]10-18", | ||
"wasi:clocks/[email protected]11-10", | ||
"now", | ||
&StubRequirement::Required, | ||
), | ||
( | ||
"wasi:clocks/[email protected]10-18", | ||
"wasi:clocks/[email protected]11-10", | ||
"resolution", | ||
&StubRequirement::Required, | ||
), | ||
( | ||
"wasi:clocks/[email protected]", | ||
"subscribe", | ||
"wasi:clocks/[email protected]", | ||
"subscribe-instant", | ||
&StubRequirement::Required, | ||
), | ||
( | ||
"wasi:clocks/[email protected]", | ||
"subscribe-duration", | ||
&StubRequirement::Required, | ||
), | ||
]; | ||
|
@@ -50,10 +55,11 @@ pub(crate) fn stub_clocks_virt(module: &mut Module) -> Result<()> { | |
} | ||
|
||
/// Exported functions related to WASI clocks | ||
const WASI_CLOCK_EXPORTS: [&str; 3] = [ | ||
"wasi:clocks/[email protected]#now", | ||
"wasi:clocks/[email protected]#resolution", | ||
"wasi:clocks/[email protected]#subscribe", | ||
const WASI_CLOCK_EXPORTS: [&str; 4] = [ | ||
"wasi:clocks/[email protected]#now", | ||
"wasi:clocks/[email protected]#resolution", | ||
"wasi:clocks/[email protected]#subscribe-instant", | ||
"wasi:clocks/[email protected]#subscribe-duration", | ||
]; | ||
|
||
/// Strip exported WASI functions that implement clock access | ||
|
Oops, something went wrong.