Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f5eaad8b6448439dc390ee75f04a6395f71dabb2
      
https://github.com/WebKit/WebKit/commit/f5eaad8b6448439dc390ee75f04a6395f71dabb2
  Author: Adrian Taylor <adrian_tay...@apple.com>
  Date:   2025-05-13 (Tue, 13 May 2025)

  Changed paths:
    M Source/WTF/WTF.xcodeproj/project.pbxproj
    A Source/WTF/wtf/module.modulemap
    M Source/bmalloc/bmalloc.xcodeproj/project.pbxproj
    A Source/bmalloc/module.modulemap

  Log Message:
  -----------
  Add WTF and bmalloc modulemaps
https://bugs.webkit.org/show_bug.cgi?id=292791
rdar://151023888

Reviewed by Elliott Williams.

This commit adds modulemap files for WTF and bmalloc. These are necessary
because Swift/C++ interop interprets C++ headers using the "-fmodules" option,
interpreting the C++ codebase as clang modules.

The approach taken for the two modulemaps is slightly different. bmalloc
defines a single monolithic module, the simplest approach. For WTF we choose
a more complex approach, as previously followed by the WebKit_Internal
module, where the module is divided into many small submodules. This
approach is chosen because Swift/C++ interoperability otherwise tries
to interpret the whole module, and that results in errors such as:

  /usr/include/c++/v1/__memory/construct_at.h:47:58: note: candidate template 
ignored: substitution failure [with _Tp = WTF::TextBreakIterator, _Args = 
<const WTF::TextBreakIterator &>]: call to deleted constructor of 
'WTF::TextBreakIterator'
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp* __construct_at(_Tp* 
__location, _Args&&... __args) {

We'll likely need to solve those in future, but meanwhile splitting the
module into lots of submodules limits the blast radius of such issues
and allows us to make progress with Swift.

Notes on some specific parts of the WTF modulemap:
* HashMap and RobinHoodHashTable.h are interdependent so need to be
  colocated in a module.
* The Platform headers are used in contexts without C++11 support, unlike
  other parts of WTF.

Although it just adds files, this commit is not a no-op because some of
our existing Swift build targets will spot these modulemaps and interpret
headers in a modularized style. Nevertheless, there are no
intentional behavior changes here.

* Source/WTF/WTF.xcodeproj/project.pbxproj:
* Source/WTF/wtf/module.modulemap: Added.
* Source/bmalloc/bmalloc.xcodeproj/project.pbxproj:
* Source/bmalloc/module.modulemap: Added.

Canonical link: https://commits.webkit.org/294864@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to