Bug 399439

Summary: Commit 716372ae2e8dff9c51e94d33443536786e4bd85b breaks Clang discovery, causing CMake configuration failure
Product: [Applications] kdevelop Reporter: Kyle Devir <kyle.devir>
Component: Build tools: CMakeAssignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: major CC: b.buschinski
Priority: NOR    
Version First Reported In: git master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.3.0
Sentry Crash Report:
Attachments: Terminal output showing failure
LLVM config output

Description Kyle Devir 2018-10-06 12:34:48 UTC
Created attachment 115443 [details]
Terminal output showing failure

Bisected to 716372ae2e8dff9c51e94d33443536786e4bd85b

Clang discovery works with beae0686a228f7ce15f9eac9ede4ba03d10eb328

Log attached with terminal error output.
Comment 1 Bernd Buschinski 2018-10-06 15:51:47 UTC
Can you please post the output of (just to be 100% sure):
1. llvm-config --libdir
2. llvm-config --includedir
3. find /usr -name cpuid.h

For the last command & with the output of your log:
I would expect to see a:
"/usr/lib64/clang/8.0.0svn/include/cpuid.h"

but I have a bad feeling that it will only find
"/usr/lib64/clang/8.0.0/include/cpuid.h"
which would explain this behavior...
Comment 2 Kyle Devir 2018-10-07 00:42:58 UTC
Created attachment 115455 [details]
LLVM config output

> "/usr/lib64/clang/8.0.0/include/cpuid.h"

Is how it's indeed installed as, but it's still not found...? :/
Comment 3 Kyle Devir 2018-10-07 01:16:41 UTC
Ah, I see what you mean, now. I misread, sorry.
Comment 4 Bernd Buschinski 2018-10-07 09:46:26 UTC
I posted a patch https://phabricator.kde.org/D15998
Can you please test if this will fix your problem?

And on the bright side, this was previously only a run time error and now we caught the error on configure/cmake-time, sooner! :)
Comment 5 Kyle Devir 2018-10-07 11:28:26 UTC
Thanks! It works now, happily. :)
Comment 6 Kevin Funk 2018-10-07 11:56:18 UTC
It's only fixed when the patch is pushed. Reopening for now :)
Comment 7 Bernd Buschinski 2018-10-07 13:47:03 UTC
Git commit 6da2caac877d75d53d4e4af0e060f93defe701d6 by Bernd Buschinski.
Committed on 07/10/2018 at 13:46.
Pushed by buschinski into branch '5.3'.

Fix discovery of clang builtin directory with clang svn versions

Summary:
The CLANG_VERSION for svn clang versions have a svn suffix "8.0.0svn" and all the libraries have a svn suffix.
But not the in builtin include dir. It still points to
"/usr/lib/clang/8.0.0/include/cpuid.h"
without the suffix.

Extend the PATH_SUFFIXES to also looks a version without svn suffix.

Test Plan:
- install clang-svn
- execute cmake .. (for kdevelop)
-> it will fail

Reviewers: #kdevelop, kfunk

Reviewed By: #kdevelop, kfunk

Subscribers: kdevelop-devel

Tags: #kdevelop

Differential Revision: https://phabricator.kde.org/D15998

M  +5    -0    cmake/modules/FindClang.cmake

https://commits.kde.org/kdevelop/6da2caac877d75d53d4e4af0e060f93defe701d6