-
Notifications
You must be signed in to change notification settings - Fork 14.6k
[libc++] change the visibility of libc++ header to public in libcxx module #91240
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
Conversation
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-libcxx Author: RichardLuo (RichardLuo0) ChangesSame as #91182 Full diff: https://github.com/llvm/llvm-project/pull/91240.diff 1 Files Affected:
diff --git a/libcxx/modules/CMakeLists.txt.in b/libcxx/modules/CMakeLists.txt.in
index c35f6fecb1fd76..9fef16e9cefde9 100644
--- a/libcxx/modules/CMakeLists.txt.in
+++ b/libcxx/modules/CMakeLists.txt.in
@@ -41,7 +41,7 @@ target_sources(std
std.cppm
)
-target_include_directories(std SYSTEM PRIVATE @LIBCXX_CONFIGURED_INCLUDE_DIRS@)
+target_include_directories(std SYSTEM PUBLIC @LIBCXX_CONFIGURED_INCLUDE_DIRS@)
if (NOT @LIBCXX_ENABLE_EXCEPTIONS@)
target_compile_options(std PUBLIC -fno-exceptions)
|
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.
Can you add a description why this change would be beneficial?
It is for the same reason as #91182 Consider the following file: #include <boost/json.hpp>
import std;
int main(int, const char **) { } boost will include something from libc++, but we are using -nostdinc++, so the compiler can not find any default std header. Besides, if we are using assert, the |
I see. Typically we first land a commit in main and then backport it to the release branch. I've updated the commit message to the text of the other PR. Typically when we merge the commit message will be the message stored in git. It's good practice to have a good commit message. I just started the CI and want to look whether it's happy. (I expect it will be.) |
|
I have set it to non-private now. @mordante I don't understand why the checks failed on |
Can you rebase the patch, I expect that fixes the CI issue. |
1120aa2
to
2050503
Compare
2050503
to
4153451
Compare
I rebased the PR, can you try the CI again? |
I suspect the Windows CI is failing because a newer LLVM was somehow installed on the machines, which could be due to #95228 being tested. If that's the case, then I think we just learned that the state of CI machines on Windows is shared across all PRs, which is a bit concerning. For the scope of this change I think we can just ignore the failures on Windows. |
Also rebasing onto |
There were other CI jobs failing too, our "typical cancellation issue". |
It’s not that the other jobs caused a new version to be installed; the jobs don’t cross contaminate the environment (that’d be concerning). The base images used for the runners are continuously updated. Today, it seems like they’ve rolled out a new image that contained a newer version of LLVM out of the box. The command we used for installing the version of LLVM we wanted failed, when the installation turned out to be a downgrade. As part of #95228 I added a flag to tell it that we’re ok with downgrading - to prevent this from becoming an issue in the future, when a newer version appears in the base image again. |
@mordante Should I rebase again? |
Merging since the CI issues are unrelated. |
@RichardLuo0 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! |
…odule (llvm#91240) This PR addresses a problem that headers may not be able to be found if `#include` is used with std modules. Consider the following file: #include <boost/json.hpp> import std; int main(int, const char **) { } Boost will include something from libc++, but we are using -nostdinc++ at [1] so the compiler can not find any default std header. Therefore the locally built header needs to be public. [1]: https://github.com/RichardLuo0/llvm-project/blob/15fdd47c4b110b64dc61f636e42e0484bf8bdbe0/libcxx/modules/CMakeLists.txt.in#L52
This PR addresses a problem that headers may not be able to be found if
#include
is used with std modules.Consider the following file:
boost will include something from libc++, but we are using -nostdinc++, so the compiler can not find any default std header.
Therefore the locally built header needs to be public.