Stream: git-wasmtime

Topic: wasmtime / issue #11450 `wasmtime run GC=no` doesn't seem...


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

jsturtevant opened issue #11450:

Thanks for filing a bug report! Please fill out the TODOs below.

Note: if you want to report a security issue, please read our security policy!

Test Case

Steps to Reproduce

Write a library that compiles your component with the following features from wasmtime:

wasmtime = { version="34", default-features = false, features = ["cranelift", "runtime", "component-model" ] }
    let mut config = Config::new();
  let engine = Engine::new(&config).unwrap();
  let bytes = std::fs::read(infile).unwrap();
  let serialized = if args.get_flag("component") {
      engine.precompile_component(&bytes).unwrap()
  } else {
      engine.precompile_module(&bytes).unwrap()
  };

Then try and run it in in wasmtime, turning off GC in the host, it fails to run:

wasmtime run -W gc=no -W component-model-gc=no --target x86_64-unknown-none --allow-precompiled --invoke 'echo("hi")' /home/jstur/projects/hyperlight-wasm/x64/debug/runcomponent.aot
Caused by:
    module was compiled without GC but GC is enabled in the host

Expected Results

I would expect that I can turn the features off and run them.

Actual Results

error module was compiled without GC but GC is enabled in the host

Versions and Environment

Wasmtime version or commit: any released version

Operating system: TODO

Architecture: TODO

Extra Info

Anything else you'd like to add?

I tracked it down to this being always on via build flag even though -W gc=no -W component-model-gc=no settings are turned off and causing a failure later on in processing.

https://github.com/bytecodealliance/wasmtime/blob/759ccdfaee65f8c470ccc5b8b63506a1af5cd32d/crates/wasmtime/src/config.rs#L2162C1-L2163C1

I moved this logic to use the gc flag and things worked. Then I found https://github.com/bytecodealliance/wasmtime/pull/10455#discussion_r2008287118 and wasn't sure what the correct solution is here.

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

jsturtevant added the bug label to Issue #11450.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 19 2025 at 20:10):

alexcrichton commented on issue #11450:

Thanks for the report! I've put up https://github.com/bytecodealliance/wasmtime/pull/11463 to propose addressing this which would make it easier to match features in this case.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 19 2025 at 21:08):

fitzgen closed issue #11450:

Thanks for filing a bug report! Please fill out the TODOs below.

Note: if you want to report a security issue, please read our security policy!

Test Case

Steps to Reproduce

Write a library that compiles your component with the following features from wasmtime:

wasmtime = { version="34", default-features = false, features = ["cranelift", "runtime", "component-model" ] }
    let mut config = Config::new();
  let engine = Engine::new(&config).unwrap();
  let bytes = std::fs::read(infile).unwrap();
  let serialized = if args.get_flag("component") {
      engine.precompile_component(&bytes).unwrap()
  } else {
      engine.precompile_module(&bytes).unwrap()
  };

Then try and run it in in wasmtime, turning off GC in the host, it fails to run:

wasmtime run -W gc=no -W component-model-gc=no --target x86_64-unknown-none --allow-precompiled --invoke 'echo("hi")' /home/jstur/projects/hyperlight-wasm/x64/debug/runcomponent.aot
Caused by:
    module was compiled without GC but GC is enabled in the host

Expected Results

I would expect that I can turn the features off and run them.

Actual Results

error module was compiled without GC but GC is enabled in the host

Versions and Environment

Wasmtime version or commit: any released version

Operating system: TODO

Architecture: TODO

Extra Info

Anything else you'd like to add?

I tracked it down to this being always on via build flag even though -W gc=no -W component-model-gc=no settings are turned off and causing a failure later on in processing.

https://github.com/bytecodealliance/wasmtime/blob/759ccdfaee65f8c470ccc5b8b63506a1af5cd32d/crates/wasmtime/src/config.rs#L2162C1-L2163C1

I moved this logic to use the gc flag and things worked. Then I found https://github.com/bytecodealliance/wasmtime/pull/10455#discussion_r2008287118 and wasn't sure what the correct solution is here.


Last updated: Dec 06 2025 at 06:05 UTC