Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zef broken by Rakudo removing "backwards compatibility" in Distribution #254

Closed
Benabik opened this issue Jun 3, 2018 · 7 comments
Closed

Comments

@Benabik
Copy link

Benabik commented Jun 3, 2018

rakudo/rakudo#1820 removed things supposedly "only needed for panda compatability", but broke installing zef on my machine:

zef (master)$ sw_vers 
ProductName:    Mac OS X
ProductVersion: 10.13.4
BuildVersion:   17E202
zef (master)$ nqp --version
This is nqp version 2018.05-33-gab16b6db9 built on MoarVM version 2018.05-51-gb74c0cbb0
zef (master)$ perl6 --version
This is Rakudo version 2018.05-48-gaf645c9f4 built on MoarVM version 2018.05-51-gb74c0cbb0
implementing Perl 6.c.
zef (master)$ git rev-parse HEAD
e5005f4ecf1dc2bc2a9c1f6c607d18b36f51efbc
zef (master)$ perl6 -Ilib bin/zef install .
===SORRY!=== Error while compiling /Users/benabik/dev/perl6/zef/lib/Zef/Distribution.pm6 (Zef::Distribution)
Method 'content' must be implemented by Zef::Distribution because it is required by roles: Distribution.
at /Users/benabik/dev/perl6/zef/lib/Zef/Distribution.pm6 (Zef::Distribution):5
zef (master)$ # Install pre-PR1820 Rakudo
zef (master)$ perl6 --version
This is Rakudo version 2018.05-45-g18f9de61f built on MoarVM version 2018.05-51-gb74c0cbb0
implementing Perl 6.c.
brian@Hermes-BCG zef (master)$ perl6 -Ilib bin/zef install .
===> Testing: zef:ver<0.4.2>:auth<github:ugexe>
===> Testing [OK] for zef:ver<0.4.2>:auth<github:ugexe>
===> Installing: zef:ver<0.4.2>:auth<github:ugexe>

1 bin/ script [zef] installed to:
/usr/local/share/perl6/site/bin
@ugexe
Copy link
Owner

ugexe commented Jun 3, 2018

Great. This means zef is stuck using this same janky faux distribution classes for the foreseeable future that have to dance around the rakudo code in question.

@ugexe ugexe closed this as completed Jun 3, 2018
@bpstahlman
Copy link

I'm still getting this error when I attempt to install Raku using the instructions found here:

https://www.raku.org/downloads

Was this issue closed because a fix was made in Zef and/or Perl? When a potential user gets errors building the official package using instructions from the official site, he's likely to conclude the language isn't ready for prime time, and probably isn't going to invest much time trying to figure it out. Perl 6 is an exciting language, but it has a serious problem with market share right now, and stuff like this is likely to exacerbate the problem. I can't imagine I'm the only potential user who has encountered this issue...

Here's the error I get attempting to install zef...

