Re: Why do we test a build using g++?

[email protected] (Tony Cook) Wed, 1 Jul 2026 10:35:00 +1000
Newsgroups perl.perl5.porters
Message-ID <[email protected]>
On Mon, Jun 29, 2026 at 10:41:14PM +0100, Paul "LeoNerd" Evans wrote:
> TL;DR: We have some CI test builds that use -Dcc='g++', to test if we can
>   build perl using g++ as the "C" compiler. I wonder - why do we do this?
>   Perl is written in C, not C++, which is a different language. Can we
>   please not?

I suggested porting/cpphdrcheck, which checks the syntax of the
headers, but it doesn't exercise the perl API beyond that.  This is a
problem since the API has a large number of macros, which unlike
inline functions are only syntax checked if you use them.

Perl itself probably exercises more of the API than any XS module
does*, so that would be one reason to keep building as C++ in CI (some
daily build reporters also run C++ builds, see
https://perl.develop-help.com/#cc=%5C%2B%5C%2B ).

We could try adding a test C++ module in core to test against, but
that's only going to exercise a tiny part of the API unless we put a
ridiculous amount of effort into it.  Maybe we could do two builds of
XS::APItest - one as C, another as C++, but I don't think that has the
API coverage that perl itself does.

One alternative would be to have CI test a variety of C++ modules from
CPAN, though that leaves CI vulnerable to failures due to
network/infrastructure issues, and updates to those modules and their
dependencies.  It may also be slow, since we're installing them and their
dependencies from scratch each time.

Another option is to just let CPAN testers test them and deal with the
BBC reports as they come in.

Tony

* I expect it tests more of the API than all C++ modules put together.