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

[email protected] (demerphq) Wed, 1 Jul 2026 10:10:14 +0200
Newsgroups perl.perl5.porters
Message-ID <CANgJU+VYAVxAxZinKXXb2-KbqY1q5YG3rp_cJm1DnL5n-hZY0w@mail.gmail.com>
--0000000000005b5efe065588390b
Content-Type: text/plain; charset="UTF-8"

On Wed, 1 Jul 2026 at 02:35, Tony Cook <[email protected]> wrote:

> 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.
>

Just a thought. but this is the kind of thing an LLM is really good at. It
would be interesting to ask an AI to enhance or split XS::APItest
(whatever) and then methodically ensure it tests virtually every function
listed in embed.fnc.

cheers,
Yves


-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

--0000000000005b5efe065588390b
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><span style=3D"background-color:transpare=
nt">On Wed, 1 Jul 2026 at 02:35, Tony Cook &lt;<a href=3D"mailto:tony@devel=
op-help.com">[email protected]</a>&gt; wrote:</span></div><div class=3D=
"gmail_quote gmail_quote_container"><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">On Mon, Jun 29, 2026 at 10:41:14PM +0100, Paul &quot;LeoNerd&quo=
t; Evans wrote:<br>
&gt; TL;DR: We have some CI test builds that use -Dcc=3D&#39;g++&#39;, to t=
est if we can<br>
&gt;=C2=A0 =C2=A0build perl using g++ as the &quot;C&quot; compiler. I wond=
er - why do we do this?<br>
&gt;=C2=A0 =C2=A0Perl is written in C, not C++, which is a different langua=
ge. Can we<br>
&gt;=C2=A0 =C2=A0please not?<br>
<br>
I suggested porting/cpphdrcheck, which checks the syntax of the<br>
headers, but it doesn&#39;t exercise the perl API beyond that.=C2=A0 This i=
s a<br>
problem since the API has a large number of macros, which unlike<br>
inline functions are only syntax checked if you use them.<br>
<br>
Perl itself probably exercises more of the API than any XS module<br>
does*, so that would be one reason to keep building as C++ in CI (some<br>
daily build reporters also run C++ builds, see<br>
<a href=3D"https://perl.develop-help.com/#cc=3D%5C%2B%5C%2B" rel=3D"norefer=
rer" target=3D"_blank">https://perl.develop-help.com/#cc=3D%5C%2B%5C%2B</a>=
 ).<br>
<br>
We could try adding a test C++ module in core to test against, but<br>
that&#39;s only going to exercise a tiny part of the API unless we put a<br=
>
ridiculous amount of effort into it.=C2=A0 Maybe we could do two builds of<=
br>
XS::APItest - one as C, another as C++, but I don&#39;t think that has the<=
br>
API coverage that perl itself does.<br></blockquote><div><span style=3D"bac=
kground-color:transparent"><br></span></div><div><span style=3D"background-=
color:transparent">Just a thought. but this is the kind of thing an LLM is =
really good at. It would be interesting to ask an AI to enhance or split XS=
::APItest (whatever) and then methodically ensure it tests virtually every =
function listed in embed.fnc.</span></div><div><span style=3D"background-co=
lor:transparent"><br></span></div><div><span style=3D"background-color:tran=
sparent">cheers,</span></div><div><span style=3D"background-color:transpare=
nt">Yves=C2=A0</span></div></div><div><br clear=3D"all"></div><div><br></di=
v><span class=3D"gmail_signature_prefix">-- </span><br><div dir=3D"ltr" cla=
ss=3D"gmail_signature">perl -Mre=3Ddebug -e &quot;/just|another|perl|hacker=
/&quot;</div></div>

--0000000000005b5efe065588390b--