Repository navigation
Implement wit-tools print and refine the component interface - #52
Merged
Merged
Conversation
extract-wit.wasm -> wit-tools.wasm wit-tools parses a `wit-source` (a wasm component or WIT package, WIT text, or a previously parsed `wit`) into the `wit` model, prints it back to WIT text, and summarizes a component's imports and exports. `print` rebuilds a `wit-parser` Resolve from the model and can include all, none, or selected additional packages. Core modules are rejected. Interface changes, breaking for existing consumers: - `types.component` is renamed `wasm`, and `error` is renamed `error-code` - `error-code` gains `malformed`, `not-component` and `not-found` cases, which name the offending input for calls accepting several wasms The loaders return the new error cases: not-found from the filesystem, OCI and HTTP loaders, an error for non-2xx HTTP responses rather than returning the body, and wac-loader validates each input component. Adds unit tests for wit-tools and wac-loader, and wasmtime integration tests that run the wit-tools component, rebuilt with make before the tests read it. Cranelift and wasmtime are optimized in the dev profile so the integration tests compile the component quickly. Signed-off-by: Scott Andrews <scott@andrews.me>
Signed-off-by: Scott Andrews <scott@andrews.me>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
extract-wit.wasm -> wit-tools.wasm
wit-tools parses a
wit-source(a wasm component or WIT package, WIT text, or a previously parsedwit) into thewitmodel, prints it back to WIT text, and summarizes a component's imports and exports.printrebuilds awit-parserResolve from the model and can include all, none, or selected additional packages. Core modules are rejected.Interface changes, breaking for existing consumers:
types.componentis renamedwasm, anderroris renamederror-codeerror-codegainsmalformed,not-componentandnot-foundcases, which name the offending input for calls accepting several wasmsThe loaders return the new error cases: not-found from the filesystem, OCI and HTTP loaders, an error for non-2xx HTTP responses rather than returning the body, and wac-loader validates each input component.
Adds unit tests for wit-tools and wac-loader, and wasmtime integration tests that run the wit-tools component, rebuilt with make before the tests read it. Cranelift and wasmtime are optimized in the dev profile so the integration tests compile the component quickly.