C++ Logo

sg15

Advanced search

Re: [isocpp-sg21] Contracts and tooling

From: Daniel Ruoso <daniel_at_[hidden]>
Date: Fri, 17 Nov 2023 16:59:11 -0500
On Fri, Nov 17, 2023, 07:58 Timur Doumler via SG15 <sg15_at_[hidden]>
wrote:

> First of all - what changed in Varna? Are header units now *more*
> implementable or *less* implementable than described in Daniel Ruoso's
> paper?
>

It's amazing how important the in person meetings are...

My main issue with the implementability of header units was that the
dependency scanning needed access to the list of header units and their
local preprocessor arguments, which created a dependency bottleneck. I.e.:
any change to that metadata would invalidate the dependency scanning for
all translation units.

We've reached consensus on two aspects during the Varna meeting:

 1) dependency scanning should be able to discover if a header is
importable or not without being given that information directly. The
approach we've agreed on is that there will be a filesystem way for it to
discover if a particular header or is already trying to include is
importable (a metadata file on disk).

 2) header units are not allowed to have local preprocessor arguments. That
means the command line to translate their BMI is deterministic from the
command line of the TU doing the import, and guaranteed to be the same
transitively.

Those two things solve the challenges I had for their implementability.

But I should say no implementation currently does this, because there's
currently no way to tell the dependency scanner what the "baseline compile
command" is.

The good news is that we managed to arrive at a consensus for that in Kona.
The baseline command will be communicated via a "response file" to the
dependency scanner.

Now we have a path forward for compilers and build systems to support this.

(The final revision of that paper, which was what was presented in Varna,
covers that)

Also, what does it mean, "implementable but not to the extent that e.g.
> Bloomberg requires"? It seems to me that something is either implementable
> as specified in the Standard, or it is not.
>

Build systems that support "dynamic tasks" (i.e.: have not only new edges,
but also new nodes, to be added to the build graph during the build itself
would have a path forward before.

Build systems implemented with Ninja, for instance, didn't have a way to
implement header units before. With the changes we agreed to in Varna they
have a way.

Daniel

Received on 2023-11-17 21:59:24