PROP - 221 - Add HTTP greet component example and update WASI integration#227
Merged
Conversation
JeffMboya
reviewed
Jun 8, 2026
| let _ = wasmtime_wasi::p2::add_to_linker_sync(&mut linker) | ||
| .map_err(|e| format!("Failed to add WASI P2 to component linker: {e}")); | ||
| let _ = wasmtime_wasi_http::p2::add_only_http_to_linker_sync(&mut linker) | ||
| .map_err(|e| format!("Failed to add wasi:http to component linker: {e}")); |
Contributor
There was a problem hiding this comment.
Error silently discarded — use ? to propagate linker failure here.
JeffMboya
reviewed
Jun 8, 2026
| .map_err(|e| format!("Failed to add WASI P2 to component linker: {e}")); | ||
| let _ = wasmtime_wasi_http::p2::add_only_http_to_linker_sync(&mut linker) | ||
| .map_err(|e| format!("Failed to add wasi:http to component linker: {e}")); | ||
| if self.hal_enabled { |
Contributor
There was a problem hiding this comment.
Grants all WASM workloads unrestricted outbound HTTP — consider an allowlist in WasiHttpHooks.
JeffMboya
reviewed
Jun 8, 2026
| Build it with: make http-greet-component" | ||
| ); | ||
| return; | ||
| } |
Contributor
There was a problem hiding this comment.
Test silently passes when binary is missing — panic in CI or use #[ignore].
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
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.
What type of PR is this?
This is a bug fix because it fixes the following issue: #221
What does this do?
Registers
wasmtime_wasi_http::p2::add_only_http_to_linker_syncin the WASM component linker so that components with custom exports importingwasi:http/*interfaces can instantiate successfully. Previously, only thewasi:cli/runentry point worked with WASI HTTP imports because the HTTP bindings were missing from the linker.Which issue(s) does this PR fix/relate to?
Have you included tests for your changes?
Yes — added
test_custom_export_with_wasi_httpinproplet/src/runtime/wasmtime_runtime.rsthat builds an HTTP-greet component with a custommy-functionexport and verifies instantiation succeeds.Did you document any new/modified features?
No. The change is internal — WASI HTTP was already documented as supported for proxy tasks; this extends it to custom-export components.