in reply to Re^3: B::Generate for Win32?
in thread B::Generate for Win32?

Okay. One mystery solved. This kinda reminds me of your sig.

You can't make shit up for your error messages and expect the user to know what you mean retardo!

But now another mystery to solve. I've seen people (mostly you actually :), talking about ppm2 and ppm3. I don't ever recall having been asked which I want to use, or even being made aware that there are different versions. I just type "ppm".

P:\test>ppm PPM - Programmer's Package Manager version 3.1. Copyright (c) 2001 ActiveState Corp. All Rights Reserved. ActiveState is a devision of Sophos. Entering interactive shell. Using Term::ReadLine::Stub as readline lib +rary. Type 'help' to get started. ppm> quit P:\test>ppm3 PPM - Programmer's Package Manager version 3.1. Copyright (c) 2001 ActiveState Corp. All Rights Reserved. ActiveState is a devision of Sophos. Entering interactive shell. Using Term::ReadLine::Stub as readline lib +rary. Type 'help' to get started. ppm> quit P:\test>ppm2 Can't locate PPM.pm in @INC (@INC contains: c:/Perl/lib c:/Perl/site/l +ib .) at c:\perl561\bin/ppm2.bat line 21. BEGIN failed--compilation aborted at c:\perl561\bin/ppm2.bat line 21.

From that, is it safe to assume that:

  1. The PPM I get when I type PPM is indeed v3.1? (or is that version info another red herring? (feeling kippered!)).
  2. I don't need a patch for that. (Or rather, your ppd2 patch won't help me)?

If, given your detective work above, B::Generate builds elsewhere but not on Win32, then the problem lies not in the module, but in the Module::Build mechanism for Win32?

I've been trying to work my way through the process, but so far I cannot even drop the warnings level (-W3 to -W2) successfully.

First, I modified Generate.ccs, but that gets regenerated by the build process. So then I disabled the generation (by temporarially hacking C:\Perl\site\lib\Module\Build\Platform\Windows.pm )

sub _generic_write_compiler_script { my ($self, %spec) = @_; my $script = File::Spec->catfile( $spec{srcdir}, $spec{basename} . '.ccs' ); $self->add_to_cleanup($script); print "Generating script **DISABLED** '$script'\n"; =disabled open( SCRIPT, ">$script" ) or die( "Could not create script '$script': $!" ); print SCRIPT join( "\n", map { ref $_ ? @{$_} : $_ } grep defined, delete( @spec{ qw(includes cflags optimize defines perlinc) } ) ); close SCRIPT; =cut push @{$spec{includes}}, qq{\@"$script"}; return %spec; }

But even though I dropped -W3 -> -W2 and removed the (duplicated) -O1 optimisation flag in Generate.ccs

-nologo -Gf -W2 <<<<<<<<<<<<<<<<< -MD -Zi -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -MD -Zi -DNDEBUG -I"C:\Perl\lib\CORE" -I"C:\cl\include"

Something somewhere comes along and sticks these back onto the command line anyway:

