tokuhirom / Minilla

Authorizing tool for CPAN modules
https://metacpan.org/release/Minilla
Other
97 stars 65 forks source link

Minilla may generate META.json that old JSON::PP cannot parse #299

Closed skaji closed 11 months ago

skaji commented 3 years ago

The issue

Old JSON::PP has a bug related non-ascii characters on perl 5.8, which is fixed by https://github.com/makamaka/JSON-PP/pull/9.

Because of this bug, it can happen that people cannot install "minilized" distributions.

In fact, HTTP::Entity::Parser's META.json contains non-ascii characters https://metacpan.org/source/KAZEBURO/HTTP-Entity-Parser-0.25/META.json#L99 so people may not install HTTP::Entity::Parser on perl 5.8.

Steps to reproduce the issue

# 1. prepare perl 5.8.6 or below
❯ perl -v
This is perl, v5.8.6 built for darwin-2level

# 2. download cpanm
❯ curl -s -o cpanm https://cpanmin.us

# 3. install JSON::PP that has the bug
❯ perl cpanm -nq JSON::PP@2.27203
Successfully installed ExtUtils-MakeMaker-7.56 (upgraded from 6.17)
Successfully installed JSON-PP-2.27203
2 distributions installed

# 4. try to install HTTP::Entity::Parser
❯ perl cpanm -nq HTTP::Entity::Parser
Successfully installed Test-Harness-3.42
Successfully installed Test-Simple-1.302183 (upgraded from 0.47)
...
Successfully installed Module-Build-Tiny-0.039
! Configure failed for HTTP-Entity-Parser-0.25. See /Users/skaji/.cpanm/work/1606567295.62847/build.log for details.
20 distributions installed

# 5. look at build.log
❯ tail -8 ~/.cpanm/build.log
Configuring HTTP-Entity-Parser-0.25
Running Build.PL
, or } expected while parsing object/hash, at character offset 150 (before ""generated_by" : "Mi...") at /Users/skaji/env/plenv/versions/5.8.6/lib/perl5/5.8.6/Parse/CPAN/Meta.pm line 52
 at /Users/skaji/env/plenv/versions/5.8.6/lib/perl5/5.8.6/CPAN/Meta.pm line 300
 at /Users/skaji/env/plenv/versions/5.8.6/lib/perl5/site_perl/5.8.6/Module/Build/Tiny.pm line 33
-> N/A
-> FAIL Configure failed for HTTP-Entity-Parser-0.25. See /Users/skaji/.cpanm/work/1606567295.62847/build.log for details.
20 distributions installed

What to do

Dist::Zilla now emits ascii-only META.json https://github.com/rjbs/Dist-Zilla/commit/cc9573cd8d09c642b13de0d92792098f22cfb70c Minilla can follow that.

Or, should CPAN::Meta itself emit ascii-only META.json?