Why does defining a linker trigger a larger recompile with Leptos?

With Leptos, I noticed that having the linker set would cause very long recompiles. Without knowing anything about how it works, I assume that since it compiles the Wasm target first, everything is linked with a different linker. It's not clear to me what linker is used (on Linux), but it sounds like it's lld. Trying to set the linker for my x86 target to lld via rustflags = ["-Clink-arg=-fuse-ld=lld"] doesn't fix anything though. I thought about trying to disable the linker for this one project locally, but it's not possible to override rustflags yet. Anyway, I want to know why using lld isn't working if everything is ultimately using the same linker, and how/if I can make it work with lld.

Setting rustc flags cause a full recompile in any case. Maybe you can avoid this by setting the linker fully through cargo without manually setting rustc flags Configuration - The Cargo Book

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.