Skip to content

only remove _initialize function from module snapshots#12540

Merged
dicej merged 2 commits intobytecodealliance:mainfrom
dicej:wizer-initialize-fix
Feb 9, 2026
Merged

only remove _initialize function from module snapshots#12540
dicej merged 2 commits intobytecodealliance:mainfrom
dicej:wizer-initialize-fix

Conversation

@dicej
Copy link
Copy Markdown
Contributor

@dicej dicej commented Feb 6, 2026

Removing _initialize from snapshots of wit-component-produced components leads to invalid inputs because it breaks the alias wit-component creates. Moreover, removing that function is redundant because it is only called from a start function which is also removed during snapshotting.

Ideally, removing _initialize and any aliases which point to it would be taken care of a general-purpose component dead code removal tool, but no such tool exists yet. In the meantime, leaving it there creates a bit of code bloat but is otherwise harmless.

Removing `_initialize` from snapshots of wit-component-produced components leads
to invalid inputs because it breaks the alias `wit-component` creates.
Moreover, removing that function is redundant because it is only called from a
start function which is also removed during snapshotting.

Ideally, removing `_initialize` and any aliases which point to it would be taken
care of a general-purpose component dead code removal tool, but no such tool
exists yet.  In the meantime, leaving it there creates a bit of code bloat but
is otherwise harmless.
@dicej dicej requested a review from alexcrichton February 6, 2026 23:55
@dicej dicej requested a review from a team as a code owner February 6, 2026 23:55
Copy link
Copy Markdown
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me with a test

@github-actions github-actions bot added the wizer Issues related to Wizer snapshotting, pre-initialization, and the `wasmtime wizer` subcommand label Feb 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 7, 2026

Subscribe to Label Action

cc @fitzgen

Details This issue or pull request has been labeled: "wizer"

Thus the following users have been cc'd because of the following labels:

  • fitzgen: wizer

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@dicej dicej enabled auto-merge February 9, 2026 16:50
@dicej dicej force-pushed the wizer-initialize-fix branch from 931e5e0 to 29a2e88 Compare February 9, 2026 17:19
@dicej dicej added this pull request to the merge queue Feb 9, 2026
Merged via the queue into bytecodealliance:main with commit e693705 Feb 9, 2026
45 checks passed
@dicej dicej deleted the wizer-initialize-fix branch February 9, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wizer Issues related to Wizer snapshotting, pre-initialization, and the `wasmtime wizer` subcommand

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants