Hey folks,
While compiling a wasm32 canister on ICP, I bumped into a linking error which boils down to this simple repro:
#[unsafe(export_name = "name with spaces")]
pub fn name() {}
Compiling it with Rust 1.84-1.87 both for wasm32-unknown-unknown and x86_64 gives the syntax error in VERSION script error.
Here is the repro: https://github.com/berestovskyy/linker-bug
I also found two workarounds:
cargo build --target=wasm32-unknown-unknown. This does not work though on the latest Rust nightly... :(The nightly produces a more specific ; expected, but got with error:
Compilation log on 1.89.0-nightly (47c911e9e 2025-05-14)
Does this mean that the exports with spaces soon won't be supported by the toolchain?
The error message you've linked here looks like it's for compiling to native, e.g. "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib" is in the arguments, so are you sure this is project compiled to wasm?
Apologies, I think I confused rust-toolchain.toml (targets to install) and .cargo/config.toml (target to build). That's why adding an explicit target was fixing the issue...
Last updated: Dec 06 2025 at 05:03 UTC