Skip Menu |

This queue is for tickets about the ExtUtils-MakeMaker CPAN distribution.

Report information
The Basics
Id: 55590
Status: resolved
Priority: 0/
Queue: ExtUtils-MakeMaker

People
Owner: ETJ [...] cpan.org
Requestors: p.j.m.vanderslot [...] utwente.nl
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 6.56
Fixed in: 7.00



Subject: Unbalanced { in generated Makefile
Running "perl Makefile.PL" generates a Makefile. Executing "make" at the commandline to run this file aborts with C:\Users\peter\opc\Physics-OPC-0.7.4>make syntax error at -e line 1, next char ) Missing right curly or square bracket at -e line 1, at end of line Execution of -e aborted due to compilation errors. make: *** [pm_to_blib] Error 255 I believe that the problem is due to unbalanced {} brackets in the generated Makefile, e.g. MOD_INSTALL = $(ABSPERLRUN) -MExtUtils::Install -e "install([ from_to => {{@ARGV}, verbose => '$(VERBINST)', uninstall_shadows => '$(UNINST)', dir_mode => '$(PERM_DIR)' ]);" -- If you search for {{ you find more occurences in the attached Makefile. Makemaker version: 6.56 Perl version: C:\Users\peter\opc\Physics-OPC-0.7.4>perl -v This is perl, v5.10.1 built for MSWin32-x64-multi-thread (with 2 registered patches, see perl -V for more detail) Copyright 1987-2009, Larry Wall Binary build 1007 [291969] provided by ActiveState http://www.ActiveState.com Built Jan 27 2010 14:12:21 Operating system: Windows 7 Ultimate 64 bit (running in a virtual machine on VMware Server 2.0, host operating system is Ubuntu 9.04 (64 bit)).
Subject: Makefile

Message body is not shown because it is too large.

Subject: Makefile.PL
use ExtUtils::MakeMaker; @names = qw/opc_optics opc_fourier opc_utils dfl2txt dfl_utils dfl_gauss opld_gen convert_opld/; @EXE = map "optics/$_", @names; @EXE = map "$_.exe", @EXE if $^O eq 'MSWin32'; %MAN = map { ("man1/$_.pod" => "blib/man1/$_.1") } @names; WriteMakefile( NAME => 'Physics::OPC', VERSION => '0.7.4', AUTHOR => 'Peter van der Slot <p.j.m.vanderslot@utwente.nld>', PREREQ_PM => { 'Carp' => 0, 'Exporter' => 0, 'File::Spec' => 0, 'POSIX' => 0, 'Env' => 0, 'IPC::Open2' => 0, }, PL_FILES => {'optics/Make.PL' => \@EXE}, EXE_FILES => \@EXE, MAN1PODS => \%MAN, clean => {FILES => "@EXE"}, );
Subject: Re: [rt.cpan.org #55590] Unbalanced { in generated Makefile
Date: Mon, 15 Mar 2010 16:44:06 -0700
To: bug-ExtUtils-MakeMaker [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
Peter van der Slot via RT wrote: Show quoted text
> Running "perl Makefile.PL" generates a Makefile. Executing "make" at > the commandline to run this file aborts with > > C:\Users\peter\opc\Physics-OPC-0.7.4>make > syntax error at -e line 1, next char ) > Missing right curly or square bracket at -e line 1, at end of line > Execution of -e aborted due to compilation errors. > make: *** [pm_to_blib] Error 255
My guess is your make is GNU make. MakeMaker will not generate a GNU compatible Makefile on Windows. It is instead dmake or nmake. According to your Makefile it is dmake (see MAKE = dmake). Try running the Makefile with dmake. If you don't already have it installed you can get a copy here. http://search.cpan.org/dist/dmake/ -- 164. There is no such thing as a were-virgin. -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army http://skippyslist.com/list/
From: p.j.m.vanderslot [...] utwente.nl
On Mon Mar 15 19:45:07 2010, schwern@pobox.com wrote: Show quoted text
> Peter van der Slot via RT wrote:
> > Running "perl Makefile.PL" generates a Makefile. Executing "make" at > > the commandline to run this file aborts with > > > > C:\Users\peter\opc\Physics-OPC-0.7.4>make > > syntax error at -e line 1, next char ) > > Missing right curly or square bracket at -e line 1, at end of line > > Execution of -e aborted due to compilation errors. > > make: *** [pm_to_blib] Error 255
> > My guess is your make is GNU make. MakeMaker will not generate a GNU > compatible Makefile on Windows. It is instead dmake or nmake. > According to > your Makefile it is dmake (see MAKE = dmake). > > Try running the Makefile with dmake. If you don't already have it > installed > you can get a copy here. > http://search.cpan.org/dist/dmake/ > >
I will do this, however trying the same using Perl V5.10.0 on Ubuntu 9.04, Mac OSX 10.6.2 and Windows XP the Makefile that is produced can be used in combination with GNU make. The version of Makemaker on Windows XP was 6.42_01 with revision 41145. I inspected the Makefile that was produced on the WinXP system and this file contained no unbalanced { } brackets. The Makemaker verion on Ubuntu 9.04 was 6.42, revision 41145. Note, if I manually adjust the mismatch in {} brackets, I can use the Makefile with GNU make. So I still have the impression that something is not right.
Subject: Re: [rt.cpan.org #55590] Unbalanced { in generated Makefile
Date: Tue, 16 Mar 2010 10:45:23 -0700
To: bug-ExtUtils-MakeMaker [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
Peter van der Slot via RT wrote: Show quoted text
> I will do this, however trying the same using Perl V5.10.0 on Ubuntu > 9.04, Mac OSX 10.6.2 and Windows XP the Makefile that is produced can be > used in combination with GNU make. The version of Makemaker on Windows > XP was 6.42_01 with revision 41145. I inspected the Makefile that was > produced on the WinXP system and this file contained no unbalanced { } > brackets. The Makemaker verion on Ubuntu 9.04 was 6.42, revision 41145. > > Note, if I manually adjust the mismatch in {} brackets, I can use the > Makefile with GNU make. So I still have the impression that something is > not right.
I assure you, this is situation normal. The issue is that dmake has a non-standard macro expansion which turns "foo/{bar baz}" into "foo/bar foo/baz" and thus curly brackets must be escaped. See http://tools.openoffice.org/dmake/dmake_4.3.html for the torrid details, specifically the end of "MACROS" and also "RUNTIME MACROS". This is specifically dealt with in ExtUtils::MM_Win32->quote_literal(). The Makefile produced on Unix systems is designed to work with GNU and BSD make as those are the most commonly available. On Windows its designed to work with either dmake or nmake as those are the most commonly available. Because there are only slight differences between what GNU make and dmake will accept, and because MakeMaker is in general VERY conservative and only uses make specific syntax when there's no other option, you might be able to get GNU make to work with some projects and some versions of MakeMaker. Its possible to reduce the number of braces used in the Makefile, for example we could quote Perl one liners with q[] instead of q{}. It would be a fairly rote job. -- Alligator sandwich, and make it snappy!
Subject: Re: [rt.cpan.org #55590] Unbalanced { in generated Makefile
Date: Tue, 16 Mar 2010 19:35:49 +0100
To: <bug-ExtUtils-MakeMaker [...] rt.cpan.org>
From: Peter van der Slot <p.j.m.vanderslot [...] utwente.nl>
Thank you for your explanation. I will have to consider my options since the software package I am writing needs to run under linux, windows and OS X. As GNU make is available for windows as well, I thought to use GNU make on all three platforms as I have a non Makemaker generated Makefile as well. To avoid problems, I have to figure out how to have Makemaker generate the other Makefile as well so that the installation becomes transparent for the various platforms. Regards, Peter On 16/03/2010 18:46, "Michael G Schwern via RT" <bug-ExtUtils-MakeMaker@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=55590 > > > Peter van der Slot via RT wrote:
>> I will do this, however trying the same using Perl V5.10.0 on Ubuntu >> 9.04, Mac OSX 10.6.2 and Windows XP the Makefile that is produced can be >> used in combination with GNU make. The version of Makemaker on Windows >> XP was 6.42_01 with revision 41145. I inspected the Makefile that was >> produced on the WinXP system and this file contained no unbalanced { } >> brackets. The Makemaker verion on Ubuntu 9.04 was 6.42, revision 41145. >> >> Note, if I manually adjust the mismatch in {} brackets, I can use the >> Makefile with GNU make. So I still have the impression that something is >> not right.
> > I assure you, this is situation normal. > > The issue is that dmake has a non-standard macro expansion which turns > "foo/{bar baz}" into "foo/bar foo/baz" and thus curly brackets must be > escaped. See http://tools.openoffice.org/dmake/dmake_4.3.html for the torrid > details, specifically the end of "MACROS" and also "RUNTIME MACROS". This is > specifically dealt with in ExtUtils::MM_Win32->quote_literal(). > > The Makefile produced on Unix systems is designed to work with GNU and BSD > make as those are the most commonly available. On Windows its designed to > work with either dmake or nmake as those are the most commonly available. > > Because there are only slight differences between what GNU make and dmake will > accept, and because MakeMaker is in general VERY conservative and only uses > make specific syntax when there's no other option, you might be able to get > GNU make to work with some projects and some versions of MakeMaker. > > Its possible to reduce the number of braces used in the Makefile, for example > we could quote Perl one liners with q[] instead of q{}. It would be a fairly > rote job. >
Subject: Re: [rt.cpan.org #55590] Unbalanced { in generated Makefile
Date: Tue, 16 Mar 2010 12:53:00 -0700
To: bug-ExtUtils-MakeMaker [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
Peter van der Slot via RT wrote: Show quoted text
> Thank you for your explanation. I will have to consider my options since the > software package I am writing needs to run under linux, windows and OS X. As > GNU make is available for windows as well, I thought to use GNU make on all > three platforms as I have a non Makemaker generated Makefile as well. > > To avoid problems, I have to figure out how to have Makemaker generate the > other Makefile as well so that the installation becomes transparent for the > various platforms.
You might try passing "MAKE => 'make'" into WriteMakefile(). MakeMaker determines what style of Makefile to write based on MAKE (or $Config{make}). This will turn off most, but not all, of the special dmake and nmake code in MakeMaker on Windows. One solution would be to just avoid the {foo} construct in your hand written Makefile, as well as any GNU-isms. Then it should work with both dmake and GNU make. Another is to patch up MakeMaker to work with GNU make on Windows. Its been on the back burner for a while, but nobody's taken a swipe at it. The welding of make variant with operating system and file system is a design flaw in MakeMaker. If it truly is another Makefile you're in trouble, MakeMaker really isn't set up to write generic Makefiles. If you're feeling bold, you can make use of various pieces of MakeMaker to handle quoting and cross platform macros. The important ones are cd(), oneliner(), quote_literal(), escape_quotes() and init_others() and tools_other(). They're all documented in ExtUtils::MM_Any and accessible through the MakeMaker object. -- 31. Not allowed to let sock puppets take responsibility for any of my actions. -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army http://skippyslist.com/list/
On Tue Mar 16 15:54:00 2010, schwern@pobox.com wrote: Show quoted text
> Another is to patch up MakeMaker to work with GNU make on Windows.
Done.