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 <<a href=3D"mailto:tony@devel= op-help.com">[email protected]</a>> 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 "LeoNerd&quo= t; Evans wrote:<br> > TL;DR: We have some CI test builds that use -Dcc=3D'g++', to t= est if we can<br> >=C2=A0 =C2=A0build perl using g++ as the "C" compiler. I wond= er - why do we do this?<br> >=C2=A0 =C2=A0Perl is written in C, not C++, which is a different langua= ge. Can we<br> >=C2=A0 =C2=A0please not?<br> <br> I suggested porting/cpphdrcheck, which checks the syntax of the<br> headers, but it doesn'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'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'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 "/just|another|perl|hacker= /"</div></div> --0000000000005b5efe065588390b--