tony-o / raku-fez

This project is for 'fez', raku's cool new shiny dist uploader & manager. If you're a module author you should definitely be using this sweet thang. ;;;;;;;;;;;;;; This project and the underlying infrastructure is supported out of my own pocket and through donations. If you'd like to donate please check here: https://www.patreon.com/oynot
Artistic License 2.0
20 stars 12 forks source link

Install fails on OpenBSD #36

Closed andinus closed 3 years ago

andinus commented 3 years ago

zef install fez fails on OpenBSD with:

andinus@hafnium ~> zef --version   
v0.11.4

andinus@hafnium ~> raku --version
Welcome to Rakudo(tm) v2021.02.1.
Implementing the Raku(tm) programming language v6.d.
Built on MoarVM version 2021.02.

andinus@hafnium ~> zef install fez
===> Searching for: fez
===> Updating fez mirror: http://360.zef.pm/
===> Updating cpan mirror: https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/cpan1.json
===> Updating p6c mirror: https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/p6c1.json
===> Updated fez mirror: http://360.zef.pm/
===> Updated p6c mirror: https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/p6c1.json
===> Updated cpan mirror: https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/cpan1.json
===> Testing: fez:ver<26>:auth<zef:tony-o>:api<0>
[fez] # Failed test 'Fez::CLI module can be use-d ok'
[fez] # at t/00-use.t line 21
[fez] # ===SORRY!=== Error while compiling /home/andinus/.zef/store/raku-fez.git/6051f281ad83d5145fb50da0fb2ec8b2dcc0b6c1/lib/Fez/CLI.rakumod (Fez::CLI)
[fez] # Unable to find a suitable handler for bundling (tried git and tar), please ensure one is in your path
[fez] # at /home/andinus/.zef/store/raku-fez.git/6051f281ad83d5145fb50da0fb2ec8b2dcc0b6c1/lib/Fez/CLI.rakumod (Fez::CLI):8
[fez] # 
[fez] # Failed test 'Fez::Bundle module can be use-d ok'
[fez] # at t/00-use.t line 21
[fez] # Unable to find a suitable handler for bundling (tried git and tar), please ensure one is in your path
[fez] # You failed 2 tests of 13
[fez] ===SORRY!=== Error while compiling /home/andinus/.zef/store/raku-fez.git/6051f281ad83d5145fb50da0fb2ec8b2dcc0b6c1/t/02-checkbuild.t
[fez] ===SORRY!=== Error while compiling /home/andinus/.zef/store/raku-fez.git/6051f281ad83d5145fb50da0fb2ec8b2dcc0b6c1/lib/Fez/CLI.rakumod (Fez::CLI)
[fez] Unable to find a suitable handler for bundling (tried git and tar), please ensure one is in your path
[fez] at /home/andinus/.zef/store/raku-fez.git/6051f281ad83d5145fb50da0fb2ec8b2dcc0b6c1/lib/Fez/CLI.rakumod (Fez::CLI):8
[fez] at /home/andinus/.zef/store/raku-fez.git/6051f281ad83d5145fb50da0fb2ec8b2dcc0b6c1/t/02-checkbuild.t:4
===> Testing [FAIL]: fez:ver<26>:auth<zef:tony-o>:api<0>
Aborting due to test failure: fez:ver<26>:auth<zef:tony-o>:api<0> (use --force-test to override)

I have both git & tar in my $PATH.

andinus@hafnium ~> which git; git --version
/usr/local/bin/git
git version 2.28.0
andinus@hafnium ~> which tar 
/bin/tar
andinus@hafnium ~> which gtar; gtar --version
/usr/local/bin/gtar
tar (GNU tar) 1.32
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
tony-o commented 3 years ago

The tar thing is curious. Do you have gzip in your path too (git relies on it for archiving).

andinus commented 3 years ago

Yes, gzip is in $PATH.

andinus@hafnium ~> which gzip
/usr/bin/gzip
andinus commented 3 years ago

From what I understand, Fez::Util::Tar will fail with .able call.

andinus@hafnium ~> tar --help
tar: unknown option -- -
usage: tar {crtux}[014578befHhjLmNOoPpqsvwXZz]
           [blocking-factor | archive | replstr] [-C directory] [-I file]
           [file ...]
       tar {-crtux} [-014578eHhjLmNOoPpqvwXZz] [-b blocking-factor]
           [-C directory] [-f archive] [-I file] [-s replstr] [file ...]

Not sure why Fez::Util::Git fails.

tony-o commented 3 years ago

Gotcha - taking me a few to get an openbsd box configured with that new of a raku (newest I'm seeing is 2018 via pkg). After that we'll get to the bottom of it

tony-o commented 3 years ago

I'm having trouble replicating this issue on a new openbsd install (6.8).

I'm imagining that Tar is failing looking for the -z flag on standard tar instead of gnu. Can you tell me what the output of this is with and without the following patch?

use Fez::Util::Tar; say Fez::Util::Tar.able;
diff --git a/lib/Fez/Util/Tar.rakumod b/lib/Fez/Util/Tar.rakumod
index a97bd28..c1ac78a 100644
--- a/lib/Fez/Util/Tar.rakumod
+++ b/lib/Fez/Util/Tar.rakumod
@@ -21,6 +21,8 @@ method ls($file) {
 }

 method able {
-  my $p = run 'tar', '--help', :out, :err;
+  my @cmd = 'tar', '--help';
+  @cmd = ('man', '-c', 'tar') if $*KERNEL.name ~~ m:i/bsd/;
+  my $p = run @cmd, :out, :err;
   $p.exitcode == 0 && $p.out.slurp.contains: '-z';
 }
andinus commented 3 years ago
> use Fez::Util::Tar; say Fez::Util::Tar.able;
True

This patch fixes it.

tony-o commented 3 years ago

@andinus before i publish version 27 of fez - can you verify that what's in master right now fixes this issue on your side?

andinus commented 3 years ago

Yes, it installs after this fix.

andinus commented 3 years ago
andinus@hafnium ~> zef install fez
[...]
===> Testing: fez:ver<27>:auth<zef:tony-o>:api<0>
[...]
===> Testing [OK] for fez:ver<27>:auth<zef:tony-o>:api<0>
===> Installing: fez:ver<27>:auth<zef:tony-o>:api<0>

1 bin/ script [fez] installed [...]

Thanks!