Avoid duplicate call to _initialize with -f=_initialize#84
Merged
fitzgen merged 2 commits intobytecodealliance:mainfrom May 18, 2023
Mrmaxmeier:main
Merged
Avoid duplicate call to _initialize with -f=_initialize#84fitzgen merged 2 commits intobytecodealliance:mainfrom Mrmaxmeier:main
-f=_initialize#84fitzgen merged 2 commits intobytecodealliance:mainfrom
Mrmaxmeier:main
Conversation
We call the reactor init function automatically before running the user's init function. Let's not call it twice if the user explicitly requests `_initialize`.
fitzgen
reviewed
May 17, 2023
Member
fitzgen
left a comment
There was a problem hiding this comment.
Thanks, can you add a test for this?
alexcrichton
pushed a commit
to alexcrichton/wizer
that referenced
this pull request
Oct 8, 2025
Avoid duplicate call to _initialize with `-f=_initialize`
alexcrichton
pushed a commit
to alexcrichton/wizer
that referenced
this pull request
Oct 8, 2025
Avoid duplicate call to _initialize with `-f=_initialize`
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.
Hi,
I'm using wizer to pre-initialize reactor modules with
--init-func="_initialize". wasi-libc recently added a check against calling the reactor initializer multiple times (WebAssembly/wasi-libc#388), which shows that wizer calls it twice in this case. (Once because the reactor initializer is automatically called and a second time because I'm setting it as the init function.)I think it's reasonable to simply skip the second call for
--init-func=_initialize. 🙂