C++ Logo


Advanced search

Re: [Tooling] Modules

From: Ben Craig <ben.craig_at_[hidden]>
Date: Fri, 1 Feb 2019 15:47:24 +0000
Current state of things: Within a library*, no dependency information** is needed in order to generate a clean build. I can build all my .cpp files in any order I want.
Future state of things: With a library, dependency information will need to be generated / provided in order to generate a clean build. I need to build my modules in dependency order. The correct order depends upon the contents of the modules.

* Across libraries, dependency order matters again because later linking steps depend on earlier linking steps.
** This isn’t 100% true, as generated headers from tools like SWIG, protobufs, thrift, and I think some QT things, all require those headers to be generated before you can compile your .cpp files. In my experience, this is usually handled by doing all the header generation early in the build process, before any .cpp files are built, and that approach doesn’t scale well to modules. build2 does this different and more correctly, and I suspect that Google’s internal build process is similar.

From: tooling-bounces_at_[hidden] <tooling-bounces_at_[hidden]> On Behalf Of Titus Winters
Sent: Friday, February 1, 2019 8:25 AM
To: WG21 Tooling Study Group SG15 <tooling_at_[hidden]>
Subject: Re: [Tooling] Modules

No, naturally not. The build system handles transitivity and making transitive includes available in each parallel build shard.

I'm just trying to figure out how much of this is fundamental to all build systems (I don't think it is) vs. "I just want globbing to be enough" (I also don't think it's that). There's some subtlety in here that I think is getting lost and conflated with "stuff works this way now". Of course if we change things, things will be different.

On Fri, Feb 1, 2019 at 9:20 AM Boris Kolpackov <boris_at_[hidden]<mailto:boris_at_[hidden]>> wrote:
Titus Winters <titus_at_google.com<mailto:titus_at_[hidden]>> writes:

> We've been doing explicit statements of the dependency chain for our
> codebase for almost 20 years, and I've literally never heard a new hire (or
> anyone else) say it is a "huge" burden.

The question is to what degree. I am sure you don't require new
hires to manually specify for each translation unit dependencies
on headers it includes, transitively?

But that would sure make for a nice hazing ritual.
Tooling mailing list

Received on 2019-02-01 16:47:31