public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
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: Mon, 29 Dec 2025 11:13:38 -0500	[thread overview]
Message-ID: <aVKoshGL79iKsEsE@rotor> (raw)
In-Reply-To: <QDAE52GL3gVVryBRiWB3AZleCrFMzTLL6DkVbDHJGQBQpaea0AGJr4k5sdpOSFQTwqanknptaO15rECsgzPb-mZDD4qTGX8Jjf0QvsoGO68=@protonmail.com>

On Mon, Dec 29, 2025 at 06:12:59 +0000, vspefs wrote:
> > 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.
> 
> I think about distribution mainly in 2 ways, source distribution and binary
> distribution. The former ships the full project, both source files and build
> scripts. Source packages typically need running the corresponding build system
> to consume. The latter, on the contrary, distributes as final output artifacts
> as possible, and uses minimal meta information, whose logic (if there's any)
> is kept minimal as well. Xmake and Bazel both strongly tend towards source
> distribution. CMake packages, if export targets and install exported targets
> and do other stuff right, is "binary distribution + meta info in CMake
> script".Of course, CMake also supports source distribution and other forms of
> binary distribution (none of which support C++20 modules now though).

CMake's C++ module support is kind of a hybrid. Projects ship libraries
and module interface units. The consuming side then rebuilds BMIs as
necessary. I expect this to be the norm until BMI compatibility
detection tooling is available (and even then the support must be there,
but a very opinionated build system *could* just say "fix your stuff to
be consistent" at that point).

> The crucial difference is source distribution makes use of the full power of
> the build system. No semantic information within the scope of that certain
> build system is lost. So does "binary distribution + build system script".
> Binary distribution kinda has to be fixed, universal, and simple (or what's
> the point?). So I think the problem is not "making modules work in source
> packages", because that's totally a per-build-system business, and all it
> requires from the build system is a working dependency scanner. Binary
> distribution + universal meta info is where it's tricky.

Agreed.

> And honestly, the position of compiler in this picture? We don't know exactly
> until we are clear of what that "universal meta info" would look like. But if
> it's for Autotools, then I think it might be acceptable for GCC to have a
> dedicated `dep-format`. Of course, if Autotools figures things out from only
> P1689R5 format output, that's even better.

Note that I'd like to avoid yet another format because I doubt autotools
wants its module support to be "GCC only". I know LLVM-as-frontend is
eating the lunch of proprietary compilers, and P1689R5 is already there,
so that seems like an easy win to me.

I guess the main hurdle is either porting some JSON parser to an
automake-compatible language or growing a dependency on something like
`jq`.

> I know CPS as a good attempt to unify binary distribution meta info. It doesn't
> natively support C++20 modules far as I know. And I don't think adding an
> "interface_units" field could fix this problem. I think there has to be a way

This was added recently:

    https://github.com/cps-org/cps/pull/95

> to inform users which compilation flags are compatible with this artifact and
> which are not. SG15 used to have core options which could beautifully solve
> this problem (and a few others). Seems like has to be another EcoStd stuff now.

CPS has a similar concept to CMake's compile option usage requirements,
so projects requiring specific flags can be propagated that way.

Note that CMake because re-builds BMIs at the consuming side, compatible
flags is down to the same ABI concerns we've always had with header and
library artifact mismatches that have always existed.

Thanks,

--Ben

  reply	other threads:[~2025-12-29 16:13 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
2025-12-29  6:12               ` vspefs
2025-12-29 16:13                 ` Ben Boeckel [this message]
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=aVKoshGL79iKsEsE@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).