Comments (12)
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.
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.
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.
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.
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.
➜ 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.
➜ 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.
according to @charsbar this can be "fixed" with PERL_JSON_PP_USE_B=1
from carton.
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.
according to @charsbar this can be "fixed" with
PERL_JSON_PP_USE_B=1
Yes it works!
Thanks very much.
from carton.
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.
Parse::PMFile 0.45 is now indexed.
from carton.
Related Issues (20)
- Feature request. Add --show-build-log-on-failure flag
- carton install --deployment fails HOT 2
- Missing Carton dependency Menlo-CLI-Compat-1.901800 HOT 3
- Module::Find 0.09 cannot be snapshotted or bundled HOT 1
- Error while updating HOT 1
- carton install generates empty cpanfile.snapshot when used with Docker HOT 3
- Core modules are not installed/upgraded, even if a package requires a newer version HOT 3
- perlbrew + carton: Do not hardcode version in shebang HOT 1
- cpanfile.snapshot is not created HOT 5
- Linux::Inotify2 uninstallable via "carton install --deployment" and missing from cpanfile.snapshot HOT 3
- In cpanfile.snapshot, MailTools always records the desired version AND the latest version, fails carton install --deployment HOT 6
- carton doesn't work when invoked on the filesystem root
- "carton fatpack" not working HOT 2
- How to remove a requirement? HOT 3
- Missed dependency. Carton does not bundle everything HOT 13
- Document, that `carton` requires absolute path to `local/lib/perl5` HOT 1
- A way to reuse an installed module or patch the one to be installed?
- `carton bundle` ignores --cpanfile option but respects `PERL_CARTON_CPANFILE` environment variable HOT 1
- Parsing module version of Getopt::Long 2.55 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from carton.