Skip Menu |

This queue is for tickets about the CPAN CPAN distribution.

Report information
The Basics
Id: 119925
Status: open
Priority: 0/
Queue: CPAN

People
Owner: Nobody in particular
Requestors: jnareb [...] gmail.com
Cc:
AdminCc:

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



Subject: Unquoted path in Makefile prevents installing local::lib on MS Windows
I have tried to initialize CPAN client on MS Windows (perl v5.22.1 from Git for Windows), using default values, which among others means using local::lib. Building and testing passes without problems (after installing 'make'from GnuWin32 project), but the install fails because of unquoted path containing spaces and parentheses: [...] Result: PASS HAARG/local-lib-2.000019.tar.gz '/c/Program Files (x86)/GnuWin32/bin/make.EXE' test -- OK Running make install sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `/c/Program Files (x86)/GnuWin32/bin/make.EXE install 2>&1' HAARG/local-lib-2.000019.tar.gz /c/Program Files (x86)/GnuWin32/bin/make.EXE install -- NOT OK
On Fri Jan 20 09:03:39 2017, jnareb@gmail.com wrote: Show quoted text
> I have tried to initialize CPAN client on MS Windows (perl v5.22.1 > from Git for Windows), using default values, which among others means > using local::lib. > > Building and testing passes without problems (after installing > 'make'from GnuWin32 project), but the install fails because of > unquoted path containing spaces and parentheses: > > [...] > Result: PASS > HAARG/local-lib-2.000019.tar.gz > '/c/Program Files (x86)/GnuWin32/bin/make.EXE' test -- OK > Running make install > sh: -c: line 0: syntax error near unexpected token `(' > sh: -c: line 0: `/c/Program Files (x86)/GnuWin32/bin/make.EXE install
> 2>&1'
> HAARG/local-lib-2.000019.tar.gz > /c/Program Files (x86)/GnuWin32/bin/make.EXE install -- NOT OK
This is an issue in CPAN.pm, which local::lib won't be able to fix. It will apply to all module installation, not just local::lib. For the make test phase, CPAN.pm will properly quote the command it uses. But for the make install phase, it will use the configured command verbatim, without extra quoting, because it is is meant to allow configuring things like sudo installs. There is special handling to auto-quote the install command on Windows, but it only applies to 'MSWin32' builds, not 'msys' builds. One solution would be to have CPAN.pm quote the install command when it auto-configures it. This would mostly remove the need for the OS detection, which doesn't reliably tell you if directories will have spaces anyway. Another option would be to have CPAN.pm quote the command if a -e check passes, since that is unlikely to be a sudo style command. As a workaround, at the cpan shell, you should be able to decline auto-configuration, then run: o conf make_install_make_command "'/c/Program Files (x86)/GnuWin32/bin/make.EXE'" o conf commit o conf init This will configure the install command in quoted form, then restart the auto-configuration which will allow running the local::lib bootstrap.
From: jnareb [...] gmail.com
On Tue Jan 24 06:08:41 2017, haarg wrote: Show quoted text
> This is an issue in CPAN.pm, which local::lib won't be able to fix. > It will apply to all module installation, not just local::lib.
[...] Show quoted text
> As a workaround, at the cpan shell, you should be able to decline > auto-configuration, then run: > > o conf make_install_make_command "'/c/Program Files (x86)/GnuWin32/bin/make.EXE'" > o conf commit > o conf init > > This will configure the install command in quoted form, then restart > the auto-configuration which will allow running the local::lib > bootstrap.
Thanks for the workaround. It works!