Does the rust linker take a long time for anyone else?
If I make a small change, recompiling takes a couple of seconds until it hits linking, then it takes well over a minute; probably significantly longer, I haven't actually timed it
What OS and CPU architecture are you on?
I haven't had it that slow no. I think there's a way to swap the linker using a cargo config file.
~/.cargo/config.toml
rustflags = ["-C", "link-arg=-fuse-ld=lld", "-C", "target-cpu=native"]
are you doing that already?
I'm using WSL
I found a comment on a rust blog that using LLVM's linker is faster
yes that's what the config I posted does
lld is llvm's linker
on WSL you need to have all your files in the Linux filesystem rather than Windows or things will be crazy slow. I had that problem when I was first setting up on this project.
There are some tips on this in the building_from_source.md or whatever it's called
Would it make sense to set lld as the linker in the Cargo files?
As far as I know everything is in the Linux filesystem
It breaks Wasm
wasm uses wasm-ld
I don't know if there are other reasons not to use lld
That makes sense
So I don't actually use that config I just posted because I mainly work on wasm
but that's what someone recommended to me so it might help you!
I'll give it a try
And looking at the WSL comments in BUILDING_FROM_SOURCE, I'm more sure that that isn't my issue. I cloned the repo from within Linux
Last updated: Jul 05 2025 at 12:14 UTC