From: Ben Boeckel <ben.boeckel@kitware.com>
To: vspefs <vspefs@protonmail.com>
Cc: Nathaniel Shead <nathanieloshead@gmail.com>,
"Jose E. Marchesi" <jose.marchesi@oracle.com>,
gcc <gcc@gcc.gnu.org>, joergboe <joergboe@snafu.de>
Subject: Re: Generation of Make Dependencies for C++ Modules
Date: Sun, 28 Dec 2025 21:31:44 -0500 [thread overview]
Message-ID: <aVHoEGati-v6tOPh@rotor> (raw)
In-Reply-To: <I5uNnWAxbiaNuBu8cUmF7cd57vw-hTaSHfEbEBd8AjAb7hiR3H7GT_90Ie7sOvg-FFB8iy3zg64TCLycHqqira_ufL7o2jENKuf7ob93dB4=@protonmail.com>
On Mon, Dec 29, 2025 at 00:03:44 +0000, vspefs via Gcc wrote:
> > Some people seem to want that from C++ modules, but the way they
> > currently work is highly compiler specific (even to the point that
> > mismatching compiler flags can cause a compiled module interface to be
> > rejected). I don't see this changing anytime soon; my personal
> > expectation is that C++ build systems will still require distributing at
> > least the sources for any public module interfaces in addition to shared
> > libraries with the contents of any relevant implementation units.
>
> I haven’t really gone through Jose’s informative reply, but your
> concern here is valid. CMI is designed to be an extremely
> implementation-specific stuff and everything you said is right.
I have a pending reply to Jose's post, but I'll reply here since it is
more focused.
> What I want to point out is there are some standard and community
> efforts to make it distributable, but to make it actually useful we’re
> practically at least designing a “standard C++ AST” which can be
> considered impractical. By “community efforts” I mean CMake does
> distribute CMI but that’s just one way of distributing module
> packages. The alternative, and from your (also my) point of view, the
> correct way, is to use CXX_MODULES file set to package module
> interface units in the final distribution. Meanwhile, Xmake and Bazel
CMake ships the CMI (though it uses the BMI TLA), but currently does not
consume it. The idea is that multiple CMI files could be shipped for
each module. If P2581 is ever implemented, CMake could look at what BMI
files are available for the module and use "copy file" as the "bmild the
module" implementation.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2581r2.pdf
Will it ever exist? No idea.
I haven't dug into xmake's implementation, but Bazel (AFAIK) is much
stricter about flag sets across the build and can kind of wave it away
by convention.
> There are naturally some distribution problems emerging here. CMake’s
> solution works perfectly if we stay in the CMake universe but it
> distributes CMake script along with the package. If we want module
> packages at least universal as pkg-config packages, we’ll need some
> consensus between build systems. It can be pessimistic or limiting.
> WG21 used to have a study group that could make it a standard effort
> but due to reasons they can’t. Now arguably the best place to discuss
> such things is the EcoStd organization.
Please see CPS for shipping package information without using CMake
script. CPS export support is currently experimental in CMake, but it is
coming.
https://github.com/cps-org/cps
And yes, please consider joining EcoStd for discussion about such
things.
Thanks,
--Ben
next prev parent reply other threads:[~2025-12-29 2:31 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-22 18:11 joergboe
2025-12-23 16:23 ` Ben Boeckel
2025-12-25 18:28 ` joergboe
2025-12-26 3:16 ` Ben Boeckel
2025-12-27 5:50 ` vspefs
2025-12-27 11:24 ` Jose E. Marchesi
2025-12-27 12:01 ` Arsen Arsenović
2025-12-28 4:31 ` vspefs
2025-12-28 14:30 ` Jose E. Marchesi
2025-12-28 21:50 ` Nathaniel Shead
2025-12-29 0:03 ` vspefs
2025-12-29 2:31 ` Ben Boeckel [this message]
2025-12-29 6:12 ` vspefs
2025-12-29 16:13 ` Ben Boeckel
2025-12-30 13:47 ` vspefs
2025-12-30 16:19 ` Ben Boeckel
2025-12-30 16:54 ` Arsen Arsenović
2025-12-29 2:50 ` Ben Boeckel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aVHoEGati-v6tOPh@rotor \
--to=ben.boeckel@kitware.com \
--cc=gcc@gcc.gnu.org \
--cc=joergboe@snafu.de \
--cc=jose.marchesi@oracle.com \
--cc=nathanieloshead@gmail.com \
--cc=vspefs@protonmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).