P:\packages\B-Generate-1.06>nmake Microsoft (R) Program Maintenance Utility Version 7.00.9466 Copyright (C) Microsoft Corporation. All rights reserved. c:\Perl\bin\perl.exe Build Generating script **DISABLED** 'lib\B\Generate.ccs' cl -nologo -c @"lib\B\Generate.ccs" -nologo -Gf -W3 -MD -Zi -DNDEBUG - +O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -D +PERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_ +READFIX -MD -Zi -DNDEBUG -O1 -I"C:\Perl\lib\CORE" -I"C:\cl\include" - +I"C:\hla\include" -I"C:\Perl\lib\CORE" -Fo"lib\B\Generate.obj" "lib\B +\Generate.c" cl : Command line warning D4025 : overriding '/W2' with '/W3' cl : Command line warning D4029 : optimization is not available in the + standard edition compiler Generate.c Generate.xs(102) : warning C4101: 'val' : unreferenced local variable Generate.xs(220) : warning C4101: 'value' : unreferenced local variabl +e Generate.xs(241) : warning C4101: 'value' : unreferenced local variabl +e Generate.xs(463) : warning C4133: '=' : incompatible types - from 'SV +*' to 'B__CV' Generate.xs(617) : warning C4244: '=' : conversion from 'I32' to 'U16' +, possible loss of data Generate.c(883) : warning C4101: 'RETVAL' : unreferenced local variabl +e Generate.xs(638) : warning C4244: '=' : conversion from 'I32' to 'U16' +, possible loss of data Generate.xs(645) : warning C4013: 'fold_constants' undefined; assuming + extern returning int Generate.xs(645) : warning C4047: '=' : 'B__OP' differs in levels of i +ndirection from 'int' Generate.c(914) : warning C4101: 'RETVAL' : unreferenced local variabl +e Generate.c(1482) : warning C4244: '=' : conversion from 'U32' to 'U16' +, possible loss of data Generate.c(1506) : warning C4244: '=' : conversion from 'U32' to 'U16' +, possible loss of data Generate.xs(1037) : error C2106: '=' : left operand must be l-value Generate.c(2007) : warning C4244: '=' : conversion from 'line_t' to 'U +16', possible loss of data error building dll file from 'lib\B\Generate.c' at C:\Perl\site\lib/Mo +dule/Build/Platform/Windows.pm line 106. NMAKE : fatal error U1077: 'c:\Perl\bin\perl.exe' : return code '0x2' Stop. P:\packages\B-Generate-1.06>

I was kind of hoping to be able to go to p5p with something that actually fixed the problem, or at least narrowed the target area of where to look, but so far (as is all too typical with every attempt I've made to understand this sh...stuff), even the simplest changes to the build process are just impossible.

Any thoughts or advice welcomed.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon

Replies are listed 'Best First'.
Re^5: B::Generate for Win32?
by PodMaster (Abbot) on Aug 21, 2004 at 23:54 UTC
    Yes, you have ppm3. That's the version not on CPAN. Anyone can get it from http://downloads.activestate.com/PPM/. IIRC, ActivePerl 5.6 originally came with ppm2 (still called it ppm), while ActivePerl 5.8 came with ppm3.
     
    If, given your detective work above, B::Generate builds elsewhere but not on Win32, then the problem lies not in the module, but in the Module::Build mechanism for Win32?
    No, Module::Build is not the problem, and neither is win32. It shouldn't build on any platform ( 'fold_constants' isn't exported anywhere). From what I can tell you'd have to build from the perl (5.8+) source tree (PERL_CORE), and you'd have to link in op.obj, but there is no mention of this anywhere.

    Or, you have to build a perl which exports fold_constants (or Perl_fold_constants).

    Maybe you need to build a new perl? Hmm, yeah, maybe you need to make perl. I can't tell, nor can I test (that part is horribly broken on win32, use of cat everywhere, excedes commandline (i got tons of extensions installed) ... horrible).

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      Okay. Just so I know I understand what your saying...

      If someone attempting to build B::Generate, was doing it on top of a copy of perl they had built themselves--which most unix people/perl hackers would be--then the "missing bits" would probably be "lying around" in appropriate places and would get picked up and used when building Generate.xs.

      But because I was attempting to build on top of a binary distribution of perl, the objects and libs created by the Perl build process aren't there, hence the failure. And no amount of hacking, beyond rebuild perl myself and building B::Generate on top of that, is going to let me succeed.

      Did I get it?


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "Think for yourself!" - Abigail
      "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
        Yup, you got it. Followup here (in this thread) if you get anything out of the p5p.

        MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
        I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
        ** The third rule of perl club is a statement of fact: pod is sexy.

      It shouldn't build on any platform ( 'fold_constants' isn't exported anywhere)
      I have to admit that my understanding of this is weak, but I believe that only some platforms require explicitly listing what symbols are publicly exported from a dynamic library. This is handled by makedef.pl in the perl source; from the comments there, this seems to be limited to Win32, wince, os2, AIX, netware, and MacOS. So problems like this (a module using a symbol that isn't available everywhere) do fairly regularly crop up. I think the fix is to add Perl_fold_constants to global.sym (by changing it to public in embed.fnc and running embed.pl) and rebuild perl :(.