Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Merge with main#245

Merged
alexcrichton merged 4 commits intobytecodealliance:mainfrom
alexcrichton:merge
Aug 12, 2025
Merged

Merge with main#245
alexcrichton merged 4 commits intobytecodealliance:mainfrom
alexcrichton:merge

Conversation

@alexcrichton
Copy link
Copy Markdown
Member

Renewing a minimal baseline

alexcrichton and others added 4 commits August 12, 2025 17:46
Much of these are off-by-default at compile time currently so opt-in to
auditing them.
* Add a cwasm produced during testing to `.gitignore`

Added in wasip3-prototyping but never made its way upstream here, so
doing so now.

* Ignore all cwasms in gitignore
…alName` (#11415)

* Make Wasmtime's `FuncKey` one-to-one with Cranelift's `ir::UserExternalName`

`FuncKey`, which used to be called `CompileKey`, is now one-to-one with
`cranelift_codegen::ir::UserExternalName`, and is used for not just identifying
compilation objects but also relocations and call-graph edges. This allows us to
determine the `StaticModuleIndex` and `DefinedFuncIndex` pair for any
`cranelift_codegen::ir::FuncRef`, regardless of inlining depth, which fixes some
fuzz bugs on OSS-Fuzz.

This continues pushing on the idea that Wasmtime's compilation orchestration and
linking should be relatively agnostic to the kinds of things it is actually
compiling and linking, allowing us to tweak, add, and remove new kinds of
`FuncKey`s more easily. Adding a new `FuncKey` should not require modifying
relocation resolution, for example, just a little bit of code to run the
associated compilation and optionally some code to extract metadata into our
final artifacts for querying at runtime. Everything in between should Just
Continue Working. We still aren't all the way there yet, but this does bring us
a little bit closer.

Finally, in Cranelift's inlining pass, this adds a check that a block is
inserted in the layout before attempting to remove it from the layout, which
would otherwise cause panics. This was triggered by multi-level inlining and
now-unreachable blocks in the inner callees.

I'll note that this does update basically all of the disas tests, or at least
nearly all of them that make function calls. This is because the namespace/index
numbering pair changed slightly to align with `FuncKey`, but that should pretty
much be the only changes.

* remove debug info from panic message, it is only available in some `cfg`s

* fill out module doc comment

* Fix compilation without `component-model` feature

* Fix some more cfg compilations

* cargo fmt

* fix a wrong `&dyn Any` auto coercion; add helpful debug logging and assertions for this kind of thing
@alexcrichton alexcrichton enabled auto-merge August 12, 2025 19:30
@alexcrichton alexcrichton added this pull request to the merge queue Aug 12, 2025
Merged via the queue into bytecodealliance:main with commit 68389f7 Aug 12, 2025
44 checks passed
@alexcrichton alexcrichton deleted the merge branch August 12, 2025 20:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants