develooper Front page | perl.perl5.porters | Postings from October 2015

(version PP is not PP) RE: GCC builds failing many tests on Windows

Thread Next
bulk 88
October 20, 2015 22:14
(version PP is not PP) RE: GCC builds failing many tests on Windows
Message ID:

> Date: Tue, 20 Oct 2015 13:50:19 +0100
> Subject: Re: GCC builds failing many tests on Windows
> From:
> To:
> CC:
> I can't understand how this doesn't happen for you. It happens every
> time for me on two different machines (Windows 7 and Windows 8.1).
> The build sequence with a straight "dmake" is:
> miniperl.exe
> DynaLoader
> XS extensions
> perl.dll
> perl.exe
> non-XS extensions
> The problem is that POSIX is an XS extension, but its Makefile.PL
> needs XSLoader, which is non-XS so hasn't been made yet.

So how does the Unix build resolve these dependencies in parallel mode? XSLoader isn't in

> Makefile.PL fails every time with this error:
> Can't locate in @INC (you may need to install the XSLoader
> module) (@INC contains: [...]) at C:\Dev\Git\perl\lib/ line 26.
> BEGIN failed--compilation aborted at C:\Dev\Git\perl\lib/ line 28.
> Compilation failed in require at
> C:\Dev\Git\perl\cpan\ExtUtils-MakeMaker\lib/ExtUtils/MakeMaker/version/
> line 954.
> 512 from ext/POSIX's Makefile.PL at ..\ line 523.

sub _find_magic_vstring {
    my $value = shift;
    my $tvalue = '';
    require B;<<<<<<<<<<<<<LINE 954
    my $sv = B::svref_2object(\$value);
    my $magic = ref($sv) eq 'B::PVMG' ? $sv->MAGIC : undef;
    while ( $magic ) {
    if ( $magic->TYPE eq 'V' ) {
        $tvalue = $magic->PTR;
        $tvalue =~ s/^v?(.+)$/v$1/;
    else {
        $magic = $magic->MOREMAGIC;
    return $tvalue;

B::svref_2object is implemented in B.xs. There is no running/loading of XS code inside miniperl. Plus " pure perl" is not pure perl if it requires B (XS) to execute, that dep on B:: comes from in from 2010 but  I can't find a ticket or context behind that commit

> It's the WriteConstants() call that fails. WriteMakefile() has already
> run successfully by this stage, so a Makefile has been written and
> POSIX.dll builds, but and end up zero size.
> (Crucially, they *exist* so the #include in POSIX.c doesn't fail,
> hence the build continues.)

I tried something different a
dmake -P3  ..\perl523.lib ..\DynaLoader.obj ..\perlglob.exe CCTYPE=MSVC120
which is the prereq list to build Extentions target followed by
..\miniperl.exe -I..\lib ..\ "MAKE=dmake" --dir=..\cpan --dir=..\dist --dir=..\ext ext/POSIX
to build just 1 XS module.
C:\p523\src\win32>..\miniperl.exe -I..\lib ..\ "MAKE=dmake" --dir=..\
cpan --dir=..\dist --dir=..\ext ext/POSIX
Generating a dmake-style Makefile
Writing Makefile for POSIX
Can't locate in @INC (you may need to install the B module) (@INC contains:
 C:\p523\src\lib C:\p523\src\cpan\AutoLoader\lib C:\p523\src\dist\Carp\lib C:\p5
23\src\dist\PathTools C:\p523\src\dist\PathTools\lib C:\p523\src\cpan\ExtUtils-I
nstall\lib C:\p523\src\cpan\ExtUtils-MakeMaker\lib C:\p523\src\cpan\ExtUtils-Man
ifest\lib C:\p523\src\cpan\File-Path\lib C:\p523\src\ext\re C:\p523\src\dist\Ter
m-ReadLine\lib C:\p523\src\dist\Exporter\lib C:\p523\src\ext\File-Find\lib C:\p5
23\src\cpan\Text-Tabs\lib C:\p523\src\dist\constant\lib C:\p523\src\cpan\Text-Pa
rseWords\lib C:\p523\src\dist\ExtUtils-ParseXS\lib C:\p523\src\cpan\Getopt-Long\
lib C:\p523\src\cpan\parent\lib C:\p523\src\cpan\ExtUtils-Constant\lib .) at C:\
p523\src\cpan\ExtUtils-MakeMaker\lib/ExtUtils/MakeMaker/version/ line 954.

512 from ext/POSIX's Makefile.PL at ..\ line 523.
Running Mkbootstrap for POSIX ()
C:\p523\src\miniperl.exe "-I..\..\lib" "-I..\..\lib" -MExtUtils::Command -e chmo
d -- 644 ""
"..\..\miniperl.exe" "-I..\..\lib" "-I..\..\lib" "C:\p523\src\dist\ExtUtils-Pars
eXS\lib\ExtUtils\xsubpp" -noprototypes -typemap "..\..\lib\ExtUtils\typemap" -ty
pemap "typemap"  POSIX.xs > POSIX.xsc && C:\p523\src\miniperl.exe "-I..\..\lib"
"-I..\..\lib" -MExtUtils::Command -e mv -- POSIX.xsc POSIX.c
cl -c           -nologo -GF -W3 -O1 -MD -Zi -DNDEBUG -GL -DWIN32 -D_CONSOLE -DNO
  -DVERSION=\"1.58\"    -DXS_VERSION=\"1.58\"  "-I..\..\lib\CORE"   POSIX.c
"..\..\miniperl.exe" "-I..\..\lib" "-I..\..\lib" -MExtUtils::Mksymlists \
     -e "Mksymlists('NAME'=>\"POSIX\", 'DLBASE' => 'POSIX', 'DL_FUNCS' => {  },
'FUNCLIST' => [], 'IMPORTS' => {  }, 'DL_VARS' => []);"
link -out:..\..\lib\auto\POSIX\POSIX.dll -dll -nologo -nodefaultlib -debug -opt:
ref,icf -ltcg           -libpath:"c:\perl\lib\CORE"             -machine:x86 "/m
anifestdependency:type='Win32' name='Microsoft.Windows.Common-Controls' version=
'' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='
*'" -subsystem:console,"5.01" POSIX.obj   "..\..\lib\CORE\perl523.lib" oldnames.
lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib she
ll32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.l
ib version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib -def:POSIX.def
   Creating library ..\..\lib\auto\POSIX\POSIX.lib and object ..\..\lib\auto\POS
Generating code
Finished generating code
if exist ..\..\lib\auto\POSIX\POSIX.dll.manifest mt -nologo -manifest ..\..\lib\
auto\POSIX\POSIX.dll.manifest -outputresource:..\..\lib\auto\POSIX\POSIX.dll;2
if exist ..\..\lib\auto\POSIX\POSIX.dll.manifest del ..\..\lib\auto\POSIX\POSIX.
C:\p523\src\miniperl.exe "-I..\..\lib" "-I..\..\lib" -MExtUtils::Command -e chmo
d -- 755 ..\..\lib\auto\POSIX\POSIX.dll


The problem is this line is not inline with the Makefile.PL API  non-zero exit code from Makefile.PL is fatal, do not proceed according to  that code is instead proceeding.  That warn line in is from which turned previously never capturing the exit code from Makefile.PL into a warning. I have posted a patch to fix this in

In parallel building there is so much mangled choppy text flowing through the console a human will probably not notice the warning. For automated testing, that warning is evil since it doesn't turn into a higher level fail status which stops the master/root Makefile.

With that patch and cluck(), I see the problem is related to EUMM/ miniperl.exe contains XS as xsubs. But somehow the POSIX Makefile.PL process is loading a PP version which calls _un_vstring/_find_magic_vstring which doesn't exist in the XS version of new() (XS version doesn't do a callback into B::). The alphabetic sorting in accidentally means B is built before POSIX so everything accidentally magically works. IDK why I can build WIn32 dmake perl at all, since there is a die() from XSLoader/Dynaloader running on Miniperl, if I build Dynaloader, XSLoader, B, and then POSIX by hand on a clean (no Extensions_nonxs target run) tree.
C:\p523\src\win32>..\miniperl.exe -I..\lib ..\ "MAKE=dmake" --dir=..\
cpan --dir=..\dist --dir=..\ext ext/POSIX
Generating a dmake-style Makefile
Writing Makefile for POSIX
 at C:\p523\src\cpan\ExtUtils-MakeMaker\lib/ExtUtils/MakeMaker/version/ li
ne 955.
) called at C:\p523\src\cpan\ExtUtils-MakeMaker\lib/ExtUtils/MakeMaker/version/v line 937
        ExtUtils::MakeMaker::version::vpp::_un_vstring("\x{5}\x{d}\x{5}") called
 at C:\p523\src\cpan\ExtUtils-MakeMaker\lib/ExtUtils/MakeMaker/version/ li
ne 681
        ExtUtils::MakeMaker::version::vpp::new("version") called at C:\p523\src\
cpan\ExtUtils-MakeMaker\lib/ExtUtils/MakeMaker/version/ line 806
        ExtUtils::MakeMaker::version::vpp::vcmp(version=HASH(0x444378), "\x{5}\x
{d}\x{5}", "") called at C:\p523\src\cpan\ExtUtils-Constant\lib/ExtUtils/Constan
t/ line 201
Subs", "C_SUBNAME", "constant", "C_FILE", "", "XS_FH", GLOB(0x20762b8
), "NAME", ...) called at C:\p523\src\cpan\ExtUtils-Constant\lib/ExtUtils/Consta line 530
        ExtUtils::Constant::WriteConstants("PROXYSUBS", HASH(0x2076030), "NAME",
 "POSIX", "NAMES", ARRAY(0xecda30)) called at Makefile.PL line 142
Can't load module B, dynamic loading not available in this perl.
  (You may need to build a new perl executable which either supports
  dynamic loading or has the B module statically linked into it.)
 at C:\p523\src\lib/ line 28.
BEGIN failed--compilation aborted at C:\p523\src\lib/ line 28.
Compilation failed in require at C:\p523\src\cpan\ExtUtils-MakeMaker\lib/ExtUtil
s/MakeMaker/version/ line 956.
Unsuccessful Makefile.PL(ext/POSIX): code=65280 at ..\ line 526.

It is something to do with I will need to research it further, perhaps EUMM needs fixing to better detect whether to use its bundled Version PP, or use miniperl's Version XS. And version on CPAN needs fixing since vpp is a lie, it is not pure perl.
Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About