Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 902101 - dev-util/kdevelop-22.12.3 Could not find Clang builtin directory with LLVM 16
Summary: dev-util/kdevelop-22.12.3 Could not find Clang builtin directory with LLVM 16
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo KDE team
URL:
Whiteboard: fixed in 23.03.80
Keywords: PATCH
: 878549 902815 (view as bug list)
Depends on:
Blocks: c99-porting
  Show dependency tree
 
Reported: 2023-03-19 06:44 UTC by email200202
Modified: 2024-10-31 09:48 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,13.00 KB, text/x-log)
2023-03-19 06:46 UTC, email200202
Details
emerge -pqv '=dev-util/kdevelop-22.12.3::gentoo' (file_902101.txt,173 bytes, text/plain)
2023-03-19 06:47 UTC, email200202
Details
emerge --info '=dev-util/kdevelop-22.12.3::gentoo' (file_902101.txt,7.84 KB, text/plain)
2023-03-19 06:48 UTC, email200202
Details
hardcode CLANG_BUILTIN_DIR (find_clangbuiltindir.patch,497 bytes, patch)
2023-03-19 15:45 UTC, Chris Pfuhl
Details | Diff
Fix build with x.0.0 versions of llvm (kdevelop-22.12.3-findclang.patch,1.29 KB, patch)
2023-03-21 02:47 UTC, Michael Uleysky
Details | Diff
Fix build with x.0.0 versions of llvm (kdevelop-22.12.3-findclang.patch,1.57 KB, patch)
2023-03-21 18:12 UTC, Chris Pfuhl
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description email200202 2023-03-19 06:44:43 UTC
See attached build.log

CMake Error at cmake/modules/FindClang.cmake:113 (message):
  Could not find Clang builtin directory
Call Stack (most recent call first):
  plugins/CMakeLists.txt:39 (find_package)


Reproducible: Always

Steps to Reproduce:
1. emerge --sync
2. emerge -auvDN world

Actual Results:  
Failed to build

Expected Results:  
Not to fail
Comment 1 email200202 2023-03-19 06:46:02 UTC
Created attachment 858261 [details]
build.log
Comment 2 email200202 2023-03-19 06:47:18 UTC
Created attachment 858263 [details]
emerge -pqv '=dev-util/kdevelop-22.12.3::gentoo'
Comment 3 email200202 2023-03-19 06:48:29 UTC
Created attachment 858265 [details]
emerge --info '=dev-util/kdevelop-22.12.3::gentoo'
Comment 4 Chris Pfuhl 2023-03-19 15:44:28 UTC
I had the same problem after upgrading llvm and clang to 16.0,
Not sure what the actual problem is, but i worked around
this temporarily by hardcoding the dir with all the builtin* files
(/usr/lib/llvm/16/include/clang/Basic for me) into the corresponding
cmake file of kdevelop. See attached patch
Comment 5 Chris Pfuhl 2023-03-19 15:45:19 UTC
Created attachment 858355 [details, diff]
hardcode CLANG_BUILTIN_DIR
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-03-20 07:59:25 UTC
This needs to use llvm.eclass instead.
Comment 7 Michael Uleysky 2023-03-21 02:47:46 UTC
Created attachment 858505 [details, diff]
Fix build with x.0.0 versions of llvm

The problem is dumb. The cmake looks for cpuid.h in directory ../../../clang/${CLANG_VERSION}/include, where CLANG_VERSION is 16.0.0. But the headers are in the ../../../clang/16/include directory. This error occurs only for versions like x.0.0. I'm attaching the patch, but it needs to be tested for rc, pre and git versions of llvm.
Comment 8 Chris Pfuhl 2023-03-21 18:12:40 UTC
Created attachment 858575 [details, diff]
Fix build with x.0.0 versions of llvm

