Currently, the output of llvm-config is different from the way upstream behaves, and I have heard that upstream does not plan to accept our changes. Our changes mean that dev-lang/rust must be built with its bundled llvm instead of the one we provide. I am opening this bug to discuss why we modify llvm-config and attempt to find another way to get the same result.
No. This is just stupid FUD made by one person who was too lazy/arrogant to even bother trying to ask what's up and instead went all the way 'you made my toy stop working, I'm going to do a huge QA violation to prove something stupid'. That said, someone should bother telling us what's wrong with rust first. Because really telling 'it uses this unsupported option, we must start supporting it immediately' is not anywhere close to helpful.
This is the error I got from rust-1.11.0 (it worked fine in 1.10.0): llvm-config: sources not installed, --obj-root not available CMake Error at CMakeLists.txt:100 (message): llvm-config failed with status 1 -- Configuring incomplete, errors occurred! See also "/var/tmp/portage/dev-lang/rust-1.11.0/work/rustc-1.11.0/x86_64-unknown-linux-gnu/rt/compiler-rt/CMakeFiles/CMakeOutput.log". /var/tmp/portage/dev-lang/rust-1.11.0/work/rustc-1.11.0/mk/rt.mk:465: recipe for target 'x86_64-unknown-linux-gnu/rt/libcompiler-rt.a' failed make: *** [x86_64-unknown-linux-gnu/rt/libcompiler-rt.a] Error 1 make: *** Waiting for unfinished jobs.... Full build log is here: https://dirkjan.ochtman.nl/files/build.log It's worth noting that upstream stopped using compiler-rt's CMake build system after branching the 1.11.0 release. I tried to backport their patch for this, but that didn't seem to solve the problem. Still, it would sure be nice if we can use the system LLVM to build rust.
It still does not explain why rust needs --obj-root. That directory does not exist on installed LLVM.
It's not rust that needs it, it's compiler-rt's build system. Apparently it has a reputation for being particularly shitty. https://github.com/rust-lang/rust/commit/ee6011fc71e02485f2dffcc25be64631c2008775
I talked to some people in #llvm earlier today. They told me that it's probably not possible to build compiler-rt outside of an LLVM build without hacking the build system. They said it's probably not too hard to hack it to do that, although running the tests would be a completely different story.
Why is rust building compiler-rt when LLVM installs one already?
I don't know exactly. When I asked, they said it's because not every platform has it (e.g. Windows). Anyway, maybe it would be more productive if you talk to the Rust developers directly, it doesn't seem very efficient for me to be a go-between.
Well, if they are bundling compiler-rt on Linux because Windows may not have it, you may guess what the fix is. Besides, I heard there were some improvements in compiler-rt build system, so it may eventually be fixed on that side as well. That said, I can look at rust when I have time. However, I have little time and my current focus is splitting clang again. This will take quite a while, and require some patching. It may also find problems with compiler-rt itself.
The easy way out would be to output known-wrong paths. Maybe /dev/null for both. This will get ENOTDIR when they actually try to do something, and most of the build systems seem to handle checking subpaths for existence first.
Ok, looked into it more and it looks like upstream is actually relying on --obj-root returning prefix when installed, however stupid that is. So --obj-root back to /usr, and --src-root to /dev/null. Do we find this important enough to warrant a revbump right now? Or do we have some other changes to apply?
Well, I would really like to version bump to the latest stable Rust compiler in the tree. Not sure whether you consider that important enough...
Good news, 3.8.1-r1 is still p.masked, so I guess I can add this and unmask it.
commit bf383aa2d04fcd952e797cb872eb08096061c307 Author: Michał Górny <mgorny@gentoo.org> AuthorDate: Sun Aug 21 20:34:41 2016 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: Sun Aug 21 20:50:44 2016 sys-devel/llvm: Improve llvm-config upstream compatibility, #591690 Improve the llvm-config installed by 3.8.1-r1 (masked) and the live ebuild to match upstream behavior better, and be more compatible with packages. Restore --obj-root to return prefix on installed package, and make --src-root return invalid /dev/null path instead of failing. Bug: https://bugs.gentoo.org/591690 Please try against llvm-3.8.1-r2.
Thanks! This seems to work for the rust-1.11.0 build. What are your plans regarding unmasking 3.8.1?
(In reply to Dirkjan Ochtman from comment #14) > Thanks! This seems to work for the rust-1.11.0 build. What are your plans > regarding unmasking 3.8.1? It's live already, though it lost few keywords on less common arches due to libcxx.