Perl-Toolchain-Gang/ExtUtils-MakeMaker — pull request #108 by mohawk2 (2014-07-24 09:06:44+00:00)
Title: Make EUMM pass all tests with perl in space-with-place

It was impossible to make a generally-runnable test to verify this due to the bootstrap problem. The perl I used (5.20.0) was made like this:

./Configure -de -Dprefix=/usr -Duserelocatableinc -Dinstallsitearch=.../../lib/perl5/site_perl/5.20.0/x86_64-linux -Dinstallsitelib=.../../lib/perl5/site_perl/5.20.0 -Dsitearch='.../../lib/perl5/site_perl/5.20.0/x86_64-linux' -Dsitelib='.../../lib/perl5/site_perl/5.20.0' && make && make install

I then fake-relocated it like so:

mkdir -p /tmp/space\ name/bin
cp /usr/bin/perl /tmp/space\ name/bin
ln -s /usr/lib /tmp/space\ name/lib

And then used it like so (in the repo dir):
PATH="/tmp/space name/bin:$PATH" perl Makefile.PL
PATH="/tmp/space name/bin:$PATH" make test

This all works with GNU Make 3.81, and the magic is to backslash-quote literals with spaces. This also protects them from the shell, so I undid part of my previous change. An initial experiment in backslash-quoting spaces in GNU Make 3.82 on Windows (from 5.20 Strawberry Perl) didn't work, so that will be the next step.

Observation: MM_Unix already did some $self->{$macro} s///, so the hash that comes back from WriteMakefile has the values that are written (possibly with escaping) into the Makefile, not necessarily the "real" values. I saw a few places that seem to use -e etc on $self->{} values, so there might be a problem there. If so, then the tests need to be updated to check on that (I changed t/writemakefile_args.t to "expect" escaped values). Since the return value of WriteMakefile doesn't seem to be documented, I don't see a large problem.

Once this is bedded in, the final part of this is to make it all work on Windows - this will probably involve implementing the suggestion in https://rt.cpan.org/Ticket/Display.html?id=3050