On 2018-11-21 10:45:35, TOMGRACEY wrote:
Show quoted text> On Tue Nov 20 16:59:43 2018, SREZIC wrote:
> > On 2018-11-18 05:11:43, SREZIC wrote:
> > > It seems that the system perl (the first perl in $PATH) and not the
> > > perl currently used for building and testing the distribution is
> > > used
> > > in the test suite, causing some test scripts to fail:
> > >
> > > ...
> > > Running resume mechanism tests. Please be patient - this will take
> > > some time
> > > Can't locate Moose.pm in @INC (you may need to install the Moose
> > > module) (@INC contains: ... /etc/perl /usr/local/lib/x86_64-linux-
> > > gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-
> > > gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26
> > > /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-
> > > linux-
> > > gnu/perl-base .) at
> > > /home/cpansand/.local/share/.cpan/build/2018111802/MooseX-
> > > ConfigCascade-0.02-0/blib/lib/MooseX/ConfigCascade/Util.pm line 3.
> > > BEGIN failed--compilation aborted at
> > > /home/cpansand/.local/share/.cpan/build/2018111802/MooseX-
> > > ConfigCascade-0.02-0/blib/lib/MooseX/ConfigCascade/Util.pm line 3.
> > > Compilation failed in require at scripts/taskpipe-xtask line 4.
> > > BEGIN failed--compilation aborted at scripts/taskpipe-xtask line 4.
> > >
> > > # Failed test 'mode: id count: 1 preops: 0 specs:
> > > {"city":2,"company":2,"employee":0,"threads":1} Number of records
> > > on
> > > city table'
> > > # at t/lib/TaskPipe/TestUtils/Resume.pm line 95.
> > > # got: '0'
> > > # expected: '2'
> > > ...
> > > # Looks like you failed 108 tests of 126.
> > > t/03_single_thread_resume.t ..
> > > Dubious, test returned 108 (wstat 27648, 0x6c00)
> > > Failed 108/126 subtests
> > > ...
> > > # Looks like your test exited with 2 just after 2.
> > > t/04_plan.t ..................
> > > Dubious, test returned 2 (wstat 512, 0x200)
> > > Failed 73/73 subtests
> > >
> > >
> > > Probably somewhere $^X has to be used, or alternatively scripts
> > > already installed in blib/script called.
> >
> > Same problem with 0.07, it seems.
> >
>
> Hi Slaven
>
> Many thanks for testing this - and sorry for the trouble with repeated
> errors. In fact I think the problems with 0.06 and 0.07 were not quite
> the same. I have been working on the core threading mechanism and I
> wanted to include some optional multithreaded tests, but I mistakenly
> include config files which meant those were being kicked off
> automatically rather than being skipped if they were not selected when
> Makefile.PL was run. Hoping this is now resolved in 0.08(?) I am also
> hoping the most difficult/ugly to write tests (ie related to
> threading) are now out of the way, and with future releases it should
> be easier to extend the test framework.
> Really appreciate your help
> cheers
> Tom
Still I see the same problem with 0.08. I think the problem is that the two scripts in the "scripts" subdirectory have "/usr/bin/env perl" as the shebang. In my installations the system perl is before any other perl in my $PATH (and most perls are not in $PATH at all), so during tests the wrong perl will be used which does not have the required dependencies installed, hence the failures.
Attached is a patch which fixes the problem on my system (tested with perl 5.28.0 on a debian/stretch system). However the patch needs more polishing (e.g. maybe for Windows?). What it does is:
* Change the shebang of the two scripts to something which contains "perl" in the first component (and not "env"). This way the currently used perl will be replaced into the shebang for the final installation. There's a long-standing issue to make this replacement even for /usr/bin/env (see
https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/58 ) but unfortunately it is not done yet.
* The test library calls the scripts now from "blib/script", not from "scripts". In "blib/script" the final version of the scripts with the corrected shebang is already available.
Regards,
Slaven