I'm an IWYU upstream maintainer. We received this bug report from a Fedora user, which indicates IWYU can no longer find the Clang resource dir (where builtin headers like `<stdbool.h>` etc live): https://github.com/include-what-you-use/include-what-you-use/issues/1864. IWYU recently (https://github.com/include-what-you-use/include-what-you-use/releases/tag/0.23) changed its mechanics for how to find the resource dir, and I wonder if the packaging spec now needs to do something different to wire it correctly. I'm not very familiar with RPM specs, but it looks like the LLVM spec overrides `CLANG_RESOURCE_DIR`: https://src.fedoraproject.org/rpms/llvm/blob/rawhide/f/llvm.spec#_1563 I suspect that means a similar override will need to be added to IWYU, using `IWYU_RESOURCE_DIR`, but it's all a bit subtle. I'd be happy to help weigh options if someone wants to look into this. Reproducible: Always Steps to Reproduce: Please see linked upstream bug. Actual Results: IWYU cannot find headers from resource dir in clean install, analysis fails. Expected Results: IWYU should find headers from resource dir.
Sorry, but I can't reproduce. Everything works as expected. Maybe the upstream bug reporter has their own build of include-what-you-use or LLVM. Also, they should upgrade to Fedora 43. Warning: include-what-you-use reported diagnostics: /home/test/1111/main.h should add these lines: /home/test/1111/main.h should remove these lines: - #include <stdbool.h> // lines 1-1 The full include-list for /home/test/1111/main.h: --- /home/test/1111/main.c should add these lines: #include <stdbool.h> // for true, bool /home/test/1111/main.c should remove these lines: The full include-list for /home/test/1111/main.c: #include "main.h" #include <stdbool.h> // for true, bool --- [test@local 1111]$ include-what-you-use -print-resource-dir /usr/bin/../lib/clang/21 [test@local 1111]$ clang -print-resource-dir /usr/bin/../lib/clang/21 > I suspect that means a similar override will need to be added to IWYU, using `IWYU_RESOURCE_DIR`, but it's all a bit subtle. I'd be happy to help weigh options if someone wants to look into this. We removed it in https://src.fedoraproject.org/rpms/iwyu/c/11c1fc50747faa359d433cc0d283972e89f88bfa?branch=rawhide commit, since it is no longer required. include-what-you-use now uses built-in LLVM discovery feature, as requested by upstream: https://github.com/include-what-you-use/include-what-you-use/pull/1637. It works with Fedora LLVM builds correctly. But we does not support all other custom LLVM builds.
Thank you! I've confirmed that it works for fedora:43, and fails as described for fedora:42 based on the IWYU bugreport: https://github.com/include-what-you-use/include-what-you-use/issues/1864#issuecomment-3606505559 I'll redirect that user here and close the upstream bug. I don't know what the maintenance of fedora:42 looks like, but I'd be happy to assist with IWYU details if someone wants to try and fix it.
I will try to rebuild it on Fedora 42.
Please try the iwyu-0.24-5.fc42 build: sudo dnf install https://kojipkgs.fedoraproject.org/packages/iwyu/0.24/5.fc42/x86_64/iwyu-0.24-5.fc42.x86_64.rpm All tests passed: 207/208 Test #207: fix_includes_test ................................. Passed 0.08 sec 208/208 Test #208: iwyu_tool_test .................................... Passed 0.60 sec 100% tests passed, 0 tests failed out of 208 Total Test time (real) = 2.59 sec It now uses the same SPEC as the F43 version (except for the version). If it still doesn't work, the problem isn't with iwyu packaging. It could be with LLVM packaging or a bug in the iwyu code.
FEDORA-2025-3bffaf86c8 (iwyu-0.24-5.fc42) has been submitted as an update to Fedora 42. https://bodhi.fedoraproject.org/updates/FEDORA-2025-3bffaf86c8
FEDORA-2025-3bffaf86c8 has been pushed to the Fedora 42 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-3bffaf86c8` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-3bffaf86c8 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
> Please try the iwyu-0.24-5.fc42 build: > sudo dnf install https://kojipkgs.fedoraproject.org/packages/iwyu/0.24/5.fc42/x86_64/iwyu-0.24-5.fc42.x86_64.rpm Thank you! I can confirm that the resource dirs are the same for clang and include-what-you-use at this version.
Great. Please give positive karma to FEDORA-2025-3bffaf86c8 update to push it to stable.
FEDORA-2025-3bffaf86c8 (iwyu-0.24-5.fc42) has been pushed to the Fedora 42 stable repository. If problem still persists, please make note of it in this bug report.