Stream: git-wasmtime

Topic: wasmtime / PR #14151 cranelift-module: fix the no_std bui...


view this post on Zulip Wasmtime GitHub notifications bot (Aug 18 2026 at 11:35):

Lstarsky0 requested fitzgen for a review on PR #14151.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 18 2026 at 11:35):

Lstarsky0 opened PR #14151 from Lstarsky0:fix/cranelift-module-no-std to bytecodealliance:main:

cargo check -p cranelift-module --no-default-features fails on main with 11 errors, and --no-default-features --features core fails with 6. Both have been broken since #5173 (2022-11-03).

What is broken

cranelift/module/src/lib.rs is #![no_std] and aliases alloc as std when the std feature is off:

#[cfg(not(feature = "std"))]
extern crate alloc as std;

module.rs then uses three paths that only exist in real std:

site path
ModuleError::Allocation payload std::io::Error
the Error impl and its source() std::error::Error
two From impls std::convert::From

--features core does not help — it only pulls in hashbrown, so the same three paths still fail. Bare --no-default-features fails on those plus hashbrown itself, which the manifest only supplies through core.

Why it went unnoticed

cranelift-module appears in no file under .github/, so no job builds it in any non-default configuration.

The one configuration that forwards to it cannot catch it either. cranelift's core feature lists cranelift-module?/core, but the umbrella declares

cranelift-module = { workspace = true, optional = true }

without default-features = false, and the workspace entry does not set it either, so cranelift-module/std is on whenever the dep is. cargo tree -e features -p cranelift --no-default-features --features core,module shows core and std both active. cranelift-codegen is declared with default-features = false at the workspace level; cranelift-frontend and cranelift-module are not.

I have left that alone — whether cranelift's core should actually mean core is a separate call, and it would need this fix first anyway.

The change

That last one removes the cranelift-module/hashbrown feature. Nothing in the workspace names it; the umbrella only forwards ?/std and ?/core.

Testing

Three checks added to the micro_checks matrix. On unpatched main they fail:

check main with this PR
-p cranelift-module --no-default-features 11 errors ok
-p cranelift-module --no-default-features --features core 6 errors ok
-p cranelift-module --no-default-features --features core,enable-serde 6 errors ok

Also run locally, all clean: -p cranelift-module --all-features, cargo test -p cranelift-module, cargo clippy -p cranelift-module --all-targets and the same with --no-default-features, cargo fmt --all -- --check, and cargo check for cranelift-jit, cranelift-object, cranelift, cranelift-filetests and cranelift-tools. Cargo.lock is unchanged.

This does not make the crate buildable for a bare-metal target on its own — anyhow is a hard dependency carrying features = ['std']. It makes the configurations the crate already advertises compile again.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 18 2026 at 11:35):

Lstarsky0 requested wasmtime-compiler-reviewers for a review on PR #14151.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 18 2026 at 11:35):

Lstarsky0 requested wasmtime-default-reviewers for a review on PR #14151.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 18 2026 at 12:02):

bjorn3 commented on PR #14151:

std::error::Error is just a re-export of core::error::Error.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 18 2026 at 12:03):

bjorn3 deleted a comment on PR #14151:

std::error::Error is just a re-export of core::error::Error.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 18 2026 at 14:54):

github-actions[bot] added the label cranelift on PR #14151.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 18 2026 at 14:54):

github-actions[bot] added the label cranelift:module on PR #14151.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 18 2026 at 16:38):

:repeat: pchickey submitted PR review:

First, please review the AI tool policy https://github.com/bytecodealliance/governance/blob/main/AI_TOOL_POLICY.md

Second, cranelift-codegen's Cargo.toml describes that the core feature is no longer used, remaining in name only for compatibility purposes. So, cranelift-module's use of that feature also no longer needs to exist, and does not need to consume CI resources with test coverage.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 19 2026 at 09:34):

Lstarsky0 updated PR #14151.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 19 2026 at 09:45):

Lstarsky0 commented on PR #14151:

Read the policy. you are right about core, codegen has it as core = [], name only now. Dropped the forward and the two --features core CI lines with it. I left it as core = [] rather than deleting outright, since umbrella forwards cranelift-module?/core and the crate is published. Happy to delete both if you'd rather. frontend and native carry the same dead forward; left those alone.
The build fix underneath is a separate thing from core though. cargo check -p cranelift-module --no-default-features is 8 errors on main right now — hashbrown is imported unconditionally but was only pulled in by core, and a few impls reach for std::. That's what the one remaining CI line covers.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 21 2026 at 17:46):

:thumbs_up: pchickey submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 21 2026 at 17:46):

pchickey added PR #14151 cranelift-module: fix the no_std build and cover it in CI to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 21 2026 at 17:46):

pchickey commented on PR #14151:

Thank you

view this post on Zulip Wasmtime GitHub notifications bot (Aug 21 2026 at 18:12):

:check: pchickey merged PR #14151.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 21 2026 at 18:12):

pchickey removed PR #14151 cranelift-module: fix the no_std build and cover it in CI from the merge queue.


Last updated: Aug 30 2026 at 09:07 UTC