develooper Front page | perl.perl5.porters | Postings from July 2012

Re: disentangling version's XS from util.c and universal.c mightbe possible (was Re: supporting untarring of extensions)

Thread Previous | Thread Next
From:
John Peacock
Date:
July 12, 2012 10:07
Subject:
Re: disentangling version's XS from util.c and universal.c mightbe possible (was Re: supporting untarring of extensions)
Message ID:
4FFF0446.5080406@havurah-software.org
On 07/12/2012 09:59 AM, Nicholas Clark wrote:
> I *think* that the code in version's vutil/vutil.c is (pretty much) exactly
> the code in (part of) util.c

In fact, I copy that block of code back and forth (depending on which 
side was updated last).  There are a couple of very minor differences 
but ultimately they are intended to be identical and with very little 
work could be identical.

> 1) Hence, it ought to be possible to #include "cpan/version/vutil/vutil.c"
>     from util.c, and de-dup the code. It will likely need a few #defines
>     and #ifdefs added in a couple of places.
>
> I *think* that the code in universal.c is supposed to be the same as
> the version/vutil/vxs.c that ExtUtils::ParseXS generates from vxs.xs

This part has been historically more manual, but yes, they are intended 
to be identical.

> Whilst we have somewhat a bootstrapping problem in that miniperl needs that
> code to build lib/Config.pm to build ... to build ExtUtils::ParseXS to build
> that code, *unlike* DynaLoader this isn't horrible platform specific mess.
> So it might well be possible to
>
> 2) split out that bit of universal.c into another C file which is #include-ed
>     from universal.c
>
> 3) potentially, automate *generating* that file from vxs.xs (in some fashion),
>     and having a script in regen/ to do this, and a test in t/porting/regen.t
>     to check that it doesn't diverge.

I can take a crack at this, but right now isn't a terribly good time (my 
wife has had some worrying health issues and I'm currently at her 
bedside in the ICU, though she is actually doing quite well now)...

John

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About