New contributors might not necessarily need to recompile LLVM from scratch, especially if they already have a version on their system.
The setup script could detect the presence of llvm-config in the path and propose to set it automatically (this is common advice from here https://rustc-dev-guide.rust-lang.org/building/suggested.html#skipping-llvm-build)
@rustbot claim
I'm willing to work on this, if @jyn514 thinks it would be a useful addition
I would like to suggest download-ci-llvm on Linux. On Mac or windows I agree this is a good change, although installing llvm on windows sounds painful.
FWIW if you have a windows machine, looking into making download-ci-llvm work would be amazing, and likely benefit everyone using Windows since it'd "just work" presumably. I still need to find time to investigate on a mac (which I do have ready access to).
I'm on Linux, unfortunately, and don't have easy access to a Windows machine. I'll keep that in mind though :)
@jyn514 so on linux, do you want the setup to ask the user whether they want to use the CI-built llvm, or build their own? Or just add a download-ci-llvm = true for everyone by default in the templates?
The templates in src/bootstrap/defaults are on every machine, so we can't add download-ci-llvm there - it would cause weird compile failures on Mac and Windows. What we can do instead is add it to the _generated_ config.toml that setup creates.
Personally I think I'd always set download-ci-llvm = true on Linux without asking - the only reason you wouldn't is because it broke, but I think it's been working pretty reliably on linux. Maybe print out a message that you're downloading LLVM so they can debug issues if they go wrong?
I would be onboard with adding a download-ci-llvm = "if-available" or something like that; we can check if we're on x86_64-unknown-linux-gnu and use it then.