(In reply to Michael Uleysky from comment #7)
> The problem is dumb. The cmake looks for cpuid.h in directory
> ../../../clang/${CLANG_VERSION}/include, where CLANG_VERSION is 16.0.0. But
> the headers are in the ../../../clang/16/include directory. This error
> occurs only for versions like x.0.0. I'm attaching the patch, but it needs
> to be tested for rc, pre and git versions of llvm.

This worked fine for 16.0.0.9999 (llvm-config --version = 16.0.0)
but not for 17.0.0_pre20230314 (llvm-config --version = 17.0.0git4bf004e0)
For that i changed the svn/git replace lines to a regex that also matches
everything after the keyword and kept your changes.
That worked on both the 9999 and pre version. no rc version in tree for me 
to test with. Uploading yet another patch keeping your name.
Comment 9 Michael Uleysky 2023-03-22 09:14:26 UTC
Comment on attachment 858505 [details, diff]
Fix build with x.0.0 versions of llvm

cpfuhl, thanks for testing and updating.
Comment 10 Andreas Sturmlechner gentoo-dev 2023-03-23 15:37:45 UTC
*** Bug 902815 has been marked as a duplicate of this bug. ***
Comment 11 Larry the Git Cow gentoo-dev 2023-03-26 22:57:04 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=51211f99f14f80bc92049cbbf1717a39c50887b2

commit 51211f99f14f80bc92049cbbf1717a39c50887b2
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-03-26 22:55:54 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-03-26 22:56:52 +0000

    dev-util/kdevelop: fix build with Clang 16, use llvm.eclass
    
    Closes: https://bugs.gentoo.org/902101
    Thanks-to: Michael Uleysky <uleysky@gmail.com>
    Signed-off-by: Sam James <sam@gentoo.org>

 .../kdevelop/files/kdevelop-22.12.3-clang16.patch  | 24 ++++++++++++++++++++++
 ...p-22.12.3.ebuild => kdevelop-22.12.3-r1.ebuild} | 18 ++++++++++------
 2 files changed, 36 insertions(+), 6 deletions(-)
Comment 12 Larry the Git Cow gentoo-dev 2023-03-26 22:58:56 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/proj/kde.git/commit/?id=856936687150763b48e5d59e94d2f02761ceb593

commit 856936687150763b48e5d59e94d2f02761ceb593
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-03-26 22:58:36 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-03-26 22:58:36 +0000

    dev-util/kdevelop: fix build with Clang 16, use llvm.eclass
    
    Closes: https://bugs.gentoo.org/902101
    Thanks-to: Michael Uleysky <uleysky@gmail.com>
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-util/kdevelop/kdevelop-23.03.80.ebuild      | 18 ++++++++++++------
 dev-util/kdevelop/kdevelop-23.04.49.9999.ebuild | 18 ++++++++++++------
 dev-util/kdevelop/kdevelop-9999.ebuild          | 18 ++++++++++++------
 3 files changed, 36 insertions(+), 18 deletions(-)
Comment 13 Larry the Git Cow gentoo-dev 2023-03-26 23:23:22 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/kde.git/commit/?id=2baa6d7fd846f14129d04312728744013acea492

commit 2baa6d7fd846f14129d04312728744013acea492
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-03-26 23:22:59 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-03-26 23:23:09 +0000

    dev-util/kdevelop: add missing patch
    
    Bug: https://bugs.gentoo.org/902101
    Fixes: 856936687150763b48e5d59e94d2f02761ceb593
    Signed-off-by: Sam James <sam@gentoo.org>

 .../kdevelop/files/kdevelop-22.12.3-clang16.patch  | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)
Comment 14 Larry the Git Cow gentoo-dev 2023-03-29 13:32:32 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/kde.git/commit/?id=4452c53936e4eb6df13f7b28961b4b4857420c85

commit 4452c53936e4eb6df13f7b28961b4b4857420c85
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-03-29 13:31:48 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-03-29 13:32:25 +0000

    dev-util/kdevelop: drop obsolete clang 16 patch
    
    Fixed upstream in 1a92bed73ae31e6f90c3bffe455f8e3c46ac4905 by using
    the proper FindClang module.
    
    Fixed on both the 23.03 branch & master.
    
    Bug: https://bugs.gentoo.org/902101
    Signed-off-by: Sam James <sam@gentoo.org>

 .../kdevelop/files/kdevelop-22.12.3-clang16.patch  | 24 ----------------------
 dev-util/kdevelop/kdevelop-23.03.80.ebuild         |  4 ----
 dev-util/kdevelop/kdevelop-23.04.49.9999.ebuild    |  4 ----
 dev-util/kdevelop/kdevelop-9999.ebuild             |  4 ----
 4 files changed, 36 deletions(-)
Comment 15 Andreas Sturmlechner gentoo-dev 2023-04-05 13:30:09 UTC
*** Bug 878549 has been marked as a duplicate of this bug. ***