Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Problem installing Carp-1.25 under DWIM Perl

by HelenCr (Monk)
on May 20, 2012 at 23:17 UTC ( [id://971526]=perlquestion: print w/replies, xml ) Need Help??

HelenCr has asked for the wisdom of the Perl Monks concerning the following question:

Hi respected PerlMonks. I hope you can help me with this problem.

I have installed Strawberry Perl for Windows, "DWIM Perl" from: http://dwimperl.com/. I would like to use Carp. So I have downloaded Carp-1.25 from CPAN, un-TAR-ed it, and ran nmake. I get:

Microsoft (R) Program Maintenance Utility Version 10.00.30319.01 Copyright (C) Microsoft Corporation. All rights reserved. to undefined at F:/Dwimperl/perl/lib/ExtUtils/Install.pm line 1208 NMAKE : fatal error U1077: 'F:\Dwimperl\perl\bin\perl.exe' : return co +de '0x2' Stop.
Note that it's not a Windows nmake problem, I get a similar error when running make in cygwin.

My system: MS Windows 7.

(By the way, I have been running ActiveState Perl fine, and there, PPM downloads and installs Carp with no problem. The reason I've switched to Strawberry/DWIM Perl, is that I'd like to run a debugger, and Padre's latest version on ActiveState is 0.86, which is buggy. So I've installed DWIM Perl since I'd like to use Padre 0.92).

Note: cross-posted on StackOverflow

Replies are listed 'Best First'.
Re: Problem installing Carp-1.25 under DWIM Perl
by runrig (Abbot) on May 21, 2012 at 00:33 UTC
    IIRC, Strawberry Perl comes with dmake.
Re: Problem installing Carp-1.25 under DWIM Perl
by tobyink (Canon) on May 20, 2012 at 23:37 UTC

    The problem seems to be around here. For some reason, $to is not being defined. I'd edit that file, insert some kind of stacktrace/dump into the loop, and see what's going on. Presumably a problem somewhere further up the stack.

    That said, why do you need 1.25? Carp 1.20 should come pre-installed with Perl 5.14.2, and there doesn't seem to be any killer features added since.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

      Carp doesn't seem to be included in 5.14.

      If I don't install Carp, I get, for example:

      E:\Perl>perl "Conv.pl" Can't locate Carp/Always.pm in @INC (@INC contains: F:/Dwimperl/perl/s +ite/lib F:/Dwimperl/perl/vendor/lib F:/Dwimperl/perl/lib .) at Utilit +ies.pm line 33. BEGIN failed--compilation aborted at Utilities.pm line 33. Compilation failed in require at Conv.pl line 12. BEGIN failed--compilation aborted at Conv.pl line 12.

        Carp::Always is a different module to Carp.

        perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

      The problem seems to be around here.

      Nope, using the wrong make is the problem

      DWIMPerl (a StrawberryPerl) generally comes with dmake,  perl -V:make

        Can you please be a bit mode specific (verbose) how to use dmake? I am a (relative) newbie.
Re: Problem installing Carp-1.25 under DWIM Perl
by bojinlund (Monsignor) on May 21, 2012 at 09:53 UTC

    I had a similar problem see Ideas on more foolproof Makefile.PL and generated Makefile.

    Realized after some days, when I saw  # dmake expands {{ to { and }} to }. in the file perl/lib/ExtUtils/MM_Win32.pm that I should have used dmake!!

    Using wrong make program in Windows often results in difficult to interpret error messages. The time to find the real problem (using wrong makefile program) is often long.

    I have proposed (with no success) to make the makefile generated by ExtUtils::MakeMaker more foolprof by:

    1. Add information about usage in the header of the generated makefiles. Something like:
      # Typical usage: # perl Makefile.PL # dmake # dmake test # dmake install
    2. If the makefile is used by the wrong make program generate an error message or other noise, so it is “impossible” to be foolish.

      I have proposed (with no success)

      Where did you propose?

        I have sent the following patch to the maintainer of ExtUtils-MakeMaker

        diff -u -r t:/makeMaker/ExtUtils-MakeMaker-6.62/lib/ExtUtils/MakeMaker +.pm t:/makeMaker/ExtUtils-MakeMaker-modified/lib/ExtUtils/MakeMaker.pm --- t:/makeMaker/ExtUtils-MakeMaker-6.62/lib/ExtUtils/MakeMaker.pm 2012-04-01 09:02:31.450034700 +0200 +++ t:/makeMaker/ExtUtils-MakeMaker-modified/lib/ExtUtils/MakeMaker.pm 2012-04-01 09:03:05.508694300 +0200 @@ -620,17 +620,13 @@ $argv =~ s/^\[/(/; $argv =~ s/\]$/)/; + push @{$self->{RESULT}}, $self->makefile_head; push @{$self->{RESULT}}, <<END; -# This Makefile is for the $self->{NAME} extension to perl. -# -# It was generated automatically by MakeMaker version +# This file was generated automatically by MakeMaker version # $VERSION (Revision: $Revision) from the contents of # Makefile.PL. Don't edit this file, edit Makefile.PL instead. # -# ANY CHANGES MADE HERE WILL BE LOST! -# # MakeMaker ARGV: $argv -# END push @{$self->{RESULT}}, $self->_MakeMaker_Parameters_section(\%initial_att); diff -u -r t:/makeMaker/ExtUtils-MakeMaker-6.62/lib/ExtUtils/MM_Any.pm t:/makeMaker/ExtUtils-MakeMaker-modified/lib/ExtUtils/MM_Any.pm --- t:/makeMaker/ExtUtils-MakeMaker-6.62/lib/ExtUtils/MM_Any.pm 201 +2-04-01 09:05:27.800943800 +0200 +++ t:/makeMaker/ExtUtils-MakeMaker-modified/lib/ExtUtils/MM_Any.pm 2012-04-01 09:09:10.771335900 +0200 @@ -382,6 +382,38 @@ return $make; } +=head2 Preludes + +These are methods which produce things early in the Makefile. + + +=head3 makefile_head + +Generate the head of the Makefile. + +=cut + +sub makefile_head { + my $self = shift; + + my $target_make_program_index = $self->is_make_type('dmake')? 1 : + $self->is_make_type('nmake')? 2 : 0; + my $target_make_program = ('make', 'dmake', 'nmake')[$target_make_program_index]; + my $sudo_prefix = ('sudo ', '', '')[$target_make_program_index]; + + return <<END; +# This Makefile is for the $self->{NAME} extension to perl. +# +# DO NOT EDIT! ANY CHANGES MADE IN THIS FILE WILL BE LOST! +# +# Typical usage: +# perl Makefile.PL +# ${target_make_program} +# ${target_make_program} test +# ${sudo_prefix}${target_make_program} install +# +END +} =head2 Targets

        I have also ask for guidance where to add the following:

        1. Add these definition to (GNU)make and dmake Makefiles.
          It should be added EARLY in the Makefile.
          "Direct" call from the constructor or part of a section or a new MakeMaker section or ... ?
          # --- MakeMaker ???? section: ifeq "{xxx}" "xxx" MAKE_USED = dmake endif ifneq "$(.VARIABLES)" "" MAKE_USED = gnumake endif
        2. Add a snippet somewhere in Makefiles for nmake.
          It is a trap if other make programs are used
          !IF 0 This makefile is intended to be used by nmake !ENDIF
          Should this be a "direct" call from the constructor, a part of a section or a new MakeMaker section or ... ?
        3. Add the target check_run_conditions to the top targets
          # --- MakeMaker top_targets section: all :: check_run_conditions pure_all $(NOECHO) $(NOOP)
          Probably modification of the method all_target in MM_Any.pm and MM_Unix.pm
        4. Add the actions for target check_run_conditions
          The code will look something like:
          push @{$self->{RESULT}}, '', '# --- MakeMaker check_run_conditions section:', 'check_run_conditions ::'; if($target_make_program eq 'make'){ push @{$self->{RESULT}}, 'ifeq "$(MAKE_USED)" "dmake"', '# Note! The message is NOT sent to STDERR', ' $(NOECHO)echo ERROR: Using $(MAKE_USED) for a Makefile intended for ' .${target_make_program}, ' $(assign ERR OR = ERROR) #Generates an error message', 'endif'; } if($target_make_program eq 'dmake'){ push @{$self->{RESULT}}, 'ifeq "$(MAKE_USED)" "gnumake"', ' $(NOECHO)$(error ERROR: Using $(MAKE_USED) for a Makefile intended for ' .${target_make_program}.'.)', 'endif'; } “otherwise” { push @{$self->{RESULT}}, ' $(NOECHO) $(NOOP)'; }
          Should this be a part of a section or a new MakeMaker section or ?
        For background see also Ideas on more foolproof Makefile.PL and generated Makefile.

      Thank you for the good and detailed answer

      Helen

Re: Problem installing Carp-1.25 under DWIM Perl
by stevieb (Canon) on May 20, 2012 at 23:26 UTC

    I don't have a solution or a fix to your problem, but I just want to say that you've done a wonderful job writing this post... right down to mentioning the cross-posting.

    Cheers,

    Steve

    ps. This post is meant as a compliment and acknowledgement *only*, so please don't upvote it.

      wonderful job writing this post... right down to mentioning the cross-posting.

      Without a link, a mention isn't very useful, its work ( go find the link)

        Here you go: SO post.

        Can you not recognize that the OP at least made an attempt to inform the wider community, or are you the type of Anon poster who will find problems in everything?

        Update: If you're so inclined, why not remind us where the documentation is that states that cross-posts should be referenced with a link to the external post. That would actually be helpful.

Re: Problem installing Carp-1.25 under DWIM Perl
by Anonymous Monk on May 20, 2012 at 23:25 UTC
    And who said to use nmake?
      On Windows, you use nmake

        On Windows, you use nmake

        I'm on windows, I don't use nmake

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://971526]
Approved by stevieb
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-23 07:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found