Bug 1574970

Summary: iwyu 0.11 (compatible with llvm+clang 7.0) is available
Product: [Fedora] Fedora Reporter: Xose Vazquez Perez <xose.vazquez>
Component: iwyuAssignee: Dave Johansen <davejohansen>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: christian.morales.vega, davejohansen, liblit, plroskin, tstellar
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-04-16 15:49:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Xose Vazquez Perez 2018-05-04 12:35:11 UTC
Latest upstream release: 0.10
Current version/release in rawhide: 0.9-0.1.20171001git576e80f
URL: https://include-what-you-use.org/


Changelog:

* 30 April 2018
   iwyu 0.10 compatible with llvm+clang 6.0 is released. Major changes:

    Add --no_fwd_decls option to avoid replacing includes with forward-declarations
    Treat definitions of free functions as uses of the corresponding prototypes
    Support C++11 range-for loops
    Several template misattribution bugs fixed
    Better support for non-ASCII encodings in fix_includes.py
    Remove support for VCS commands from fix_includes.py


* 11 March 2018
    iwyu 0.9 compatible with llvm+clang 5.0 is released. Major changes:

    Improve handling of template arguments
    Improve support of JSON compilation databases (arguments field)
    Improve support for function pointers to templates
    Allow IWYU pragma: keep on forward declarations
    Fix a few crash scenarios on C++11 using-declarations
    iwyu_tool.py now supports parallel execution

Comment 1 Xose Vazquez Perez 2018-07-09 15:38:40 UTC
ping!

Comment 2 Pavel Roskin 2018-08-03 02:55:11 UTC
I tried to use it iwyu 0.10 on the current Fedora 28. First it didn't link. I added LLVM at the end of target_link_libraries in CMakeLists.txt. include-what-you-use started complaining:

CommandLine Error: Option 'asan-instrument-assembly' registered more than once!

I moved LLVM above other LLVM* libraries. Now include-what-you-use is sort of working.

But it's reporting a lot of bogus errors, e.g.

/usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/cstddef:50:10: fatal error: 'stddef.h' file not found

And it's not better with libc++:

/usr/include/c++/v1/cstddef:44:15: fatal error: 'stddef.h' file not found

But most disappointingly, the majority of recommendations are wrong.

Comment 3 Xose Vazquez Perez 2018-08-03 18:31:14 UTC
This works for me:

Needed:
clang-6.0.1-1.fc28.x86_64
clang-analyzer-6.0.1-1.fc28.noarch
clang-devel-6.0.1-1.fc28.x86_64
clang-libs-6.0.1-1.fc28.x86_64
clang-tools-extra-6.0.1-1.fc28.x86_64
lld-6.0.1-1.fc28.x86_64
lld-libs-6.0.1-1.fc28.x86_64
llvm-6.0.1-1.fc28.x86_64
llvm-devel-6.0.1-1.fc28.x86_64
llvm-libs-6.0.1-1.fc28.x86_64
llvm-static-6.0.1-1.fc28.x86_64


git clone -b clang_6.0 https://github.com/include-what-you-use/include-what-you-use.git
mkdir build && cd build
export CXX=clang++
export CC=clang
ln -sf /usr/bin/ld.lld /etc/alternatives/ld # Hack to replace the default linker. To do it right, it should be done in the CMAKE env.
cmake -G "Unix Makefiles" -DIWYU_LLVM_LIB_PATH=/usr/lib64/llvm/ -DIWYU_LLVM_INCLUDE_PATH=/usr/include/clang/ ../include-what-you-use/

Comment 4 Jan Kurik 2018-08-14 10:04:12 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 5 Cristian Morales Vega 2019-02-12 05:37:46 UTC
0.11, compatible with clang 7, has been available for two months.

Comment 6 Cristian Morales Vega 2019-02-12 05:50:38 UTC
Adding Tom Stellard since he was the last person to touch the package and it looks evident that Dave Johansen is not maintaining this package any more.

Comment 7 Cristian Morales Vega 2019-02-12 06:21:06 UTC
(In reply to Xose Vazquez Perez from comment #3)
> This works for me:

"works" here includes not getting the "fatal error: 'stddef.h' file not found" messages? (checking C++ sources?)

A manual build of iwyu 0.11 (which doesn't use IWYU_LLVM_LIB_PATH or IWYU_LLVM_INCLUDE_PATH any more) complains to me about this.

It seems to look for it in

/usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/stddef.h -> /usr/include/c++/8/stddef.h
/usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/x86_64-redhat-linux/stddef.h -> /usr/include/c++/8/x86_64-redhat-linux/stddef.h
/usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/backward/stddef.h -> /usr/include/c++/8/backward/stddef.h
/usr/local/include/stddef.h
/usr/include/stddef.h

None of them exists.

Instead of in /usr/include/linux/stddef.h, /usr/lib/gcc/x86_64-redhat-linux/8/include/stddef.h or /usr/lib64/clang/7.0.1/include/stddef.h.

Comment 8 Xose Vazquez Perez 2019-02-12 18:00:24 UTC
(In reply to Cristian Morales Vega from comment #7)
> (In reply to Xose Vazquez Perez from comment #3)
> > This works for me:
> 
> "works" here includes not getting the "fatal error: 'stddef.h' file not
> found" messages? (checking C++ sources?)
> 
> A manual build of iwyu 0.11 (which doesn't use IWYU_LLVM_LIB_PATH or
> IWYU_LLVM_INCLUDE_PATH any more) complains to me about this.
> 
> It seems to look for it in
> 
> /usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/stddef.h ->
> /usr/include/c++/8/stddef.h
> /usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/x86_64-redhat-
> linux/stddef.h -> /usr/include/c++/8/x86_64-redhat-linux/stddef.h
> /usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/backward/stddef.
> h -> /usr/include/c++/8/backward/stddef.h
> /usr/local/include/stddef.h
> /usr/include/stddef.h
> 
> None of them exists.
> 
> Instead of in /usr/include/linux/stddef.h,
> /usr/lib/gcc/x86_64-redhat-linux/8/include/stddef.h or
> /usr/lib64/clang/7.0.1/include/stddef.h.


This works for me, follow all these steps *EXACTLY* :

As root user:
dnf install clang clang-analyzer clang-devel clang-libs clang-tools-extra lld lld-libs llvm llvm-devel llvm-libs llvm-static
ln -sf /usr/bin/ld.lld /etc/alternatives/ld  # Hack to replace the default linker. To do it right, it should be done in the CMAKE env.

As user:
mkdir tmp && cd tmp
git clone -b clang_7.0 https://github.com/include-what-you-use/include-what-you-use.git
mkdir build && cd build
export CXX=clang++
export CC=clang

cmake -G "Unix Makefiles" ../include-what-you-use/
make
(wait......)
./bin/include-what-you-use --version
include-what-you-use 0.11 (git:5658531) based on clang version 7.0.1 (Fedora 7.0.1-1.fc29)

as root user:
alternatives --auto ld # go back to gnu ld


This is the end.

Comment 9 Ben Cotton 2019-02-19 17:11:38 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 30 development cycle.
Changing version to '30.

Comment 10 Xose Vazquez Perez 2019-04-16 15:49:27 UTC
iwyu 0.12 compatible with llvm+clang 8.0, equivalent to the clang_8.0 tag,  was released recently.

*** This bug has been marked as a duplicate of bug 1642220 ***