timo / json_fast

a naive imperative json parser in perl6, to evaluate performance against JSON::Tiny
Artistic License 2.0
27 stars 20 forks source link

`zef install 'JSON::Fast:ver<0.16>:auth<cpan:TIMOTIMO>'` fails to install #79

Closed patrickbkr closed 2 years ago

patrickbkr commented 2 years ago

I think the reason might be the "auth" : null, in META6.json.

lizmat commented 2 years ago

FWIW, I cannot reproduce. What version of zef are you using?

patrickbkr commented 2 years ago

@lizmat: Latest Zef as of today. Latest rakudo/nqp/moar master as of today. Is it possible that you have that version JSON::Fast already installed?

lizmat commented 2 years ago
$ zef uninstall JSON::Fast
===> Uninstalled from /Users/liz/Github/rakudo.moar/install/share/perl6/site
JSON::Fast:ver<0.17>:auth<cpan:TIMOTIMO>
JSON::Fast:ver<0.16>
LizyPro:rakudo.moar liz$ zef install 'JSON::Fast:ver<0.16>:auth<cpan:TIMOTIMO>'
===> Searching for: JSON::Fast:ver<0.16>:auth<cpan:TIMOTIMO>
===> Updating fez mirror: https://360.zef.pm/
===> Updated fez mirror: https://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 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
===> Updating rea mirror: https://raw.githubusercontent.com/Raku/REA/main/META.json
===> Updated rea mirror: https://raw.githubusercontent.com/Raku/REA/main/META.json
===> Testing: JSON::Fast:ver<0.16>
===> Testing [OK] for JSON::Fast:ver<0.16>
===> Installing: JSON::Fast:ver<0.16>
$ zef install JSON::Fast
All candidates are currently installed
No reason to proceed. Use --force-install to continue anyway
LizyPro:rakudo.moar liz$ zef upgrade JSON::Fast
===> Searching for: JSON::Fast
The following distributions will be upgraded: JSON::Fast:ver<0.17>:auth<cpan:TIMOTIMO>
===> Updating: JSON::Fast:ver<0.17>:auth<cpan:TIMOTIMO>
===> Testing: JSON::Fast:ver<0.17>:auth<cpan:TIMOTIMO>
===> Testing [OK] for JSON::Fast:ver<0.17>:auth<cpan:TIMOTIMO>
===> Installing: JSON::Fast:ver<0.17>:auth<cpan:TIMOTIMO>
lizmat commented 2 years ago

Aaah... I just realized it might be installing 0.16 from the REA (which I have enabled). The CPAN version of 0.16 erroneously does not have an auth. This has been corrected in the REA.

Could you try:

$ zef install Zef::Configuration
$ zef-configure enable rea
$ zef install 'JSON::Fast:ver<0.16>:auth<cpan:TIMOTIMO>'

?

patrickbkr commented 2 years ago

@lizmat I did and this is the output:

patrickb@~ [0]$ zef install 'JSON::Fast:ver<0.16>:auth<cpan:TIMOTIMO>'
===> Searching for: JSON::Fast:ver<0.16>:auth<cpan:TIMOTIMO>
===> Updating rea mirror: https://raw.githubusercontent.com/Raku/REA/main/META.json
===> Updated rea mirror: https://raw.githubusercontent.com/Raku/REA/main/META.json
===> Extraction: Failed to find a META6.json file for JSON::Fast:ver<0.16>:auth<cpan:TIMOTIMO> -- failure is likely
[JSON::Fast] Extracting with plugin Zef::Service::Shell::tar+{<anon|1>} aborted.
Type check failed for return value; expected IO::Path but got Any (Any)

I'm not entirely sure the error is related.

lizmat commented 2 years ago

Dann bin ich überfragt :-(

patrickbkr commented 2 years ago

It seems the filename JSON::Fast:ver%3C0.16%3E:auth%3Ccpan:TIMOTIMO%3E.tar.gz poses a problem. Trying to run tar -xzf "JSON::Fast:ver%3C0.16%3E:auth%3Ccpan:TIMOTIMO%3E.tar.gz" fails with

tar (child): Cannot connect to JSON: resolve failed

gzip: stdin: unexpected end of file
tar: Child returned status 128
tar: Error is not recoverable: exiting now

Moving that very same file to asdf.tgz and then doing the extraction makes it work.

This is

tar --version
tar (GNU tar) 1.34
Copyright (C) 2021 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.

This feels very much like a bug in tar. Even though I can't quite make myself believe that.

patrickbkr commented 2 years ago

Quoting man tar:

An archive name that has a colon in it specifies a file or device on a remote machine.  The part before the colon is taken as the machine name or IP address, and the part
              after it as the file or device pathname, e.g.:

              --file=remotehost:/dev/sr0

              An optional username can be prefixed to the hostname, placing a @ sign between them.

also

--force-local
              Archive file is local even if it has a colon.
patrickbkr commented 2 years ago

Using a path (i.e. prepending ./) instead of a filename also makes tar not try doing strange stuff. So this turns out to be a zef bug.

lizmat commented 2 years ago

OOC, why can't I reproduce this, you think?

patrickbkr commented 2 years ago

lizmat: I suspect MacOS tar behaves differently than gnu tar. Do you find a respective piece of documentation for your tar?

That's also what complicates the obvious patch. The --force-local option isn't supported by busybox and possibly/probably others.

patrickbkr commented 2 years ago

Now I'm thinking about how to platform independently prefix a filename with ./ as that seems to be the approach more tars will be compatible with...

lizmat commented 2 years ago

I guess we can close this one now.

patrickbkr commented 2 years ago

I agree.