feat: add adapt option for build and test commands#34
Open
jamesstocktonj1 wants to merge 4 commits intobytecodealliance:mainfrom
Open
feat: add adapt option for build and test commands#34jamesstocktonj1 wants to merge 4 commits intobytecodealliance:mainfrom
jamesstocktonj1 wants to merge 4 commits intobytecodealliance:mainfrom
Conversation
Author
|
cc: @asteurer |
dicej
approved these changes
Mar 25, 2026
src/utils.rs
Outdated
| encoder = encoder.module(&wasm)?; | ||
| encoder = encoder.adapter("wasi_snapshot_preview1", WASIP1_SNAPSHOT)?; | ||
| let adapt_bytes = if let Some(adapt) = adapt_file { | ||
| std::fs::read(adapt).context(format!("failed to read adapt file '{}'", adapt.display()))? |
There was a problem hiding this comment.
Nit: I'd recommend using with_context instead of context here to avoid allocating and formatting the string until and unless an error occurs.
Contributor
There was a problem hiding this comment.
@jamesstocktonj1 Thanks for the PR! Once Joel's comment is resolved, I'll get this merged 😄
Author
There was a problem hiding this comment.
Thanks for the feedback!
@asteurer Just made the change 👍
asteurer
approved these changes
Mar 26, 2026
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.
Description
--adaptoption for bothbuildandtestcommandscomponentize-gowasi_snapshot_preview1.reactor.wasmto be configurable. #33Example
Without flag:
With flag: