How hard would it be to make clang available for run-make tests? What would it take?
(cc @simulacrum @kennytm @Pietro Albini @Alex Crichton)
I'm talking about the clang that we already build for LLDB, i.e. a version that matches rustc's LLVM
must it be "clang"? you could already use
Yes, it must be Clang
the use case would be testing cross-language optimizations
If it's already built, should be quite easy... we don't have the budget to build it though
I think it should cache very well via sccache. I don't know if we build the final executable currently, but we are building libclang for the LLDB component.
I don't think it'd be too too hard b/c we're already compiling the compiler's LLVM with clang on most builders
I suspect we'd probably add an opt-in flag to enable the tests but we could enable that on the bots
It would have to be a clang that matches the LLVM version of rustc though.
OK, I just did some testing and it seems that clang is already available in
run-make-fulldeps because it ends up in the
llvm/bin directory with the other LLVM tools. It's only built if
rust.lldb is set in
I guess we don't want to build clang by default together with LLVM, so I'm wondering what the best option would be here.
one thing we could do is:
1. provide a simple way for run-make tests to check whether clang is available and has the right version, and then
2. enable building lldb for some of the CI jobs
that's a bit brittle though since if someone disables building lldb for some reason, tests would go ignored and no one would notice...
is there a way to build clang "lazily", i.e. only when run-make-fulldeps is executed?
You can probably make sure that https://github.com/rust-lang/rust/blob/master/src/bootstrap/test.rs#L733 gets a
ensure method call for
clang only when running
I don't think that quite works because we already need to know whether LLDB/Clang needs to be built when LLVM is being built. At least it looks like that in the current setup.