-
Notifications
You must be signed in to change notification settings - Fork 14k
[clang] Fix missing installed header #95979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[clang] Fix missing installed header #95979
Conversation
Since commit 8d468c1, the header `openmp_wrappers/complex` is hidden behind `openmp_wrappers/complex.h` due to a bug in CMake, so is not actually installed. Re-ordering the entries workarounds the issue. See https://gitlab.kitware.com/cmake/cmake/-/issues/26058 for more information on the CMake bug.
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write If you have received no comments on your PR for a week, you can request a review If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-clang @llvm/pr-subscribers-backend-x86 Author: Daniel Otero (danielotero) ChangesSince commit 8d468c1, the header To test the issue, you can ask
Re-ordering the entries workarounds the issue. The other option is to revert the cited commit, but I'm not sure which approach is preferred. CC @etcwilde @jdoerfert Full diff: https://github.com/llvm/llvm-project/pull/95979.diff 1 Files Affected:
diff --git a/clang/lib/Headers/CMakeLists.txt b/clang/lib/Headers/CMakeLists.txt
index d3090e488306f..89fa0ecd45eb4 100644
--- a/clang/lib/Headers/CMakeLists.txt
+++ b/clang/lib/Headers/CMakeLists.txt
@@ -318,8 +318,10 @@ set(ppc_wrapper_files
set(openmp_wrapper_files
openmp_wrappers/math.h
openmp_wrappers/cmath
- openmp_wrappers/complex.h
+ # Due to a bug in CMake, `complex` must be before `complex.h`
+ # See: https://gitlab.kitware.com/cmake/cmake/-/issues/26058
openmp_wrappers/complex
+ openmp_wrappers/complex.h
openmp_wrappers/__clang_openmp_device_functions.h
openmp_wrappers/complex_cmath.h
openmp_wrappers/new
Footnotes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find. That's kind of horrifying. I'm fine with flipping the file order to avoid the source file caching bug in CMake.
CC @compnerd since he also knows CMake and may have opinions.
Indeed. CMake's old "guess the extension" behavior was always a…fun thing to deal with. Alas, this emergent behavior was unknown at the time and a straight fix is likely to break other projects :( . Plus it's not likely we'll get patched releases for the past 18 releases. Luckily, there is a fix here. We'll get this in the test suite and properly nailed down though; hopefully we can detect this behavior so that other projects can discover such instances as well. |
I forgot to say I don't have commit access, so feel free to merge this. |
@danielotero Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested Please check whether problems have been caused by your change specifically, as How to do this, and the rest of the post-merge process, is covered in detail here. If your change does cause a problem, it may be reverted, or you can revert it yourself. If you don't get any reports, no action is required from you. Your changes are working as expected, well done! |
@danielotero Thank you for your contribution. |
Since commit 8d468c1, the header `openmp_wrappers/complex` is hidden behind `openmp_wrappers/complex.h` due to a bug in CMake[^1], so is not actually installed. To test the issue, you can ask `ninja` to generate the file on your build: ``` $ ninja lib/clang/19/include/openmp_wrappers/complex.h [199/199] Copying clang's openmp_wrappers/complex.h... $ ninja lib/clang/19/include/openmp_wrappers/complex ninja: error: unknown target 'lib/clang/19/include/openmp_wrappers/complex', did you mean 'lib/clang/19/include/openmp_wrappers/complex.h'? ``` Re-ordering the entries workarounds the issue. The other option is to revert the cited commit, but I'm not sure which approach is preferred. CC @etcwilde @jdoerfert [^1]: [Here](https://gitlab.kitware.com/cmake/cmake/-/issues/26058) is the CMake report on the issue.
For folks landing here, this should be fixed in CMake 4.1 by policy CMP0187. |
Since commit 8d468c1, the header
openmp_wrappers/complex
is hidden behindopenmp_wrappers/complex.h
due to a bug in CMake1, so is not actually installed.To test the issue, you can ask
ninja
to generate the file on your build:Re-ordering the entries workarounds the issue. The other option is to revert the cited commit, but I'm not sure which approach is preferred.
CC @etcwilde @jdoerfert
Footnotes
Here is the CMake report on the issue. ↩