Skip Menu |

This queue is for tickets about the Dist-Zilla-Plugin-DynamicPrereqs CPAN distribution.

Report information
The Basics
Id: 131185
Status: resolved
Priority: 0/
Queue: Dist-Zilla-Plugin-DynamicPrereqs

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

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



Subject: Test fails with nmake (Visual C++ build of Perl)
Looks like the test suite is expecting no make output, but nmake prints out a copyright message unless the /nolog or -nologo argument is used. It's not clear to me if there is a good way to get the $tzil instance to use this option. F:\dev\Dist-Zilla-Plugin-DynamicPrereqs>prove -l Note: Cannot run tests in color: Can't locate Win32/Console/ANSI.pm t\01-basic.t .................... 6/? # Failed test 'running Makefile.PL did not produce warnings' # at t/lib/Helper.pm line 24. # got: ' # Microsoft (R) Program Maintenance Utility Version 14.24.28314.0 # Copyright (C) Microsoft Corporation. All rights reserved. # # ' # expected: '' # got log messages: [ # '[DZ] beginning to build DZT-Sample', # '[GatherDir] considering .', # '[GatherDir] considering dist.ini', # '[GatherDir] considering lib', # '[GatherDir] considering lib/Foo.pm', # '[GatherDir] adding file dist.ini', # '[GatherDir] adding file lib/Foo.pm', # '[MetaJSON] adding file META.json', # '[MakeMaker] adding file Makefile.PL', # '[DynamicPrereqs] Inserting dynamic prereq into Makefile.PL...', # '[MakeMaker] updating contents of Makefile.PL in memory', # '[DZ] writing DZT-Sample in F:/dev/Dist-Zilla-Plugin-DynamicPrereqs/tmp/hnWi9xBJ6M/build', # '[MakeMaker::Runner] running D:\\lang\\perl\\vc\\x64\\v5.31.6\\bin\\perl.exe Makefile.PL', # '[MakeMaker::Runner] running nmake' # ] # Looks like you failed 1 test of 8. t\01-basic.t .................... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/8 subtests ...etc
On 2019-12-16 09:57:26, PLICEASE wrote: Show quoted text
> Looks like the test suite is expecting no make output, but nmake > prints out a copyright message unless the /nolog or -nologo argument > is used. It's not clear to me if there is a good way to get the $tzil > instance to use this option.
It's too bad the copyright information is printed to stderr, not stdout -- as only stderr is tested for here. 'make' is run inside Dist::Zilla::Plugin::MakeMaker::Runner::build and ::test, using the path in the 'make_path' attribute (which can be passed to the MakeMaker plugin), defaulting to $Config{make}. While the build sub could handle 'make_path = nmake -nologo', since it calls system() with just one argument, the test sub cannot, as it calls system() with more than one argument and therefore 'nmake -nologo' would be treated as the full executable, with the whitespace not parsed by the shell. (Or perhaps I'm wrong and windows would handle this?) There is no other facility for passing in arguments to the make executable in MakeMaker. Could you try setting $Config{make} to 'nmake -nologo' and see what happens?
On Thu Dec 19 17:36:53 2019, ETHER wrote: Show quoted text
> It's too bad the copyright information is printed to stderr, not > stdout -- as only stderr is tested for here. > > 'make' is run inside Dist::Zilla::Plugin::MakeMaker::Runner::build and > ::test, using the path in the 'make_path' attribute (which can be > passed to the MakeMaker plugin), defaulting to $Config{make}. While > the build sub could handle 'make_path = nmake -nologo', since it calls > system() with just one argument, the test sub cannot, as it calls > system() with more than one argument and therefore 'nmake -nologo' > would be treated as the full executable, with the whitespace not > parsed by the shell. (Or perhaps I'm wrong and windows would handle > this?) There is no other facility for passing in arguments to the > make executable in MakeMaker. > > Could you try setting $Config{make} to 'nmake -nologo' and see what > happens?
Yup. Interesting. It surprises me, but setting $Config{make} to 'nmake -nologo' does work for the test: Show quoted text
>prove -lvm t\01-basic.t
Note: Cannot run tests in color: Can't locate Win32/Console/ANSI.pm t\01-basic.t .. ok 1 - build proceeds normally ok 2 - dynamic_config set to 1 in metadata; static prereqs are in place ok 3 - Makefile.PL created ok 4 - no trailing whitespace in modified file ok 5 - code inserted into Makefile.PL generated by [MakeMaker] # Generating a nmake-style Makefile # Writing Makefile for DZT::Sample # Writing MYMETA.yml and MYMETA.json # cp lib/Foo.pm blib\lib\Foo.pm ok 6 - generated Makefile.PL has no compiler errors ok 7 - running Makefile.PL did not produce warnings ok 8 - dynamic_config reset to 0 in MYMETA; dynamic prereqs have been added 1..8 ok All tests successful. Files=1, Tests=8, 3 wallclock secs ( 0.03 usr + 0.02 sys = 0.05 CPU) Result: PASS It would be nice for 'make -nologo' to be the default, but I am not sure how other tools will handle this setting.
On Mon Dec 16 12:57:26 2019, PLICEASE wrote: Show quoted text
> Looks like the test suite is expecting no make output, but nmake > prints out a copyright message unless the /nolog or -nologo argument > is used. It's not clear to me if there is a good way to get the $tzil > instance to use this option. > > F:\dev\Dist-Zilla-Plugin-DynamicPrereqs>prove -l > Note: Cannot run tests in color: Can't locate Win32/Console/ANSI.pm > t\01-basic.t .................... 6/? > # Failed test 'running Makefile.PL did not produce warnings' > # at t/lib/Helper.pm line 24. > # got: ' > # Microsoft (R) Program Maintenance Utility Version 14.24.28314.0 > # Copyright (C) Microsoft Corporation. All rights reserved. > # > # ' > # expected: '' > # got log messages: [ > # '[DZ] beginning to build DZT-Sample', > # '[GatherDir] considering .', > # '[GatherDir] considering dist.ini', > # '[GatherDir] considering lib', > # '[GatherDir] considering lib/Foo.pm', > # '[GatherDir] adding file dist.ini', > # '[GatherDir] adding file lib/Foo.pm', > # '[MetaJSON] adding file META.json', > # '[MakeMaker] adding file Makefile.PL', > # '[DynamicPrereqs] Inserting dynamic prereq into Makefile.PL...', > # '[MakeMaker] updating contents of Makefile.PL in memory', > # '[DZ] writing DZT-Sample in F:/dev/Dist-Zilla-Plugin- > DynamicPrereqs/tmp/hnWi9xBJ6M/build', > # '[MakeMaker::Runner] running > D:\\lang\\perl\\vc\\x64\\v5.31.6\\bin\\perl.exe Makefile.PL', > # '[MakeMaker::Runner] running nmake' > # ] > # Looks like you failed 1 test of 8. > t\01-basic.t .................... Dubious, test returned 1 (wstat 256, > 0x100) > Failed 1/8 subtests > > ...etc
Putting the argument into $Config{make} definitely breaks cpanm, so that fix is a non-starter. ! Can't configure the distribution. You probably need to have 'make'. See C:\Users\ollisg\.cpanm\work\1577193323.25792\build.log for details.
On 2019-12-24 05:17:18, PLICEASE wrote: Show quoted text
> > Putting the argument into $Config{make} definitely breaks cpanm, so > that fix is a non-starter. > > ! Can't configure the distribution. You probably need to have 'make'. > See C:\Users\ollisg\.cpanm\work\1577193323.25792\build.log for > details.
I found https://docs.microsoft.com/en-us/cpp/build/reference/running-nmake?view=vs-2019 -- is it possible that the options can be configured via environment variables? It's not clear whether !CMDSWITCHES can be set in code just prior to running make. If so, then the test can just set that (or possibly even Dist::Zilla::Plugin::MakeMaker itself).
On Fri Jan 24 13:44:54 2020, ETHER wrote: Show quoted text
> On 2019-12-24 05:17:18, PLICEASE wrote: > I found https://docs.microsoft.com/en-us/cpp/build/reference/running- > nmake?view=vs-2019 -- is it possible that the options can be > configured via environment variables? It's not clear whether > !CMDSWITCHES can be set in code just prior to running make. If so, > then the test can just set that (or possibly even > Dist::Zilla::Plugin::MakeMaker itself).
Ah cool I will play around with this and see if I can get something to work.
On Sat Jan 25 21:34:45 2020, PLICEASE wrote: Show quoted text
> On Fri Jan 24 13:44:54 2020, ETHER wrote:
> > On 2019-12-24 05:17:18, PLICEASE wrote: > > I found https://docs.microsoft.com/en-us/cpp/build/reference/running- > > nmake?view=vs-2019 -- is it possible that the options can be > > configured via environment variables? It's not clear whether > > !CMDSWITCHES can be set in code just prior to running make. If so, > > then the test can just set that (or possibly even > > Dist::Zilla::Plugin::MakeMaker itself).
> > Ah cool I will play around with this and see if I can get something to work.
So !CMDSWITCHES seems to unhelpfully not allow -nologo, but you CAN set it with MAKEFLAGS. I submitted a patch as https://github.com/karenetheridge/Dist-Zilla-Plugin-DynamicPrereqs/pull/2 which I tested with my latest build of VC++ Perl.