rules_rust icon indicating copy to clipboard operation
rules_rust copied to clipboard

Dummy CC toolchain for wasm32

Open duarten opened this issue 1 year ago • 4 comments
trafficstars

Some crates need access to GCC for their build script even under wasm, like ring. However, rules_rust is setting a dummy toolchain.

duarten avatar Jul 27 '24 20:07 duarten

@duarten I ran into this and in my case it was due to a breaking change when upgrading from bazel 6.5.0 to 7.0.1. The fix was to specify this: --noincompatible_enable_cc_toolchain_resolution (fix suggested by @aherrmann)

nmattia avatar Aug 23 '24 15:08 nmattia

I guess that's a workaround, but there should a fix compatible with that flag (which I was already enabling for unrelated reasons). What I ended up doing was creating a cc toolchain for clang (which can cross-compile to wasm).

duarten avatar Aug 23 '24 17:08 duarten

the problem with above workaround is that it stops working on bazel 8+ (iiuc) and my reading of https://github.com/bazelbuild/rules_rust/issues/3242#issuecomment-2640934858 is that it also no longer works with recent rules_rust versions

@duarten ive tried to do similar but without success (my toolchain-fu is pretty weak) - can you share more details?

phlax avatar Mar 28 '25 15:03 phlax

I wouldn't be opposed to not registering the toolchain by default as long as there was a convenient flag to continue to do so.

UebelAndre avatar Mar 28 '25 15:03 UebelAndre