This is an archive of the discontinued LLVM Phabricator instance.

[libc++][modules] Simplifies C++20 module testing.
ClosedPublic

Authored by Mordante on Aug 10 2023, 8:06 AM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Commits
rGd9e3c85f5703: [libc++][modules] Simplifies C++20 module testing.
Summary

The building of the std module has been moved from params.py and
dsl.py to a lit.local.cfg for the entire test suite. In theory this
change allows testing modules in most configurations, except:

  • combined with clang modules
  • C++ versions that don't support the std module

Currently only C++23 with all parts enabled works.
C++26 is expected to work properly with CMake 3.27. That versions of CMake
knows how to invoke clang using C++26.
The parts disabled modi of libc++ have not been modularized yet.

It still is the goal that in the future CMake will be able to do the work
done in lit.local.cfg. Doing this in CMake would require a more mature
libc++ implementation.

Thanks a lot to @ldionne for giving hints how to enable modules in a
lit.local.cfg.

Diff Detail

Event Timeline

Mordante created this revision.Aug 10 2023, 8:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2023, 8:06 AM
Herald added a subscriber: arichardson. · View Herald Transcript
Mordante updated this revision to Diff 549402.Aug 11 2023, 8:03 AM

CI fixes.

Mordante updated this revision to Diff 549429.Aug 11 2023, 9:02 AM

CI fixes.

Mordante published this revision for review.Aug 11 2023, 11:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 11 2023, 11:50 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne added inline comments.Aug 15 2023, 8:41 AM
libcxx/CMakeLists.txt
750

Commit message: let's say Simplifies C++20 module testing.

Just to make it real clear.

libcxx/test/lit.local.cfg
43

What is quit()?

libcxx/utils/libcxx/test/features.py
283

I don't think this is required since we're keying off of the __config_site macro.

libcxx/utils/libcxx/test/params.py
135

In a separate patch, we should probably change this to clang-modules-build or modules-build=clang (and then we could have modules-build=std).

Mordante retitled this revision from [libc++][modules] Simplifies module testing. to [libc++][modules] Simplifies C++20 module testing..Aug 15 2023, 9:52 AM
Mordante updated this revision to Diff 550377.Aug 15 2023, 10:08 AM
Mordante marked 3 inline comments as done.

Addresses review comments.

Mordante added inline comments.Aug 15 2023, 10:09 AM
libcxx/test/libcxx/module_std.gen.py
130

The C++26 support should be enabled again in D153408

libcxx/test/lit.local.cfg
43

This is a left over and doesn't work correctly. I'll remove it.

Mordante updated this revision to Diff 551711.Aug 19 2023, 12:00 AM

Rebased to work on dependent patches.

ldionne accepted this revision.Aug 22 2023, 9:41 AM
This revision is now accepted and ready to land.Aug 22 2023, 9:41 AM
This revision was automatically updated to reflect the committed changes.
Mordante marked an inline comment as done.Aug 26 2023, 3:50 AM
Mordante added inline comments.
libcxx/utils/libcxx/test/params.py
135