Bug 2215937 - Using iwyu with CMake fails on an assertion
Summary: Using iwyu with CMake fails on an assertion
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: iwyu
Version: 38
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Vitaly
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-06-19 12:48 UTC by lagoho7
Modified: 2023-06-28 01:15 UTC (History)
1 user (show)

Fixed In Version: iwyu-0.20-2.fc38
Clone Of:
Environment:
Last Closed: 2023-06-28 01:15:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github include-what-you-use include-what-you-use issues 1264 0 None open Integrating iwyu 0.20 in CMake build system fails on an assertion 2023-06-25 07:28:28 UTC

Description lagoho7 2023-06-19 12:48:37 UTC
Integrating iwyu into a CMake build system using CMAKE_C_INCLUDE_WHAT_YOU_USE and CMAKE_CXX_INCLUDE_WHAT_YOU_USE fails on an assertion. It appears what you are building and what toolchain you are using are irrelevant.

The same steps work on Fedora 37.

Reproducible: Always

Steps to Reproduce:
1. Fresh install Fedora 38 Server with the "C Development Tools and Libraries" group selected.
2. Update all packages: sudo dnf upgrade --refresh
3. Install required packages: sudo dnf install cmake iwyu git libcurl-devel openssl-devel
4. Clone a CMake project (I chose Transmission arbitrarily): git clone --recurse-submodules https://github.com/transmission/transmission.git Transmission
5. cd into the project: cd Transmission/
6. Configure CMake: cmake -B build -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE=include-what-you-use -DCMAKE_C_INCLUDE_WHAT_YOU_USE=include-what-you-use -DCMAKE_BUILD_TYPE=RelWithDebInfo
7. Start the build: cmake --build build
Actual Results:  
Build fails with the following error:

Error running 'include-what-you-use': /builddir/build/BUILD/include-what-you-use-0.20/iwyu.cc:3735: Assertion failed: sema.getCurScope() != nullptr

Expected Results:  
The build completes successfully with iwyu output. Tested on Fedora 37 to verify that my steps are correct.

Comment 1 Fedora Update System 2023-06-26 18:09:33 UTC
FEDORA-2023-a92562d0ea has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-a92562d0ea

Comment 2 Fedora Update System 2023-06-27 10:55:43 UTC
FEDORA-2023-a92562d0ea has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-a92562d0ea`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-a92562d0ea

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 3 Fedora Update System 2023-06-28 01:15:50 UTC
FEDORA-2023-a92562d0ea has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.