Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Pulley support to wasmtime_test macro #10057

Merged
merged 4 commits into from
Jan 21, 2025

Conversation

irrio
Copy link
Contributor

@irrio irrio commented Jan 21, 2025

This PR updates the #[wasmtime_test] macro to add support for Pulley.

This was one of the last remaining items in the Pulley TODO List #9747, I figured I'd try to knock it out.

I've renamed the Cranelift compilation strategy to CraneliftNative in order to disambiguate it from CraneliftPulley and to directly match the symbol in the Compiler enum.

CraneliftPulley is now included by default in the compilation strategies used by #[wasmtime_test].

In order to support the tests that are targeting Winch specifically, I've added an only(...) specifier. So instead of #[wasmtime_test(strategies(not(Cranelift)))] it would be #[wasmtime_test(strategies(only(Winch)))].

Now that the wrap_and_typed_i31ref test was running multiple times with different strategies, the static HITS counter was leaking state into the other test and causing things to fail. I moved the counter into the Store to get rid of the static variable.

irrio added 4 commits January 20, 2025 20:35
…ifier.

Tests in `tests/all/fuel.rs` and `tests/all/winch_engine_features.rs`
were using `#[wasmtime_test(strategies(not(Cranelift)))]` to gate their
Winch specific tests. Now that there is a third compilation strategy,
those tests were failing against Pulley.

I've replaced those with `#[wasmtime_test(strategies(only(Winch)))]`
to be more clear that they are targeted specifically at Winch.
…nc.rs

The `static HITS` variable was sharing state between tests,
causing them to clobber each other when ran together.
@irrio irrio requested a review from a team as a code owner January 21, 2025 04:55
@irrio irrio requested review from alexcrichton and removed request for a team January 21, 2025 04:55
Copy link
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.

Thanks for this!

@alexcrichton alexcrichton added this pull request to the merge queue Jan 21, 2025
@alexcrichton alexcrichton mentioned this pull request Jan 21, 2025
13 tasks
Merged via the queue into bytecodealliance:main with commit a6227aa Jan 21, 2025
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants