Skip to content

Add cfgs to distinguish WASIp3 and WASIp2 targets - #142

Open
adamrk wants to merge 12 commits into
bytecodealliance:mainfrom
adamrk:abk/p3-feature-base
Open

Add cfgs to distinguish WASIp3 and WASIp2 targets#142
adamrk wants to merge 12 commits into
bytecodealliance:mainfrom
adamrk:abk/p3-feature-base

Conversation

@adamrk

@adamrk adamrk commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Gate WASIp2 specific features behind cfg(all(target_os = "was", target_env = "p2")) to set up WASIp3 implementation.

Addresses #144

@adamrk

adamrk commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Still investigating the test failure, but I was able to reproduce it on main so it's likely some existing flakiness.

@adamrk

adamrk commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Fix for the test here: #143

@pchickey pchickey mentioned this pull request Sep 2, 2026
12 tasks
@adamrk
adamrk force-pushed the abk/p3-feature-base branch from 170b21b to ea32edf Compare September 3, 2026 14:24
Comment thread build.rs Outdated
Comment on lines +3 to +10
fn main() {
cfg_aliases! {
// TODO https://github.com/bytecodealliance/wstd/issues/147: Swap these
// to use `target_env` instead.
p2: { feature = "p2" },
p3: { feature = "p3" },
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Saw this handy aliasing in #127 which can let us switch to using the target without a big diff. Not sure what our general philosophy is about pulling in entire crates for such little things though. I left it as a separate commit so it's easy to revert if we don't want it.

@adamrk
adamrk requested a review from pchickey September 3, 2026 14:26
Comment on lines -32 to +34
rustup default "${{ steps.select.outputs.version }}"
# `rustup default` gets overwritten by rust-toolchain.toml, `rustup
# override` has higher precedence though.
rustup override set "${{ steps.select.outputs.version }}"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note: it looks like our previous setup was actually running the stable toolchain for the msrv and nightly jobs because the included rust-toolchain.toml file was overriding the default set here.

Comment thread Cargo.toml
Comment on lines -62 to +67
rust-version = "1.91.1"
rust-version = "1.92.0"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Had to bump the msrv because 1.91.1 doesn't have the p3 target_env and using it will throw a warning.

@adamrk adamrk changed the title Cargo feature for WASIp3 Add cfgs to distinguish WASIp3 and WASIp2 targets Sep 9, 2026
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