cargo-component icon indicating copy to clipboard operation
cargo-component copied to clipboard

Building with `--release` fails to generate one component type section

Open bnjbvr opened this issue 1 year ago • 3 comments

I've got this small repro, in which if I compile with cargo-component build, the component is created and can be loaded in wasmtime; but if I do cargo-component build --release, then it fails, saying that an imported interface doesn't exist. Inspecting the produced release wasm module with wasm-tools objdump shows there's no log-world component type section, while there is one such section in the non-release build.

edit: for some reason, in the original repro I do have other libraries which follow the same pattern (it's the library that's importing a component interface), and it works for all of them. Maybe a coincidence, but it's only the logging library that doesn't work somehow.

bnjbvr avatar May 18 '23 13:05 bnjbvr