1 bin/ script [zef] installed to:
/home/bstahlman/rakudo/share/perl6/site/bin
sh -c "PATH='/home/bstahlman/rakudo/bin:/home/bstahlman/anarki:/home/bstahlman/racket/bin:/home/bstahlman/.local/bin:/home/bstahlman/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/bstahlman/.fzf/bin' /usr/bin/perl tools/build/module-install.pl /home/bstahlman/rakudo/bin/perl6-m /home/bstahlman/rakudo/share/perl6/site/bin/zef-m modules/MODULES.txt"
�[31m===�[0mSORRY!�[31m===�[0m Error while compiling /home/bstahlman/rakudo-star-2019.03/home#sources/4166C19B90D62E6DB23143963A5A2C2E658CACB3 (Zef::Distribution)
Method 'content' must be implemented by Zef::Distribution because it is required by roles: Distribution.
at /home/bstahlman/rakudo-star-2019.03/home#sources/4166C19B90D62E6DB23143963A5A2C2E658CACB3 (Zef::Distribution):5

Rakudo Star has been built and installed successfully.
Please make sure that the following directories are in PATH:
  /home/bstahlman/rakudo/bin
  /home/bstahlman/rakudo/share/perl6/site/bin


Rakudo has been built and installed.

And when I attempt to run zef...

bstahlman@bstahlman-HP-EliteBook-840-G2:~$ zef --version
===SORRY!=== Error while compiling /home/bstahlman/home#sources/4166C19B90D62E6DB23143963A5A2C2E658CACB3 (Zef::Distribution)
Method 'content' must be implemented by Zef::Distribution because it is required by roles: Distribution.
at /home/bstahlman/home#sources/4166C19B90D62E6DB23143963A5A2C2E658CACB3 (Zef::Distribution):5

@ugexe
Copy link
Owner

ugexe commented Jan 17, 2020

Sadly (for you) this is user error. That error is only possible if the rakudo running zef is prior to 2019. Note the different paths in the two code blocks you posted:

/home/bstahlman/rakudo-star-2019.03/home#sources/4166C19B90D62E6DB23143963A5A2C2E658CACB3 (Zef::Distribution):5
/home/bstahlman/home#sources/4166C19B90D62E6DB23143963A5A2C2E658CACB3 (Zef::Distribution):5

In other words -- you seemingly have an old version of perl6 installed or an old version of zef.

@bpstahlman
Copy link

/home/bstahlman/home#sources/4166C19B90D62E6DB23143963A5A2C2E658CACB3
What is generating this path? It doesn't seem to correspond to anything on my system.

I removed all other versions of perl6 from my system before attempting to install.
which perl6 found nothing.
How would the failed build be using a version of perl6 that's not in my PATH?

As you can see from the following find command, all the "perl6" regular files on my system were placed there by the failed installation (for which install --prefix was set to ~/rakudo.)

bstahlman@bstahlman-HP-EliteBook-840-G2:~$ find / 2>/dev/null -iname perl6 -type f -exec file \{} \;
/home/bstahlman/rakudo/bin/perl6: POSIX shell script, ASCII text executable, with very long lines
/home/bstahlman/rakudo-star-2019.03/rakudo/perl6: POSIX shell script, ASCII text executable
/home/bstahlman/rakudo-star-2019.03/perl6: POSIX shell script, ASCII text executable, with very long lines

@ugexe
Copy link
Owner

ugexe commented Jan 17, 2020

First, lets note 8a3536a which is 2 years old. So a zef older than 2 years old must be running on a rakudo 2019+.

Thing is, whats in your PATH doesn't matter in quite the way you think. Yes, it uses the bin/zef you expect but that is just use Zef::CLI which means rakudo selects whatever version it finds appropriate. It finds this by basically selecting the highest version from the first repo/lib with any match at all. Given:

$ perl6 -e '.say for $*REPO.repo-chain'
inst#/Users/ugexe/.raku
inst#/Users/ugexe/.rakudobrew/moar-blead-master/install/share/perl6/site
inst#/Users/ugexe/.rakudobrew/moar-blead-master/install/share/perl6/vendor
inst#/Users/ugexe/.rakudobrew/moar-blead-master/install/share/perl6/core
ap#
nqp#
perl5#

inst#/Users/ugexe/.rakudobrew/moar-blead-master/install/share/perl6/site might contain the highest version of all, but if inst#/Users/ugexe/.raku has any version at all (even if its lower than the before mentioned version) it will be chosen.

I would guess /home/bstahlman/home has an old version of zef. I don't know why that path would be in your new install module paths though -- maybe you have PERL6LIB set, or maybe that is just something Rakudo Star does different than rakudo.

In my code block above this might happen with the first entry, which isn't specific to the current rakudo installation.

@bpstahlman
Copy link

$ echo $PERL6LIB

$ perl6 -e '.say for $*REPO.repo-chain'
inst#/home/bstahlman/.perl6
inst#/home/bstahlman/rakudo/share/perl6/site
inst#/home/bstahlman/rakudo/share/perl6/vendor
inst#/home/bstahlman/rakudo/share/perl6
ap#
nqp#
perl5#

Retried after removing ~/.perl6. This time, I seem to have a working perl6 and zef. So yes, I had an old installation of perl6 on my system. But I think the larger point remains... Most programmers considering giving perl6 a look won't know anything about special variables like $*REPO and weird looking paths like inst#..., ap#..., etc. They're used to doing ./configure && make && make install and having any old installation overwritten. Most of them will simply give up without making it to a github issues list or #raku chat. Perhaps a caveat regarding old installations in the FAQ or an installation troubleshooting guide would be helpful...

At any rate, I appreciate your help...

@ugexe
Copy link
Owner

ugexe commented Jan 17, 2020

Zef isn't the place for FAQs for how the Raku spec works -- we might as well instruct every module in existence to add the mentioned "caveat" for example. The problems mentioned exist with or without zef.

Even so -- when you create a new issue in zef one of the things it asks is the output of zef list --installed, after which you would have been able to solve this issue yourself -- it just so happens you didn't create a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants