Perl-Toolchain-Gang/ExtUtils-MakeMaker — pull request #160 by jrmash (2014-10-28 16:40:07+00:00)
Title: NMake/Win32 Compatibility

The latest version of EUMM introduced an interesting test failure on the Win32 platform (specifically, with nmake). The test failure is as follows:

```
t/INSTALL_BASE.t .......... 3/36
t/INSTALL_BASE.t .......... 5/36 # Failed test ' make install exited normally'
# at t/INSTALL_BASE.t line 58.
# got: '256'
# expected: '0'
# '"nmake -nologo install"' is not recognized as an internal or external command,
# operable program or batch file.

# Failed test '"Installing" in output'
# at t/INSTALL_BASE.t line 59.
# ''"nmake -nologo install"' is not recognized as an internal or external command,
# operable program or batch file.
# '
# doesn't match '(?^m:^Installing )'

# Failed test ' install dir created'
# at t/INSTALL_BASE.t line 61.

# Failed test ' ../dummy-install/lib/perl5/Big/Dummy.pm installed'
# at t/INSTALL_BASE.t line 72.

# Failed test ' ../dummy-install/lib/perl5/Big/Dummy.pm readable'
# at t/INSTALL_BASE.t line 73.

# Failed test ' ../dummy-install/lib/perl5/Big/Liar.pm installed'
# at t/INSTALL_BASE.t line 72.

# Failed test ' ../dummy-install/lib/perl5/Big/Liar.pm readable'
# at t/INSTALL_BASE.t line 73.

# Failed test ' ../dummy-install/bin/program installed'
# at t/INSTALL_BASE.t line 72.

# Failed test ' ../dummy-install/bin/program readable'
# at t/INSTALL_BASE.t line 73.

# Failed test ' ../dummy-install/lib/perl5/MSWin32-x64-multi-thread/perllocal.pod installed'
# at t/INSTALL_BASE.t line 72.

# Failed test ' ../dummy-install/lib/perl5/MSWin32-x64-multi-thread/perllocal.pod readable'
# at t/INSTALL_BASE.t line 73.

# Failed test ' ../dummy-install/lib/perl5/MSWin32-x64-multi-thread/auto/Big/Dummy/.packlist installed'
# at t/INSTALL_BASE.t line 72.

# Failed test ' ../dummy-install/lib/perl5/MSWin32-x64-multi-thread/auto/Big/Dummy/.packlist readable'
# at t/INSTALL_BASE.t line 73.

# Failed test 'realclean'
# at t/INSTALL_BASE.t line 84.
# got: '256'
# expected: '0'
# '"nmake -nologo"' is not recognized as an internal or external command,
# operable program or batch file.
t/INSTALL_BASE.t .......... 19/36
# Failed test ' make install exited normally'
t/INSTALL_BASE.t .......... 21/36 # at t/INSTALL_BASE.t line 58.
# got: '256'
# expected: '0'
# '"nmake -nologo install"' is not recognized as an internal or external command,
# operable program or batch file.

# Failed test '"Installing" in output'
# at t/INSTALL_BASE.t line 59.
# ''"nmake -nologo install"' is not recognized as an internal or external command,
# operable program or batch file.
# '
# doesn't match '(?^m:^Installing )'

# Failed test ' install dir created'
# at t/INSTALL_BASE.t line 61.

# Failed test ' ../dummy install/lib/perl5/Big/Dummy.pm installed'
# at t/INSTALL_BASE.t line 72.

# Failed test ' ../dummy install/lib/perl5/Big/Dummy.pm readable'
# at t/INSTALL_BASE.t line 73.

# Failed test ' ../dummy install/lib/perl5/Big/Liar.pm installed'
# at t/INSTALL_BASE.t line 72.

# Failed test ' ../dummy install/lib/perl5/Big/Liar.pm readable'
# at t/INSTALL_BASE.t line 73.

# Failed test ' ../dummy install/bin/program installed'
# at t/INSTALL_BASE.t line 72.

# Failed test ' ../dummy install/bin/program readable'
# at t/INSTALL_BASE.t line 73.

# Failed test ' ../dummy install/lib/perl5/MSWin32-x64-multi-thread/perllocal.pod installed'
# at t/INSTALL_BASE.t line 72.

# Failed test ' ../dummy install/lib/perl5/MSWin32-x64-multi-thread/perllocal.pod readable'
# at t/INSTALL_BASE.t line 73.

# Failed test ' ../dummy install/lib/perl5/MSWin32-x64-multi-thread/auto/Big/Dummy/.packlist installed'
# at t/INSTALL_BASE.t line 72.

# Failed test ' ../dummy install/lib/perl5/MSWin32-x64-multi-thread/auto/Big/Dummy/.packlist readable'
# at t/INSTALL_BASE.t line 73.

# Failed test 'realclean'
# at t/INSTALL_BASE.t line 84.
# got: '256'
# expected: '0'
# '"nmake -nologo"' is not recognized as an internal or external command,
# operable program or batch file.
# Looks like you failed 28 tests of 36.
t/INSTALL_BASE.t .......... Dubious, test returned 28 (wstat 7168, 0x1c00)
Failed 28/36 subtests
```

The root of the issue seems to be that the Windows shell is treating 'nmake -nologo' as the name of the binary to use (due to double-quote placement), rather than just 'nmake'. As might be expected, that binary cannot be found.

This patch moves the quote protection for the make binary to the 'make' subroutine in MakeMaker::Test::Utils instead of the 'INSTALL_BASE.t' test. I have verified this on both MSWin32-x86 and MSWin32-x64 variants of Perl 5.10.1 and 5.18.4.