This is an archive of the discontinued LLVM Phabricator instance.

[libc++][Modules] std.functional.__functional.invoke and std.type_traits.underlying_type can't export std.type_traits
ClosedPublic

Authored by iana on Jun 26 2023, 9:28 PM.

Details

Summary

__functional/invoke.h currently only includes __type_traits/invoke.h and not all of type_traits. Keep it using the specific header, and update its export. Similarly, __type_traits/underlying_type.h currently only includes __type_traits/is_enum.h, so update its export as well. This requires adding lots of export statements to the module map to keep the transitive includes working. Adding direct includes to the headers fixes check-cxx, but leaves many run-buildbot generic-modules tests failing, some even with linker errors.

Diff Detail

Event Timeline

iana created this revision.Jun 26 2023, 9:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 26 2023, 9:28 PM
iana requested review of this revision.Jun 26 2023, 9:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 26 2023, 9:28 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
iana updated this revision to Diff 534845.Jun 26 2023, 11:07 PM

Pick up changes from D153211

iana updated this revision to Diff 535637.Jun 28 2023, 11:31 PM

Add some missing exports that were exposed by removing previously added includes

iana edited the summary of this revision. (Show Details)Jun 29 2023, 3:40 PM
iana updated this revision to Diff 536361.EditedJun 30 2023, 12:16 PM

D153672 replaced __debug, whose module did export *, with __debug_utils/strict_weak_ordering_check.h, whose module has no exports. Other parts were relying on __debug's module exporting __type_traits/is_constant_evaluated.h. Make __debug_utils/strict_weak_ordering_check.h export that, and update __algorithm/sort.h's module to export __debug_utils/strict_weak_ordering_check.h.

iana updated this revision to Diff 536817.Jul 3 2023, 10:09 AM

Rebase, fix merge conflict

ldionne accepted this revision.Jul 3 2023, 11:58 AM

LGTM without the script.

I spoke at length with @iana about this patch, in particular about the fact that these exports are pretty arbitrary. They are, but so are some of the exports we already have in the modulemap anyway. Let's move forward with this because I get the feeling that the only way to make progress here is to get to D144322 ASAP and then clean up the mess in our modulemap once we can actually see failures in the CI.

libcxx/utils/find_transitive_includes.py
1 ↗(On Diff #536817)

Let's not check in this script since it was only (?) useful as a tool for you to come up with this patch. We don't expect to ever have to do this again, right?

This revision is now accepted and ready to land.Jul 3 2023, 11:58 AM
iana edited the summary of this revision. (Show Details)Jul 3 2023, 1:59 PM