-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure WIT feature gates at runtime & implement wasi-cli `exit-wit…
…h-code` (#9381) * Remove `features` configuration from component::bindgen! and always emit all unstable members. These features will be gated at runtime. * Implement wasi-cli's unstable `exit-with-code` * Add codegen test for unstable features * Add LinkOptions type and add a parameter to all add_to_linker functions in for worlds/interfaces that use any unstable feature. * More descriptive test feature names. * Generate feature gate `if` checks * Expose `cli-exit-with-code` as CLI option * Generate bespoke option types per interface and world. * Add unit test * Remove exit code restriction on Windows * Add cli_exit_with_code test * Use BTreeSet to generate the options in consistent order * Change wasmtime-wasi's `add_to_linker_(a)sync` signature back to how it was and add new variants that take the option parameters. * Lift Windows exit code restriction in tests * Lift Windows exit code restriction
- Loading branch information
Showing
19 changed files
with
2,069 additions
and
89 deletions.
There are no files selected for viewing
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
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
28 changes: 28 additions & 0 deletions
28
crates/component-macro/tests/codegen/unstable-features.wit
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package foo:foo; | ||
|
||
@unstable(feature = experimental-interface) | ||
interface the-interface { | ||
@unstable(feature = experimental-interface-function) | ||
foo: func(); | ||
|
||
@unstable(feature = experimental-interface-resource) | ||
resource bar { | ||
@unstable(feature = experimental-interface-resource-method) | ||
foo: func(); | ||
} | ||
} | ||
|
||
@unstable(feature = experimental-world) | ||
world the-world { | ||
@unstable(feature = experimental-world-interface-import) | ||
import the-interface; | ||
|
||
@unstable(feature = experimental-world-function-import) | ||
import foo: func(); | ||
|
||
@unstable(feature = experimental-world-resource) | ||
resource baz { | ||
@unstable(feature = experimental-world-resource-method) | ||
foo: func(); | ||
} | ||
} |
Oops, something went wrong.