From 34aaaa7f15237671d0235f16ce64af8c554050fa Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Tue, 7 Mar 2023 16:47:44 -0800 Subject: [PATCH] code motion: cli related feature names (#104) * rename host runtime tests to command tests * add a test for using wasi in a reactor * commit cargo.lock * reactor tests: fix wit deps * test-programs: reactor-tests can build on stable note that this fails because it exposes wasi-libc ctors calling import functions from inside cabi_realloc * test-programs: show that ctors fix in wit-bindgen fixes bug * ci: install wasm32 targets for stable as well as nightly * wit-bindgen: use 0.4.0 * ci: use wit-bindgen 0.4.0 * Co-habitate with wasi-common from wasmtime * adapter: code motion in cargo feature & artifact names to cli-command, cli-reactor there will shortly be a third type of reactor (non-cli, idk what to call it) --------- Co-authored-by: Trevor Elliott --- src/lib.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 4164bb6db5d6..5072fe777379 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -16,11 +16,16 @@ use poll::Pollable; use streams::{InputStream, OutputStream}; use wasi::*; +#[cfg(all(feature = "cli-command", feature = "cli-reactor"))] +compile_error!( + "only one of the `cli-command` and `cli-reactor` features may be selected at a time" +); + #[macro_use] mod macros; mod bindings { - #[cfg(feature = "command")] + #[cfg(feature = "cli-command")] wit_bindgen::generate!({ world: "cli", std_feature, @@ -30,7 +35,7 @@ mod bindings { skip: ["command", "preopens", "get-environment"], }); - #[cfg(not(feature = "command"))] + #[cfg(feature = "cli-reactor")] wit_bindgen::generate!({ world: "cli-reactor", std_feature, @@ -40,7 +45,7 @@ mod bindings { } #[no_mangle] -#[cfg(feature = "command")] +#[cfg(feature = "cli-command")] pub unsafe extern "C" fn command( stdin: InputStream, stdout: OutputStream,