Closed waterkip closed 4 years ago
It doesn't seem possible for zef to launch prove with perl since it essentially just does prove -v -e /path/to/perl6 t/
:
https://github.com/ugexe/zef/blob/0484e30ba82f7860b785e2a1d7759379b2c78488/lib/Zef/Service/Shell/prove.pm6#L38
You might try cloning zef, adding some debug output around that spot -- maybe a say $proc.perl
to see the full command being used (sans setting up PERL6LIB) -- to see if you can golf the issue down. Run zef via perl6 -I. bin/zef install Getopt::Long --debug
(don't install zef so you can iterate on your changes without reinstalling each time)
This is funny:
$ perl6 -I. bin/zef install --debug --test Getopt::Long
===> Searching for: Getopt::Long
===> Found: Getopt::Long:ver<0.1.3> [via Zef::Repository::LocalCache]
===> Filtering: Getopt::Long:ver<0.1.3>
===> Filtering [OK] for Getopt::Long:ver<0.1.3>
===> # SKIP: No need to build Getopt::Long:ver<0.1.3>
===> Testing: Getopt::Long:ver<0.1.3>
[Getopt::Long] Testing with plugin: Zef::Service::Shell::prove+{<anon|1>}
/usr/bin/perl6 # say $*EXECUTABLE.absolute
(prove --ext .rakutest --ext .t --ext .t6 -r -e /usr/bin/perl6 t) # say $proc.cmd
[Getopt::Long] Perl v6.0.0 required--this is only v5.30.0, stopped at lib/Getopt/Long.pm line 1.
[Getopt::Long] BEGIN failed--compilation aborted at lib/Getopt/Long.pm line 1.
[Getopt::Long] Compilation failed in require at /usr/share/perl/5.30/App/Prove.pm line 9.
[Getopt::Long] BEGIN failed--compilation aborted at /usr/share/perl/5.30/App/Prove.pm line 9.
[Getopt::Long] Compilation failed in require at /usr/bin/prove line 9.
[Getopt::Long] BEGIN failed--compilation aborted at /usr/bin/prove line 9.
===> Testing [FAIL]: Getopt::Long:ver<0.1.3>
Aborting due to test failure: Getopt::Long:ver<0.1.3> (use --force-test to override)
19:03 pts/2 1 wesleys@neptune:/home/wesleys/code/zef
$ prove --ext .rakutest --ext .t --ext .t6 -r -e /usr/bin/perl6 t
t/00-load.t ....................... ok
t/build.t ......................... ok
t/distribution-depends-parsing.t .. ok
t/extract.t ....................... ok
t/fetch.t ......................... ok
t/identity.t ...................... ok
t/install.t ....................... ok
t/repository.t .................... ok
t/test.t .......................... ok
t/utils-filesystem.t .............. ok
All tests successful.
Files=10, Tests=22, 10 wallclock secs ( 0.04 usr 0.00 sys + 7.75 cusr 0.37 csys = 8.16 CPU)
Result: PASS
OK, I found the bug, but am not sure why.
I have a PERL5LIB which includes "./lib", if you run zef with this PERL5LIB, it b0rks. If I unset it, it works fine. If I have the PERL5LIB in place and I just run the command zef runs it also works fine. So.. zef is doing what exactly with the environment variable?
$ export PERL5LIB=./lib:/home/wesleys/.local/lib/perl5
19:15 pts/2 0 wesleys@neptune:/home/wesleys/code/zef
$ perl6 -I. bin/zef install --debug --test --force-install Getopt::Long
The following candidates are already installed: Getopt::Long
===> Searching for: Getopt::Long
===> Found: Getopt::Long:ver<0.1.3> [via Zef::Repository::LocalCache]
===> Filtering: Getopt::Long:ver<0.1.3>
===> Filtering [OK] for Getopt::Long:ver<0.1.3>
===> # SKIP: No need to build Getopt::Long:ver<0.1.3>
===> Testing: Getopt::Long:ver<0.1.3>
[Getopt::Long] Testing with plugin: Zef::Service::Shell::prove+{<anon|1>}
/usr/bin/perl6
(/usr/bin/prove --ext .rakutest --ext .t --ext .t6 -r -e /usr/bin/perl6 t)
[Getopt::Long] Perl v6.0.0 required--this is only v5.30.0, stopped at lib/Getopt/Long.pm line 1.
[Getopt::Long] BEGIN failed--compilation aborted at lib/Getopt/Long.pm line 1.
[Getopt::Long] Compilation failed in require at /usr/share/perl/5.30/App/Prove.pm line 9.
[Getopt::Long] BEGIN failed--compilation aborted at /usr/share/perl/5.30/App/Prove.pm line 9.
[Getopt::Long] Compilation failed in require at /usr/bin/prove line 9.
[Getopt::Long] BEGIN failed--compilation aborted at /usr/bin/prove line 9.
===> Testing [FAIL]: Getopt::Long:ver<0.1.3>
Aborting due to test failure: Getopt::Long:ver<0.1.3> (use --force-test to override)
19:15 pts/2 1 wesleys@neptune:/home/wesleys/code/zef
$ unset PERL5LIB
19:17 pts/2 0 wesleys@neptune:/home/wesleys/code/zef
$ perl6 -I. bin/zef install --debug --test --force-install Getopt::Long
The following candidates are already installed: Getopt::Long
===> Searching for: Getopt::Long
===> Found: Getopt::Long:ver<0.1.3> [via Zef::Repository::LocalCache]
===> Filtering: Getopt::Long:ver<0.1.3>
===> Filtering [OK] for Getopt::Long:ver<0.1.3>
===> # SKIP: No need to build Getopt::Long:ver<0.1.3>
===> Testing: Getopt::Long:ver<0.1.3>
[Getopt::Long] Testing with plugin: Zef::Service::Shell::prove+{<anon|1>}
/usr/bin/perl6
(/usr/bin/prove --ext .rakutest --ext .t --ext .t6 -r -e /usr/bin/perl6 t)
[Getopt::Long] t/basic.t .. ok
[Getopt::Long] All tests successful.
[Getopt::Long] Files=1, Tests=26, 0 wallclock secs ( 0.01 usr 0.00 sys + 0.60 cusr 0.04 csys = 0.65 CPU)
[Getopt::Long] Result: PASS
===> Testing [OK] for Getopt::Long:ver<0.1.3>
===> Installing: Getopt::Long:ver<0.1.3>
===> Install [OK] for Getopt::Long:ver<0.1.3>
That is strange indeed -- I would have expected prove --ext .rakutest --ext .t --ext .t6 -r -e /usr/bin/perl6 t
to fail as well... but somehow setting PERL5LIB
only breaks prove when zef invokes it (which is using the command listed earlier...)?
@Leont got any ideas?
Also note that when you used prove
directly you ran zef's tests, not Getopt::Long. I think you would need to do:
prove --ext .rakutest --ext .t --ext .t6 -r -e /usr/bin/perl6 /home/wesleys/.zef/store/Getopt-Long-0.1.3.tar.gz/Getopt-Long-0.1.3/t
Smart :) But it works
$ env | grep PERL
PERL_LOCAL_LIB_ROOT=/home/wesleys/.local
PERL_MB_OPT=--install_base '/home/wesleys/.local'
PERL_MM_OPT=INSTALL_BASE=/home/wesleys/.local
PERL5LIB=./lib:.t/lib:./t/inc:/home/wesleys/.local/lib/perl5
20:28 pts/2 0 wesleys@neptune:/home/wesleys/code/zef
$ prove --ext .rakutest --ext .t --ext .t6 -r -e /usr/bin/perl6 /home/wesleys/.zef/store/Getopt-Long-0.1.3.tar.gz/Getopt-Long-0.1.3/t
/home/wesleys/.zef/store/Getopt-Long-0.1.3.tar.gz/Getopt-Long-0.1.3/t/basic.t .. ok
All tests successful.
Files=1, Tests=26, 1 wallclock secs ( 0.02 usr 0.00 sys + 1.33 cusr 0.07 csys = 1.42 CPU)
Result: PASS
I have a PERL5LIB which includes "./lib"
Yeah, that's asking for trouble
Smart :) But it works
But it will fail if you run
prove --ext .rakutest --ext .t --ext .t6 -r -e /usr/bin/perl6 t
from the Getopt::Long directory.
@waterkip to clarify what is happening is that zef changes to the directory of Getopt::Long when running that prove command. Presumably prove uses Perl (5) Getopt::Long, so having ./lib in PERL5LIB makes prove try and load the Raku/Perl6 Getopt::Long (since in this case they share the same file extension -- .pm).
You can avoid this by using --/prove
option with zef to disable the prove plugin. In the far off future raku modules will stop using/allowing the .pm
file extension, and this issue will resolve itself.
I wanted to install App::Prove6 and when I do that I get the following error:
The behaviour can be triggered by just installing (or trying to install) Getopt::Long:
My environment looks like this: