Summary: | sys-devel/clang-9.0.0 on prefix - ninja: error: '/usr/lib/llvm-6.0/lib/cmake/llvm/GenerateVersionFromVCS.cmake', needed by 'lib/Basic/VCSVersion.inc', missing and no known rule to make it | ||
---|---|---|---|
Product: | Gentoo/Alt | Reporter: | gerion <gerion.entrup> |
Component: | Prefix Support | Assignee: | Gentoo Prefix <prefix> |
Status: | RESOLVED OBSOLETE | ||
Severity: | normal | CC: | kde, llvm, mgorny |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=733480 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
build.log
environment.gz |
Description
gerion
2019-12-05 16:22:49 UTC
Created attachment 598532 [details]
build.log
What's your PATH in build environment? Generally our LLVM dir should come first, and cause CMake to use it rather than host's LLVM. (In reply to Michał Górny from comment #2) > What's your PATH in build environment? ``` % /srv/scratch/entrup/gentoo/startprefix Entering Gentoo Prefix /srv/scratch/entrup/gentoo entrup:~% echo $PATH /home/srastaff/entrup/.local/share/zplug/bin:/home/srastaff/entrup/.local/bin:/srv/scratch/entrup/gentoo/usr/lib/llvm/9/bin:/srv/scratch/entrup/gentoo/usr/local/sbin:/srv/scratch/entrup/gentoo/usr/local/bin:/srv/scratch/entrup/gentoo/usr/sbin:/srv/scratch/entrup/gentoo/usr/bin:/srv/scratch/entrup/gentoo/sbin:/srv/scratch/entrup/gentoo/bin:/srv/scratch/entrup/gentoo/opt/bin:/usr/sbin:/sbin:/usr/bin:/bin:/home/srastaff/entrup/.bin entrup:~% emerge -a1 clang ... and fail ``` Maybe the local stuff is interesting, too: ``` % ls ~/.local/bin alembic datafreeze easy_install flask gunicorn_paster jp.pyc mako-render netaddr rst2html.pyc rst2html4.pyc rst2html5.pyc rst2latex.pyc rst2man.pyc rst2odt.pyc rst2odt_prepstyles.pyc rst2pseudoxml.pyc rst2s5.pyc rst2xetex.pyc rst2xml.pyc rstpep2html.pyc chardetect dotenv easy_install-2.7 gunicorn jp.py jsonschema meson rst2html.py rst2html4.py rst2html5.py rst2latex.py rst2man.py rst2odt.py rst2odt_prepstyles.py rst2pseudoxml.py rst2s5.py rst2xetex.py rst2xml.py rstpep2html.py % ls ~/.local/share/zplug/bin zplug-env ``` I actually meant temp/environment(.bz2) from Portage build env. Alternatively, put a 'die "$PATH"' in the ebuild (in src_compile(), I suppose). Ah, ok. The path is: /srv/scratch/entrup/gentoo/var/tmp/portage/sys-devel/clang-9.0.0/temp/python3.6/bin:/srv/scratch/entrup/gentoo/usr/lib/llvm/9/bin:/srv/scratch/entrup/gentoo/usr/lib/portage/python3.6/ebuild-helpers/unprivileged:/srv/scratch/entrup/gentoo/usr/lib/portage/python3.6/ebuild-helpers:/srv/scratch/entrup/gentoo/usr/lib/llvm/9/bin:/srv/scratch/entrup/gentoo/usr/local/sbin:/srv/scratch/entrup/gentoo/usr/local/bin:/srv/scratch/entrup/gentoo/usr/sbin:/srv/scratch/entrup/gentoo/usr/bin:/srv/scratch/entrup/gentoo/sbin:/srv/scratch/entrup/gentoo/bin:/srv/scratch/entrup/gentoo/opt/bin:/usr/sbin:/sbin:/usr/bin:/bin For me, this looks like a Cmake error. How does Cmake search its build files in other directories? Created attachment 598534 [details]
environment.gz
That second path on the list should be the right one. You have some /srv/scratch/entrup/gentoo/usr/lib/llvm/9/lib*/cmake/llvm or something like that, correct? CMake logic is quite weird. Generally, we're relying on the behavior of looking for files in ../${libdir}/cmake relative to directories in PATH. Which makes my first suspicion that it doesn't get correct libdir there. Or that Ubuntu is using some magic that puts higher priority on their directory. https://cmake.org/cmake/help/v3.0/command/find_package.html Grep for 'search path'. (In reply to Michał Górny from comment #8) > That second path on the list should be the right one. You have some > /srv/scratch/entrup/gentoo/usr/lib/llvm/9/lib*/cmake/llvm or something like > that, correct? Yes ``` % ls /srv/scratch/entrup/gentoo/usr/lib/llvm/9/lib64/cmake/llvm/ ... GenerateVersionFromVCS.cmake ... ``` > CMake logic is quite weird. Generally, we're relying on the behavior of > looking for files in ../${libdir}/cmake relative to directories in PATH. > Which makes my first suspicion that it doesn't get correct libdir there. Can I check this somehow? This is the output of `env | grep lib` within src_compile: ``` PORTAGE_PYTHONPATH=/srv/scratch/entrup/gentoo/usr/lib64/python3.6/site-packages PORTAGE_FEATURES=strict merge-sync force-prefix unmerge-orphans ebuild-locks assume-digests news preserve-libs unmerge-logs sfperms protect-owned ipc-sandbox nostrip binpkg-logs multilib-strict fixlafiles network-sandbox parallel-install parallel-fetch binpkg-docompress config-protect-if-modified distlocks unprivileged unknown-features-warn pid-sandbox binpkg-dostrip ROOTPATH=/srv/scratch/entrup/gentoo/usr/lib/llvm/9/bin:/srv/scratch/entrup/gentoo/usr/local/sbin:/srv/scratch/entrup/gentoo/usr/local/bin:/srv/scratch/entrup/gentoo/usr/sbin:/srv/scratch/entrup/gentoo/usr/bin:/srv/scratch/entrup/gentoo/sbin:/srv/scratch/entrup/gentoo/bin:/srv/scratch/entrup/gentoo/opt/bin:/usr/sbin:/sbin:/usr/bin:/bin MULTILIB_STRICT_DIRS=/lib32 /lib /usr/lib32 /usr/lib /usr/kde/*/lib32 /usr/kde/*/lib /usr/qt/*/lib32 /usr/qt/*/lib /usr/X11R6/lib32 /usr/X11R6/lib IUSE_EFFECTIVE=abi_mips_n32 abi_mips_n64 abi_mips_o32 abi_riscv_lp64 abi_riscv_lp64d abi_s390_32 abi_s390_64 abi_x86_32 abi_x86_64 abi_x86_x32 alpha amd64 amd64-fbsd amd64-linux arm arm64 debug default-compiler-rt default-libcxx doc elibc_AIX elibc_Cygwin elibc_Darwin elibc_DragonFly elibc_FreeBSD elibc_HPUX elibc_Interix elibc_NetBSD elibc_OpenBSD elibc_SunOS elibc_Winnt elibc_bionic elibc_glibc elibc_mingw elibc_mintlib elibc_musl elibc_uclibc hppa ia64 kernel_AIX kernel_Darwin kernel_FreeBSD kernel_HPUX kernel_NetBSD kernel_OpenBSD kernel_SunOS kernel_Winnt kernel_freemint kernel_linux llvm_targets_AArch64 llvm_targets_AMDGPU llvm_targets_ARM llvm_targets_BPF llvm_targets_Hexagon llvm_targets_Lanai llvm_targets_MSP430 llvm_targets_Mips llvm_targets_NVPTX llvm_targets_PowerPC llvm_targets_RISCV llvm_targets_Sparc llvm_targets_SystemZ llvm_targets_WebAssembly llvm_targets_X86 llvm_targets_XCore m68k m68k-mint mips ppc ppc-aix ppc-macos ppc64 ppc64-linux prefix prefix-guest prefix-stack python_single_target_python2_7 python_single_target_python3_5 python_single_target_python3_6 python_single_target_python3_7 python_targets_python2_7 python_targets_python3_5 python_targets_python3_6 python_targets_python3_7 riscv s390 sh sparc sparc-solaris sparc64-solaris static-analyzer test userland_BSD userland_GNU x64-cygwin x64-macos x64-solaris x86 x86-cygwin x86-fbsd x86-linux x86-macos x86-solaris x86-winnt xml INHERITED= toolchain-funcs multilib multiprocessing ninja-utils eutils flag-o-matic xdg-utils cmake-utils llvm llvm.org multibuild multilib-build multilib-minimal pax-utils python-utils-r1 python-single-r1 LIBDIR_amd64=lib64 FEATURES=strict merge-sync force-prefix unmerge-orphans ebuild-locks assume-digests news preserve-libs unmerge-logs sfperms protect-owned ipc-sandbox nostrip binpkg-logs multilib-strict fixlafiles network-sandbox parallel-install parallel-fetch binpkg-docompress config-protect-if-modified distlocks unprivileged unknown-features-warn pid-sandbox binpkg-dostrip PORTAGE_BIN_PATH=/srv/scratch/entrup/gentoo/usr/lib/portage/python3.6 PORTAGE_PYM_PATH=/srv/scratch/entrup/gentoo/usr/lib64/python3.6/site-packages MULTILIB_STRICT_EXEMPT=(perl5|gcc|gcc-lib|binutils|eclipse-3|debug|portage|udev|systemd|clang|python-exec|llvm) BOOTSTRAP_USE=unicode internal-glib pkg-config split-usr python_targets_python3_6 python_targets_python2_7 multilib LIBDIR_x32=libx32 USE_EXPAND_VALUES_ELIBC=AIX bionic Cygwin Darwin DragonFly FreeBSD glibc HPUX Interix mingw mintlib musl NetBSD OpenBSD SunOS uclibc Winnt LIBDIR_default=lib PATH=/srv/scratch/entrup/gentoo/var/tmp/portage/sys-devel/clang-9.0.0/temp/python3.6/bin:/srv/scratch/entrup/gentoo/usr/lib/llvm/9/bin:/srv/scratch/entrup/gentoo/usr/lib/portage/python3.6/ebuild-helpers/unprivileged:/srv/scratch/entrup/gentoo/usr/lib/portage/python3.6/ebuild-helpers:/srv/scratch/entrup/gentoo/usr/lib/llvm/9/bin:/srv/scratch/entrup/gentoo/usr/local/sbin:/srv/scratch/entrup/gentoo/usr/local/bin:/srv/scratch/entrup/gentoo/usr/sbin:/srv/scratch/entrup/gentoo/usr/bin:/srv/scratch/entrup/gentoo/sbin:/srv/scratch/entrup/gentoo/bin:/srv/scratch/entrup/gentoo/opt/bin:/usr/sbin:/sbin:/usr/bin:/bin USE=abi_x86_64 amd64 elibc_glibc kernel_linux llvm_targets_ARM llvm_targets_BPF llvm_targets_RISCV llvm_targets_WebAssembly llvm_targets_X86 prefix python_single_target_python3_6 python_targets_python2_7 python_targets_python3_6 static-analyzer userland_GNU LIBDIR_x86=lib32 ELIBC=glibc ``` This is beyond my knowledge, and I'm afraid I can't find sufficient time to try to figure it out. I'm reassigning the bug to Prefix team, and CC-ing cmake maintainers in case they could help. Maybe interesting. I adjusted the src_configure phase with:
```
mycmakeargs+=(
-DCMAKE_FIND_DEBUG_MODE=1
)
```
The relevant output seems to be:
```
>>> Working in BUILD_DIR: "/srv/scratch/entrup/gentoo/var/tmp/portage/sys-devel/clang-9.0.0/work/x/y/clang-abi_x86_64.amd64"
cmake -C /srv/scratch/entrup/gentoo/var/tmp/portage/sys-devel/clang-9.0.0/work/x/y/clang-abi_x86_64.amd64/gentoo_common_config.cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/srv/scratch/entrup/gentoo/usr -DCMAKE_INSTALL_PREFIX=/srv/scratch/entrup/gentoo/usr/lib/llvm/9 -DCMAKE_INSTALL_MANDIR=/srv/scratch/entrup/gentoo/usr/lib/llvm/9/share/man -DCLANG_RESOURCE_DIR=../../../../lib/clang/9.0.0 -DBUILD_SHARED_LIBS=ON -DLLVM_TARGETS_TO_BUILD=ARM;BPF;RISCV;WebAssembly;X86 -DLLVM_BUILD_TESTS=no -DLLVM_ENABLE_EH=ON -DLLVM_ENABLE_RTTI=ON -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=yes -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp -DCLANG_DEFAULT_CXX_STDLIB= -DCLANG_DEFAULT_RTLIB= -DCLANG_ENABLE_ARCMT=yes -DCLANG_ENABLE_STATIC_ANALYZER=yes -DCLANG_INCLUDE_DOCS=no -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=no -DGCC_INSTALL_PREFIX=/srv/scratch/entrup/gentoo/usr -DCMAKE_FIND_DEBUG_MODE=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE=/srv/scratch/entrup/gentoo/var/tmp/portage/sys-devel/clang-9.0.0/work/x/y/clang-abi_x86_64.amd64/gentoo_toolchain.cmake /srv/scratch/entrup/gentoo/var/tmp/portage/sys-devel/clang-9.0.0/work/x/y/clang
loading initial cache file /srv/scratch/entrup/gentoo/var/tmp/portage/sys-devel/clang-9.0.0/work/x/y/clang-abi_x86_64.amd64/gentoo_common_config.cmake
-- The C compiler identification is GNU 9.2.0
-- The CXX compiler identification is GNU 9.2.0
-- Check for working C compiler: /srv/scratch/entrup/gentoo/usr/bin/x86_64-pc-linux-gnu-gcc
-- Check for working C compiler: /srv/scratch/entrup/gentoo/usr/bin/x86_64-pc-linux-gnu-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /srv/scratch/entrup/gentoo/usr/bin/x86_64-pc-linux-gnu-g++
-- Check for working CXX compiler: /srv/scratch/entrup/gentoo/usr/bin/x86_64-pc-linux-gnu-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Checking prefix [/srv/scratch/entrup/gentoo/var/tmp/portage/sys-devel/clang-9.0.0/work/x/y/clang/]
Checking file [/srv/scratch/entrup/gentoo/var/tmp/portage/sys-devel/clang-9.0.0/work/x/y/clang/LLVMConfig.cmake]
Checking file [/srv/scratch/entrup/gentoo/var/tmp/portage/sys-devel/clang-9.0.0/work/x/y/clang/llvm-config.cmake]
Checking file [/srv/scratch/entrup/gentoo/var/tmp/portage/sys-devel/clang-9.0.0/work/x/y/clang/cmake/LLVMConfig.cmake]
Checking file [/srv/scratch/entrup/gentoo/var/tmp/portage/sys-devel/clang-9.0.0/work/x/y/clang/cmake/llvm-config.cmake]
Checking prefix [/srv/scratch/entrup/gentoo/var/tmp/portage/sys-devel/clang-9.0.0/temp/python3.6/]
Checking file [/srv/scratch/entrup/gentoo/var/tmp/portage/sys-devel/clang-9.0.0/temp/python3.6/LLVMConfig.cmake]
Checking file [/srv/scratch/entrup/gentoo/var/tmp/portage/sys-devel/clang-9.0.0/temp/python3.6/llvm-config.cmake]
Checking prefix [/srv/scratch/entrup/gentoo/usr/lib/llvm/9/]
Checking file [/srv/scratch/entrup/gentoo/usr/lib/llvm/9/LLVMConfig.cmake]
Checking file [/srv/scratch/entrup/gentoo/usr/lib/llvm/9/llvm-config.cmake]
Checking prefix [/srv/scratch/entrup/gentoo/usr/lib/portage/python3.6/ebuild-helpers/unprivileged/]
Checking file [/srv/scratch/entrup/gentoo/usr/lib/portage/python3.6/ebuild-helpers/unprivileged/LLVMConfig.cmake]
Checking file [/srv/scratch/entrup/gentoo/usr/lib/portage/python3.6/ebuild-helpers/unprivileged/llvm-config.cmake]
Checking prefix [/srv/scratch/entrup/gentoo/usr/lib/portage/python3.6/ebuild-helpers/]
Checking file [/srv/scratch/entrup/gentoo/usr/lib/portage/python3.6/ebuild-helpers/LLVMConfig.cmake]
Checking file [/srv/scratch/entrup/gentoo/usr/lib/portage/python3.6/ebuild-helpers/llvm-config.cmake]
Checking prefix [/srv/scratch/entrup/gentoo/usr/local/]
Checking file [/srv/scratch/entrup/gentoo/usr/local/LLVMConfig.cmake]
Checking file [/srv/scratch/entrup/gentoo/usr/local/llvm-config.cmake]
Checking prefix [/srv/scratch/entrup/gentoo/usr/]
Checking file [/srv/scratch/entrup/gentoo/usr/LLVMConfig.cmake]
Checking file [/srv/scratch/entrup/gentoo/usr/llvm-config.cmake]
Checking file [/srv/scratch/entrup/gentoo/usr/lib/llvm/LLVMConfig.cmake]
Checking file [/srv/scratch/entrup/gentoo/usr/lib/llvm/llvm-config.cmake]
Checking prefix [/srv/scratch/entrup/gentoo/]
Checking file [/srv/scratch/entrup/gentoo/LLVMConfig.cmake]
Checking file [/srv/scratch/entrup/gentoo/llvm-config.cmake]
Checking prefix [/srv/scratch/entrup/gentoo/opt/]
Checking prefix [/usr/]
Checking file [/usr/LLVMConfig.cmake]
Checking file [/usr/llvm-config.cmake]
Checking file [/usr/lib/llvm-6.0/LLVMConfig.cmake]
Checking file [/usr/lib/llvm-6.0/llvm-config.cmake]
Checking file [/usr/share/llvm-6.0/LLVMConfig.cmake]
Checking file [/usr/share/llvm-6.0/llvm-config.cmake]
Checking file [/usr/lib/llvm-6.0/cmake/LLVMConfig.cmake]
-- Linker detection: GNU ld
...
```
That means, it actually searches in the Gentoo LLVM but does not find LLVMConfig.cmake there.
Relevant:
```
% pwd
/srv/scratch/entrup/gentoo/usr/lib/llvm
% find -name 'llvm-config.cmake'
% find -name 'LLVMConfig.cmake'
./9/lib64/cmake/llvm/LLVMConfig.cmake
```
That may actually be a red herring, i.e. the search path accidentally resembling Gentoo LLVM location. (In reply to Michał Górny from comment #12) > That may actually be a red herring Hm, ok. I have tried to use it, anyway. I have put a file "LLVMConfig.cmake" with this content in the LLVM folder (/srv/scratch/entrup/gentoo/usr/lib/llvm/9): ``` include(${CMAKE_CURRENT_LIST_DIR}/lib64/cmake/llvm/LLVMConfig.cmake) list(APPEND CMAKE_MODULE_PATH ${LLVM_CMAKE_DIR}) ``` Clang then builds. Is of course a workaround. I have two prefixes, one with clang-5.0 through clang-9.0 installed, and another just with clang-9.0. Could it be a local setup problem? Can you please print your PATH and confirm that you are using CMake from prefix? (In reply to Guilherme Amadio from comment #14) > I have two prefixes, one with clang-5.0 through clang-9.0 installed, and > another just with clang-9.0. Could it be a local setup problem? I have used the provided interactive script to install prefix. Should be all standard stuff. > Can you please print your PATH I have printed my path already. > and confirm that you are using CMake from prefix? ``` % /srv/scratch/entrup/gentoo/startprefix Entering Gentoo Prefix /srv/scratch/entrup/gentoo % which cmake /srv/scratch/entrup/gentoo/usr/bin/cmake ``` (In reply to gerion from comment #15) > (In reply to Guilherme Amadio from comment #14) > > I have two prefixes, one with clang-5.0 through clang-9.0 installed, and > > another just with clang-9.0. Could it be a local setup problem? > I have used the provided interactive script to install prefix. Should be all > standard stuff. > > > Can you please print your PATH > I have printed my path already. Sorry, I only saw that after adding my comment. I see you prepend some things to PATH. That won't play nice with prefix in general, and that could be the cause of your CMake problems, as CMake uses the PATH to search for things by replacing bin directories with other paths. Also, another thing that might create problems is CMake's own package registry in ~/.cmake. If you installed another llvm by hand, check that this registry is not finding stuff for prefix as well. > > and confirm that you are using CMake from prefix? > ``` > % /srv/scratch/entrup/gentoo/startprefix > Entering Gentoo Prefix /srv/scratch/entrup/gentoo > % which cmake > /srv/scratch/entrup/gentoo/usr/bin/cmake > ``` I will try re-emerging clang in my prefixes to check if it's an issue with newer versions of CMake. One thing that might cause problems is the fact that no version is exported in the LLVM CMake configuration, so CMake sometimes mixes things up. Maybe try to add an option of -DLLVM_DIR=/srv/scratch/entrup/gentoo/usr/lib/llvm/9/lib64/cmake/llvm to your EXTRA_ECONF (the directory containing LLVMConfig.cmake) or -DLLVM_CONFIG=/srv/scratch/entrup/gentoo/usr/lib/llvm/9/bin/llvm-config. This is a better workaround than placing an LLVMConfig.cmake where CMake will look based on PATH. (In reply to Guilherme Amadio from comment #16) > (In reply to gerion from comment #15) > > > Can you please print your PATH > > I have printed my path already. > > Sorry, I only saw that after adding my comment. I see you prepend some > things to PATH. That won't play nice with prefix in general, and that could > be the cause of your CMake problems, as CMake uses the PATH to search for > things by replacing bin directories with other paths. If I understand Michał Górny right, my local PATH is not respected by Portage anyway but overwritten with another (clean) PATH. But yes, I have already noticed that this mixes things up. Maybe the best way is to do it in the startprefix path. When I remove my faked LLVMConfig.cmake file and edit my PATH variable so it only contains prefix paths, the error is the same as reported. > Also, another thing > that might create problems is CMake's own package registry in ~/.cmake. I have no ~/.cmake folder or file. > If you installed another llvm by hand, check that this registry is not finding > stuff for prefix as well. I have once done it on another machine but with a shared home directory. However, my hand installed llvm was also a LLVM 9 and not LLVM 6 from Ubuntu. > > > and confirm that you are using CMake from prefix? > > ``` > > % /srv/scratch/entrup/gentoo/startprefix > > Entering Gentoo Prefix /srv/scratch/entrup/gentoo > > % which cmake > > /srv/scratch/entrup/gentoo/usr/bin/cmake > > ``` > > I will try re-emerging clang in my prefixes to check if it's an issue with > newer versions of CMake. One thing that might cause problems is the fact > that no version is exported in the LLVM CMake configuration, so CMake > sometimes mixes things up. Maybe try to add an option of > -DLLVM_DIR=/srv/scratch/entrup/gentoo/usr/lib/llvm/9/lib64/cmake/llvm to > your EXTRA_ECONF (the directory containing LLVMConfig.cmake) or > -DLLVM_CONFIG=/srv/scratch/entrup/gentoo/usr/lib/llvm/9/bin/llvm-config. > This is a better workaround than placing an LLVMConfig.cmake where CMake > will look based on PATH. Will do, but I don't understand where to place the EXTRA_ECONF variable. Is it within the ebuild or can I place it in make.conf etc? (In reply to gerion from comment #17) > (In reply to Guilherme Amadio from comment #16) > > I will try re-emerging clang in my prefixes to check if it's an issue with > > newer versions of CMake. One thing that might cause problems is the fact > > that no version is exported in the LLVM CMake configuration, so CMake > > sometimes mixes things up. Maybe try to add an option of > > -DLLVM_DIR=/srv/scratch/entrup/gentoo/usr/lib/llvm/9/lib64/cmake/llvm to > > your EXTRA_ECONF (the directory containing LLVMConfig.cmake) or > > -DLLVM_CONFIG=/srv/scratch/entrup/gentoo/usr/lib/llvm/9/bin/llvm-config. > > This is a better workaround than placing an LLVMConfig.cmake where CMake > > will look based on PATH. > Will do, but I don't understand where to place the EXTRA_ECONF variable. Is > it within the ebuild or can I place it in make.conf etc? At first, just use EXTRA_ECONF="..." emerge clang, and if that works, you can create a etc/portage/env/clang and place it there, than add a file etc/portage/pacakge.env with "sys-devel/clang clang" as content. I will come back to this bug once I can reproduce and debug the problem. (In reply to gerion from comment #17) > (In reply to Guilherme Amadio from comment #16) > > (In reply to gerion from comment #15) > > > > Can you please print your PATH > > > I have printed my path already. > > > > Sorry, I only saw that after adding my comment. I see you prepend some > > things to PATH. That won't play nice with prefix in general, and that could > > be the cause of your CMake problems, as CMake uses the PATH to search for > > things by replacing bin directories with other paths. > If I understand Michał Górny right, my local PATH is not respected by > Portage anyway but overwritten with another (clean) PATH. But yes, I have > already noticed that this mixes things up. Maybe the best way is to do it in > the startprefix path. > > When I remove my faked LLVMConfig.cmake file and edit my PATH variable so it > only contains prefix paths, the error is the same as reported. There could be other environment variables causing trouble, please look for `env | grep PATH` and `env | grep CMAKE` to see if there is anything suspicious. This is the modified ebuild code: ``` ... multilib_src_compile() { echo "---------------------------------: $PATH" env | grep lib echo "CMAKE" env | grep -i cmake echo "PATH" env | grep -i path echo "--------------------------------" cmake-utils_src_compile ... ``` and this is the output: ``` >>> Compiling source in /srv/scratch/entrup/gentoo/var/tmp/portage/sys-devel/clang-9.0.0/work/x/y/clang ... * abi_x86_64.amd64: running multilib-minimal_abi_src_compile ---------------------------------: /srv/scratch/entrup/gentoo/var/tmp/portage/sys-devel/clang-9.0.0/temp/python3.6/bin:/srv/scratch/entrup/gentoo/usr/lib/llvm/9/bin:/srv/scratch/entrup/gentoo/usr/lib/portage/python3.6/ebuild-helpers/unprivileged:/srv/scratch/entrup/gentoo/usr/lib/portage/python3.6/ebuild-helpers:/srv/scratch/entrup/gentoo/usr/lib/llvm/9/bin:/srv/scratch/entrup/gentoo/usr/local/sbin:/srv/scratch/entrup/gentoo/usr/local/bin:/srv/scratch/entrup/gentoo/usr/sbin:/srv/scratch/entrup/gentoo/usr/bin:/srv/scratch/entrup/gentoo/sbin:/srv/scratch/entrup/gentoo/bin:/srv/scratch/entrup/gentoo/opt/bin:/usr/sbin:/sbin:/usr/bin:/bin PORTAGE_PYTHONPATH=/srv/scratch/entrup/gentoo/usr/lib64/python3.6/site-packages PORTAGE_FEATURES=sfperms protect-owned unmerge-orphans binpkg-logs parallel-install unprivileged pid-sandbox parallel-fetch merge-sync binpkg-docompress config-protect-if-modified multilib-strict preserve-libs network-sandbox unknown-features-warn fixlafiles strict news ipc-sandbox force-prefix assume-digests unmerge-logs nostrip ebuild-locks binpkg-dostrip distlocks ROOTPATH=/srv/scratch/entrup/gentoo/usr/lib/llvm/9/bin:/srv/scratch/entrup/gentoo/usr/local/sbin:/srv/scratch/entrup/gentoo/usr/local/bin:/srv/scratch/entrup/gentoo/usr/sbin:/srv/scratch/entrup/gentoo/usr/bin:/srv/scratch/entrup/gentoo/sbin:/srv/scratch/entrup/gentoo/bin:/srv/scratch/entrup/gentoo/opt/bin:/usr/sbin:/sbin:/usr/bin:/bin MULTILIB_STRICT_DIRS=/lib32 /lib /usr/lib32 /usr/lib /usr/kde/*/lib32 /usr/kde/*/lib /usr/qt/*/lib32 /usr/qt/*/lib /usr/X11R6/lib32 /usr/X11R6/lib IUSE_EFFECTIVE=abi_mips_n32 abi_mips_n64 abi_mips_o32 abi_riscv_lp64 abi_riscv_lp64d abi_s390_32 abi_s390_64 abi_x86_32 abi_x86_64 abi_x86_x32 alpha amd64 amd64-fbsd amd64-linux arm arm64 debug default-compiler-rt default-libcxx doc elibc_AIX elibc_Cygwin elibc_Darwin elibc_DragonFly elibc_FreeBSD elibc_HPUX elibc_Interix elibc_NetBSD elibc_OpenBSD elibc_SunOS elibc_Winnt elibc_bionic elibc_glibc elibc_mingw elibc_mintlib elibc_musl elibc_uclibc hppa ia64 kernel_AIX kernel_Darwin kernel_FreeBSD kernel_HPUX kernel_NetBSD kernel_OpenBSD kernel_SunOS kernel_Winnt kernel_freemint kernel_linux llvm_targets_AArch64 llvm_targets_AMDGPU llvm_targets_ARM llvm_targets_BPF llvm_targets_Hexagon llvm_targets_Lanai llvm_targets_MSP430 llvm_targets_Mips llvm_targets_NVPTX llvm_targets_PowerPC llvm_targets_RISCV llvm_targets_Sparc llvm_targets_SystemZ llvm_targets_WebAssembly llvm_targets_X86 llvm_targets_XCore m68k m68k-mint mips ppc ppc-aix ppc-macos ppc64 ppc64-linux prefix prefix-guest prefix-stack python_single_target_python2_7 python_single_target_python3_5 python_single_target_python3_6 python_single_target_python3_7 python_targets_python2_7 python_targets_python3_5 python_targets_python3_6 python_targets_python3_7 riscv s390 sh sparc sparc-solaris sparc64-solaris static-analyzer test userland_BSD userland_GNU x64-cygwin x64-macos x64-solaris x86 x86-cygwin x86-fbsd x86-linux x86-macos x86-solaris x86-winnt xml INHERITED= toolchain-funcs multilib multiprocessing ninja-utils eutils flag-o-matic xdg-utils cmake-utils llvm llvm.org multibuild multilib-build multilib-minimal pax-utils python-utils-r1 python-single-r1 LIBDIR_amd64=lib64 FEATURES=sfperms protect-owned unmerge-orphans binpkg-logs parallel-install unprivileged pid-sandbox parallel-fetch merge-sync binpkg-docompress config-protect-if-modified multilib-strict preserve-libs network-sandbox unknown-features-warn fixlafiles strict news ipc-sandbox force-prefix assume-digests unmerge-logs nostrip ebuild-locks binpkg-dostrip distlocks PORTAGE_BIN_PATH=/srv/scratch/entrup/gentoo/usr/lib/portage/python3.6 PORTAGE_PYM_PATH=/srv/scratch/entrup/gentoo/usr/lib64/python3.6/site-packages MULTILIB_STRICT_EXEMPT=(perl5|gcc|gcc-lib|binutils|eclipse-3|debug|portage|udev|systemd|clang|python-exec|llvm) BOOTSTRAP_USE=unicode internal-glib pkg-config split-usr python_targets_python3_6 python_targets_python2_7 multilib LIBDIR_x32=libx32 USE_EXPAND_VALUES_ELIBC=AIX bionic Cygwin Darwin DragonFly FreeBSD glibc HPUX Interix mingw mintlib musl NetBSD OpenBSD SunOS uclibc Winnt LIBDIR_default=lib PATH=/srv/scratch/entrup/gentoo/var/tmp/portage/sys-devel/clang-9.0.0/temp/python3.6/bin:/srv/scratch/entrup/gentoo/usr/lib/llvm/9/bin:/srv/scratch/entrup/gentoo/usr/lib/portage/python3.6/ebuild-helpers/unprivileged:/srv/scratch/entrup/gentoo/usr/lib/portage/python3.6/ebuild-helpers:/srv/scratch/entrup/gentoo/usr/lib/llvm/9/bin:/srv/scratch/entrup/gentoo/usr/local/sbin:/srv/scratch/entrup/gentoo/usr/local/bin:/srv/scratch/entrup/gentoo/usr/sbin:/srv/scratch/entrup/gentoo/usr/bin:/srv/scratch/entrup/gentoo/sbin:/srv/scratch/entrup/gentoo/bin:/srv/scratch/entrup/gentoo/opt/bin:/usr/sbin:/sbin:/usr/bin:/bin USE=abi_x86_64 amd64 elibc_glibc kernel_linux llvm_targets_ARM llvm_targets_BPF llvm_targets_RISCV llvm_targets_WebAssembly llvm_targets_X86 prefix python_single_target_python3_6 python_targets_python2_7 python_targets_python3_6 python_targets_python3_7 static-analyzer userland_GNU LIBDIR_x86=lib32 ELIBC=glibc CMAKE INHERITED= toolchain-funcs multilib multiprocessing ninja-utils eutils flag-o-matic xdg-utils cmake-utils llvm llvm.org multibuild multilib-build multilib-minimal pax-utils python-utils-r1 python-single-r1 PATH PORTAGE_PYTHONPATH=/srv/scratch/entrup/gentoo/usr/lib64/python3.6/site-packages ROOTPATH=/srv/scratch/entrup/gentoo/usr/lib/llvm/9/bin:/srv/scratch/entrup/gentoo/usr/local/sbin:/srv/scratch/entrup/gentoo/usr/local/bin:/srv/scratch/entrup/gentoo/usr/sbin:/srv/scratch/entrup/gentoo/usr/bin:/srv/scratch/entrup/gentoo/sbin:/srv/scratch/entrup/gentoo/bin:/srv/scratch/entrup/gentoo/opt/bin:/usr/sbin:/sbin:/usr/bin:/bin PKG_CONFIG_PATH=/srv/scratch/entrup/gentoo/var/tmp/portage/sys-devel/clang-9.0.0/temp/python3.6/pkgconfig FPATH=/home/srastaff/entrup/.local/share/zplug/repos/rust-lang/zsh-config:/home/srastaff/entrup/.local/share/zplug/autoload:/home/srastaff/entrup/.local/share/zplug/misc/completions:/home/srastaff/entrup/.local/share/zplug/base/sources:/home/srastaff/entrup/.local/share/zplug/base/utils:/home/srastaff/entrup/.local/share/zplug/base/job:/home/srastaff/entrup/.local/share/zplug/base/log:/home/srastaff/entrup/.local/share/zplug/base/io:/home/srastaff/entrup/.local/share/zplug/base/core:/home/srastaff/entrup/.local/share/zplug/base/base:/home/srastaff/entrup/.local/share/zplug/autoload/commands:/home/srastaff/entrup/.local/share/zplug/autoload/options:/home/srastaff/entrup/.local/share/zplug/autoload/tags:/srv/scratch/entrup/gentoo/usr/local/share/zsh/site-functions:/srv/scratch/entrup/gentoo/usr/share/zsh/site-functions:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Calendar:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Chpwd:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Completion:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Completion/AIX:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Completion/BSD:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Completion/Base:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Completion/Cygwin:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Completion/Darwin:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Completion/Debian:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Completion/Linux:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Completion/Mandriva:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Completion/Redhat:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Completion/Solaris:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Completion/Unix:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Completion/X:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Completion/Zsh:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Completion/openSUSE:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Exceptions:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/MIME:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Math:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Misc:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Newuser:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Prompts:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/TCP:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/VCS_Info:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/VCS_Info/Backends:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Zftp:/srv/scratch/entrup/gentoo/usr/share/zsh/5.7.1/functions/Zle _ZPLUG_AWKPATH=/home/srastaff/entrup/.local/share/zplug/misc/contrib PORTAGE_BIN_PATH=/srv/scratch/entrup/gentoo/usr/lib/portage/python3.6 PORTAGE_PYM_PATH=/srv/scratch/entrup/gentoo/usr/lib64/python3.6/site-packages sync-openpgp-key-path = /srv/scratch/entrup/gentoo/usr/share/openpgp-keys/gentoo-release.asc PATH=/srv/scratch/entrup/gentoo/var/tmp/portage/sys-devel/clang-9.0.0/temp/python3.6/bin:/srv/scratch/entrup/gentoo/usr/lib/llvm/9/bin:/srv/scratch/entrup/gentoo/usr/lib/portage/python3.6/ebuild-helpers/unprivileged:/srv/scratch/entrup/gentoo/usr/lib/portage/python3.6/ebuild-helpers:/srv/scratch/entrup/gentoo/usr/lib/llvm/9/bin:/srv/scratch/entrup/gentoo/usr/local/sbin:/srv/scratch/entrup/gentoo/usr/local/bin:/srv/scratch/entrup/gentoo/usr/sbin:/srv/scratch/entrup/gentoo/usr/bin:/srv/scratch/entrup/gentoo/sbin:/srv/scratch/entrup/gentoo/bin:/srv/scratch/entrup/gentoo/opt/bin:/usr/sbin:/sbin:/usr/bin:/bin -------------------------------- >>> Working in BUILD_DIR: "/srv/scratch/entrup/gentoo/var/tmp/portage/sys-devel/clang-9.0.0/work/x/y/clang-abi_x86_64.amd64" ninja -v -j96 -l0 ninja: error: '/usr/lib/llvm-6.0/lib/cmake/llvm/GenerateVersionFromVCS.cmake', needed by 'lib/Basic/VCSVersion.inc', missing and no known rule to make it ``` BTW: Is there any mechanism to embed formatted code in Bugzilla? we would have to revisit this with current versions |