Giter VIP home page Giter VIP logo

Comments (12)

miyagawa avatar miyagawa commented on September 13, 2024 1

Hmm you're right I get the unquoted numbers when I run it with Carton.

BTW I get a similar issue with Carmel as well so I guess something might be wrong with the distribution. Looking into what's going on.

from carton.

miyagawa avatar miyagawa commented on September 13, 2024 1

I confirmed that JSON::PP 2.27400 works fine, but 2.92 or later fails.

cpanm bundles 2.27300 and is not affected.

from carton.

miyagawa avatar miyagawa commented on September 13, 2024

Weird. I can reproduce this with Carton and even with Carmel. However...

That's because in the generated install.json the version number is a number. So when json file is read as json, it will be treated as a float number,

Is it? The version looks to me a string in the install.json file?

➜  jq . ./lib/perl5/darwin-2level/.meta/CPAN-Audit-20240117.001/install.json | grep 2024
  "version": "20240117.001",
  "dist": "CPAN-Audit-20240117.001",
      "version": "20240117.001",
      "version": "20240117.001",
      "version": "20240117.001",
  "pathname": "B/BD/BDFOY/CPAN-Audit-20240117.001.tar.gz",

from carton.

chylli-deriv avatar chylli-deriv commented on September 13, 2024

Weird. I can reproduce this with Carton and even with Carmel.

That's because in the generated install.json the version number is a number. So when json file is read as json, it will be treated as a float number,

Is it? The version looks to me a string in the install.json file?

➜  jq . ./lib/perl5/darwin-2level/.meta/CPAN-Audit-20240117.001/install.json | grep 2024
  "version": "20240117.001",
  "dist": "CPAN-Audit-20240117.001",
      "version": "20240117.001",
      "version": "20240117.001",
      "version": "20240117.001",
  "pathname": "B/BD/BDFOY/CPAN-Audit-20240117.001.tar.gz",

here is my result:

 jq . local/lib/perl5/x86_64-linux/.meta/CPAN-Audit-20240117.001/install.json  | grep version
      "version": 1.001,
      "version": 1.001
      "version": 1.001,
      "version": 1.001,
      "version": 20240117.001,
      "version": 1.001,
      "version": 1.001,
      "version": 20240117.001
      "version": 1.001
      "version": 1.001
  "version": 20240117.001,

when I install it directly with cpanm, it will be ok:

jq . local/lib/perl5/x86_64-linux/.meta/CPAN-Audit-20240117.001/install.json  | grep version
      "version": "1.001"
      "version": "1.001"
      "version": "20240117.001"
      "version": "1.001"
      "version": "1.001"
      "version": "20240117.001",
      "version": "1.001"
      "version": "1.001"
      "version": "20240117.001"
      "version": "1.001",
      "version": "1.001"
  "version": "20240117.001",

Maybe some depended modules are too old ?

from carton.

miyagawa avatar miyagawa commented on September 13, 2024

OK, the issue is the same with Carmel, the install.json created in the blib/meta has the version number unquoted.

➜  jq . ~/.carmel/5.34.1-darwin-2level/builds/CPAN-Audit-20240117.001/blib/meta/install.json | grep version
      "version": 1.001,
      "version": 1.001,
      "version": 1.001,
      "version": 20240117.001
      "version": 20240117.001,
      "version": 1.001,
      "version": 1.001,
      "version": 1.001
      "version": 1.001,
      "version": 1.001,
  "version": 20240117.001,

Both Carton and Carmel use Menlo::Legacy to install the modules, so that must be the difference.

from carton.

miyagawa avatar miyagawa commented on September 13, 2024
➜  perl -MJSON::PP\ 11
JSON::PP version 11 required--this is only version 4.06.
BEGIN failed--compilation aborted.

cpanminus:
➜  grep VERSION fatlib/JSON/PP.pm
$JSON::PP::VERSION = '2.27300';

I reverted the version of JSON::PP to 2.27300, and now install.json contains versions as strings, and both Carmel and Carton work fine.

Will look into why this is broken with the new version of JSON::PP.

from carton.

miyagawa avatar miyagawa commented on September 13, 2024
➜  perl -MJSON::PP -MParse::PMFile -e 'my $p = Parse::PMFile->new->parse(shift); warn encode_json({ version => $p->{"JSON::PP"}{version} })' $(perldoc -lm JSON::PP)
{"version":2.92} at -e line 1.

➜  perl -MJSON::XS -MParse::PMFile -e 'my $p = Parse::PMFile->new->parse(shift); warn encode_json({ version => $p->{"JSON::PP"}{version} })' $(perldoc -lm JSON::PP)
{"version":"2.92"} at -e line 1.

with JSON::PP 2.274,

➜  perl -MJSON::PP -MParse::PMFile -e 'my $p = Parse::PMFile->new->parse(shift); warn encode_json({ version => $p->{"JSON::PP"}{version} })' $(perldoc -lm JSON::PP)
{"version":"2.27400"} at -e line 1.

from carton.

miyagawa avatar miyagawa commented on September 13, 2024

according to @charsbar this can be "fixed" with PERL_JSON_PP_USE_B=1

from carton.

miyagawa avatar miyagawa commented on September 13, 2024

The core issue though is that Parse::PMFile->parse returns the versions in numbers (version::->numify), and probably Menlo/cpanm should force strings somewhere.

from carton.

chylli-deriv avatar chylli-deriv commented on September 13, 2024

according to @charsbar this can be "fixed" with PERL_JSON_PP_USE_B=1

Yes it works!
Thanks very much.

from carton.

miyagawa avatar miyagawa commented on September 13, 2024

This is fixed in Parse-PMFile-0.45, but the module is not indexed because of a PAUSE issue andk/pause#433

so tldr, this is fixed by either:

  • pinning JSON::PP to 2.27400
  • upgrading Parse::PMFile to 0.45
  • setting environment variable PERL_JSON_PP_USE_B=1.

from carton.

miyagawa avatar miyagawa commented on September 13, 2024

Parse::PMFile 0.45 is now indexed.

from carton.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.