Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: HEXCODER [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 6.58
Fixed in: (no value)



Subject: [patch] minimal patch for win paths with spaces
When the path to the installed perl has spaces (eg C:\Program Files\Perl\bin), perl Makefile.PL does not find its perl via find_perl() in init_PERL(). It tries to execute it, but did not quote the path before. Quoting it like "C:\Program Files\Perl\bin\perl.exe" breaks the detection of an absolute pathname in method file_name_is_absolute() later. So I quoted it like this: C:\Program" "Files\Perl\bin\perl.exe Second place to modify was in MM_Unix::constants, where the definition of CONFIGDEP is done. Both entries need to be quoted like this: CONFIGDEP = "$(PERL_ARCHLIB)$(DFSEP)Config.pm" "$(PERL_INC)$(DFSEP) config.h" This part is a bit ugly. I needed a quick fix to install modules on my box. With this patch, 'perl Makefile.PL' generates a Makefile that runs with 'nmake' and 'nmake install'. For 'nmake test' more work is needed. So it can be a start for people to build on.
Subject: min_patch_for_winpath_with_spaces.patch
--- lib/ExtUtils/MM_Unix.pm.org 2011-07-06 23:17:22.000000000 +0200 +++ lib/ExtUtils/MM_Unix.pm 2011-07-21 18:55:40.227308100 +0200 @@ -444,6 +444,11 @@ # Where is the Config information that we are using/depend on CONFIGDEP = $(PERL_ARCHLIB)$(DFSEP)Config.pm $(PERL_INC)$(DFSEP)config.h }; + # quote possible spaces for Windows + if ($Is{Win32} && 0 <= index $m[-1], ' ') { + $m[-1] =~ s{\ \$\(}{ "\$(}xmsg; + $m[-1] =~ s{\.([pmh]+)}{.$1"}xmsg; + } push @m, qq{ @@ -1033,6 +1038,11 @@ } print "Checking $abs\n" if ($trace >= 2); next unless $self->maybe_command($abs); + + # quote spaces for Windows + if ($Is{Win32} && 0 <= index $abs, ' ') { + $abs =~ s{\ }{"\ "}xmsg; + } print "Executing $abs\n" if ($trace >= 2); my $version_check = qq{$abs -le "require $ver; print qq{VER_OK}"};
Subject: Re: [rt.cpan.org #69669] [patch] minimal patch for win paths with spaces
Date: Thu, 21 Jul 2011 12:07:01 -0700
To: bug-ExtUtils-MakeMaker [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
This is an old, old, old issue with MakeMaker and one that is unlikely to really ever be fixed. The best thing to do is to not put your Perl into "Program Files", that's what most Windows Perl installers do. Otherwise you're holding back the tide. My general policy towards paths with spaces in MakeMaker is YOU'RE DOOMED because there's so many places where a space in any path will mess up the Makefile. The necessary work to make MakeMaker properly escape paths... well, you're better off writing a new build system. I kinda prefer to leave it completely and obviously broken. It may be possible to make it even more obvious with a warning if it sees that Perl is in a path with spaces.
Subject: Re: [rt.cpan.org #69669] [patch] minimal patch for win paths with spaces
Date: Thu, 21 Jul 2011 22:37:41 +0200
To: bug-ExtUtils-MakeMaker [...] rt.cpan.org
From: Heiko <heiko [...] hexco.de>
Am 21.07.2011 21:07, schrieb Michael G Schwern via RT: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=69669> > > This is an old, old, old issue with MakeMaker and one that is unlikely to > really ever be fixed. The best thing to do is to not put your Perl into > "Program Files", that's what most Windows Perl installers do. Otherwise > you're holding back the tide. > > My general policy towards paths with spaces in MakeMaker is YOU'RE DOOMED > because there's so many places where a space in any path will mess up the > Makefile. The necessary work to make MakeMaker properly escape paths... well, > you're better off writing a new build system. I kinda prefer to leave it > completely and obviously broken. It may be possible to make it even more > obvious with a warning if it sees that Perl is in a path with spaces. > >
Thanks, but I have no choice (company settings). So many CPAN modules rely on it (and don't support the alternative Module::Build), so I thought there had to be some interest in this! From the long history of EUMM, the mentioned policy has been obvious. Although, once it is fixed no one will complain, I think. I wonder, if ActiveState has a set of patches for this. It must be one of their very common problems. Thanks and best regards, hexcoder
Subject: Re: [rt.cpan.org #69669] [patch] minimal patch for win paths with spaces
Date: Fri, 22 Jul 2011 23:58:30 -0700
To: bug-ExtUtils-MakeMaker [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
On 2011.7.21 1:38 PM, Heiko via RT wrote: Show quoted text
> Thanks, but I have no choice (company settings). > > So many CPAN modules rely on it > (and don't support the alternative Module::Build), > so I thought there had to be some interest in this!
There is interest, but I reckon it would be a lot of work to actually make it work rather than just limp along. Nobody has done that work. Now, I could be wrong. It might be pretty simple. I'd very much like to be proven wrong. You can take a whack at fixing it for real. Fork the repository on Github and give it a go. Be sure to try out building some XS modules. If you can demonstrate that non-trivial modules are building, great! https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker Show quoted text
> From the long history of EUMM, the mentioned > policy has been obvious. > Although, once it is fixed no one will complain, I think. > > I wonder, if ActiveState has a set of patches for this. > It must be one of their very common problems.
ActiveState a long time ago switched their installations to C:\Perl. Strawberry Perl and every Windows Perl install I know of does so as well. I would suggest your company do the same. -- package Outer::Space; use Test::More tests => 9;
I claim this is now obsolete since a) duplicate of RT-448; b) hopefully fixed in https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/pull/105