perl-carton / carton Goto Github PK
View Code? Open in Web Editor NEWBundler or pip freeze for Perl
Home Page: http://search.cpan.org/dist/carton
License: Other
Bundler or pip freeze for Perl
Home Page: http://search.cpan.org/dist/carton
License: Other
I attempted to use carton with a working cpanm with Strawberry Perl on Windows. It failed with this error
carton install
Installing modules using Makefile.PL
'-' is not recognized as an internal or external command,
operable program or batch file.
Usage: cpanm [options] Module [...]
Try `cpanm --help` or `man cpanm` for more options.
Installing modules failed
Miyagawa on IRC says carton doesn't yet work with Windows.
I'm not much of a Perl hacker, but I'd like to help make carton work with at least Strawberry Perl. For Miyagawa: is it doable? If so, how much effort would be required?
For example, see the following session:
ollie@deimos ~ % mkdir -p tmp
ollie@deimos ~ % cd tmp
ollie@deimos ~/tmp % mkdir -p a a\ 2
ollie@deimos ~/tmp % ls
a a 2
ollie@deimos ~/tmp % cd a\ 2
ollie@deimos ~/tmp/a 2 % carton install aliased
zsh: correct 'carton' to 'cron' [nyae]? n
Installing modules from the command line
Successfully installed aliased-0.30
1 distribution installed
Complete! Modules were installed into local
ollie@deimos ~/tmp/a 2 % ls
carton.lock
ollie@deimos ~/tmp/a 2 % cd ..
ollie@deimos ~/tmp % ls a
lib
ollie@deimos ~/tmp % ls a/lib
perl5
ollie@deimos ~/tmp % find .
.
./a
./a/lib
./a/lib/perl5
./a/lib/perl5/i686-linux-thread-multi
./a/lib/perl5/i686-linux-thread-multi/auto
./a/lib/perl5/i686-linux-thread-multi/auto/aliased
./a/lib/perl5/i686-linux-thread-multi/auto/aliased/.packlist
./a/lib/perl5/i686-linux-thread-multi/.meta
./a/lib/perl5/i686-linux-thread-multi/.meta/aliased-0.30
./a/lib/perl5/i686-linux-thread-multi/.meta/aliased-0.30/install.json
./a/lib/perl5/i686-linux-thread-multi/.meta/aliased-0.30/MYMETA.json
./a/lib/perl5/aliased.pm
./a 2
./a 2/.carton
./a 2/carton.lock
Things have been installed into a
, when they really should have gone into a 2/local
Context:
https://rt.cpan.org/Public/Bug/Display.html?id=83141
miyagawa/cpanminus#194
There are modules on CPAN that provide a bad NAME field in META files that do not correspond to the .pm files, which would let carton create a bad 02packages because of that.
We may have to work around this.
$ carton install URI~1.51
Installing modules from the command line
Successfully installed ExtUtils-MakeMaker-6.62 (upgraded from 6.30)
Successfully installed ExtUtils-Install-1.54 (upgraded from 1.33)
Successfully installed URI-1.60
3 distributions installed
Complete! Modules were installed into local
Is it cpanminus' issue?
The latest version in cpan throws error on running
carton check
load_file() requires a valid, readable filename at /home/shared/perl5/lib/perl5/Carton.pm line 319
If you have
requires 'Plack';
requires 'Starman';
and run carton install
, and then later deleting Starman will remove Plack as well, unless Plack is in the other dependencies tree. Because it is specified in Makefile.PL, it should not be deleted.
carton CPAN version: v0.9.4
If my make file had:
require 'Plack';
It would not install, because it couldn't find Net::FTP, adding
require 'Net::FTP';
before it made it work fine.
=== This is what was in the build.log ===
--> Working on LWP::UserAgent
Fetching http://cpan.metacpan.org/authors/id/G/GA/GAAS/libwww-perl-6.04.tar.gz
-> OK
Unpacking libwww-perl-6.04.tar.gz
Entering libwww-perl-6.04
Checking configure dependencies from META.yml
Checking if you have ExtUtils::MakeMaker 0 ... Yes (6.62)
Configuring libwww-perl-6.04
Running Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for LWP
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::MakeMaker 0 ... Yes (6.62)
Checking if you have URI::Escape 0 ... Yes (3.31)
Checking if you have LWP::MediaTypes 6 ... Yes (6.02)
Checking if you have Encode::Locale 0 ... Yes (1.03)
Checking if you have HTTP::Status 6 ... Yes (6.03)
Checking if you have HTTP::Negotiate 6 ... Yes (6.01)
Checking if you have File::Listing 6 ... Yes (6.04)
Checking if you have Encode 2.12 ... Yes (2.44)
Checking if you have Digest::MD5 0 ... Yes (2.51)
Checking if you have HTML::Entities 0 ... Yes (3.69)
Checking if you have HTTP::Daemon 6 ... Yes (6.01)
Checking if you have Net::HTTP 6 ... Yes (6.03)
Checking if you have URI 1.10 ... Yes (1.60)
Checking if you have Net::FTP 2.58 ... No
Checking if you have HTML::HeadParser 0 ... Yes (3.69)
Checking if you have HTTP::Cookies 6 ... Yes (6.01)
Checking if you have HTTP::Date 6 ... Yes (6.02)
Checking if you have HTTP::Request::Common 6 ... Yes (6.03)
Checking if you have MIME::Base64 2.1 ... Yes (3.13)
Checking if you have HTTP::Response 6 ... Yes (6.03)
Checking if you have IO::Select 0 ... Yes (1.17)
Checking if you have IO::Socket 0 ... Yes (1.31)
Checking if you have WWW::RobotRules 6 ... Yes (6.02)
Checking if you have HTTP::Request 6 ... Yes (6.00)
==> Found dependencies: Net::FTP
Searching Net::FTP on mirror index /Users/leo/git/photoweb/.carton/02packages.details.txt ...
Searching Net::FTP on mirror http://cpan.metacpan.org ...
Found Net::FTP version 1.22 < 2.58.
-> FAIL Finding Net::FTP (2.58) on mirror http://cpan.metacpan.org failed.
Searching Net::FTP on mirror http://backpan.perl.org ...
Downloading index file http://backpan.perl.org/modules/02packages.details.txt.gz ...
Found Net::FTP version 1.0607 < 2.58.
-> FAIL Finding Net::FTP (2.58) on mirror http://backpan.perl.org failed.
-> FAIL Couldn't find module or a distribution Net::FTP (2.58)
-> FAIL Bailing out the installation for libwww-perl-6.04. Retry with --prompt or --force.
-> FAIL Bailing out the installation for Plack-0.9986. Retry with --prompt or --force.
You have ExtUtils::MakeMaker (6.62)
Tried to add https://metacpan.org/module/Net::IDN::Encode to a project and get the error:
load_file() requires a valid, readable filename at C:/Perl/site/lib/Carton.pm line 320
Debug tracing indicates that is caused by a lack of MYMETA.json.
There's a typo in the POD - "under the heavy documentation" should be "under heavy development". It also appears in the README.
Steps to reproduce:
Carton only shows help. Why does it create ".carton" folder?
It will be more logically to create folder only in case of need.
Right now the carton.lock
is created automatically from Makefile.PL
. The JSON format is more or less readable but not convenient (or meant) to edit. The following use case should be covered by carton:
You want a specific version of some module to be installed. How do you tell carton?
I ended up modifying carton.lock by hand, which is obviously not a best practice.
How about the following extension:
carton require Foo::Bar
adds Foo::Bar
to carton.lock
, just as if it was specified as dependency in Makefile.PL
.carton require Foo::Bar 1.2
adds/modifies Foo::Bar
version 1.2 or higher to carton.lock
, just as if it was specified as dependency with version number in Makefile.PL
.carton require Foo::Bar=1.2
adds/modifies Foo::Bar
version 1.2 to carton.lock
.In this repository i've recorded the steps detailing how this error manifests: https://github.com/wchristian/carton-dep-fail-demonstration/network
In short: If i have version X of a module in my local dir and that module is a dependency of another module in the carton tree, then carton will not do anything if the version of that module is changed to X+1 in carton.lock and carton install
is executed.
Looking at the code this seems to be because carton install only tries to install the modules identified by carton tree
as non-dependency modules.
I'm not sure why this is, but it's a serious problem when a module my code uses directly is also a dependency of another module used by my code. Currently the only workaround is to delete the local directory and reinstall everything to make sure updates happen.
For example, see the following:
ollie@deimos ~ % mkdir tmp
ollie@deimos ~ % cd tmp
ollie@deimos ~/tmp % carton install Locale::TextDomain
Installing modules from the command line
Successfully installed libintl-perl-1.20
1 distribution installed
Complete! Modules were installed into local
ollie@deimos ~/tmp % rm -fr local
ollie@deimos ~/tmp % carton install --deployment
Installing modules using carton.lock (deployment mode)
! Couldn't find module or a distribution libintl::perl (1.20)
Installing modules failed
Hi
Here is what I'm doing:
My Makefile.PL looks like this:
use inc::Module::Install;
name 'MyApp';
version '1.0';
requires 'Catalyst';
WriteAll;
then I run 'carton install'
I get this error:
load_file() requires a valid, readable filename at /home/dpatel/repo/Dynamite-deps/lib/perl5/Carton.pm line 320
It looks to me that Catalyst doesn't have a MYMETA.json file. This directory local/lib/perl5/x86_64-linux-gnu-thread-multi/.meta/Catalyst-Runtime-5.90004/ only contains an install.json.
Thanks
Dip
If a module's version is prefixed with 'v', eg. DBD::Pg, MooseX::Attribute::Chained, the initial install works. However, a later install for a deployment fails. cpanm does not recognize the given Module spec like "DBD::Pgv2.19.2". If the spec were "DBD::Pg2.19.2" it would work.
Version 0.9.4:
$ carton check
Deep recursion on subroutine "Carton::_check_satisfies" at /home/rr/local/lib/perl5/Carton.pm line 442.
Deep recursion on subroutine "Carton::_check_satisfies" at /home/rr/local/lib/perl5/Carton.pm line 442.
Deep recursion on subroutine "Carton::_check_satisfies" at /home/rr/local/lib/perl5/Carton.pm line 442.
Killed
Hi,
I'm trying to use Carton to manage modules on our environments. I created carton.lock file using carton --install. It was ok. Aftera that I tried to used carton --deployment to install modules on clean perl environment and it failed on a few modules. For instance, on Catalyst.
I tried to install it manually:
simoniki@antares:~/git/OCCE/perl$ carton install --path $HOME/perl5/perl5.16-common Catalyst
Installing modules from the command line
! Couldn't find module or a distribution ExtUtils::MakeMaker (6.6302)
! Bailing out the installation for Hash-MultiValue-0.12. Retry with --prompt or --force.
! Bailing out the installation for Plack-1.0006. Retry with --prompt or --force.
! Bailing out the installation for Plack-Test-ExternalServer-0.01. Retry with --prompt or --force.
! Bailing out the installation for Catalyst-Runtime-5.90016. Retry with --prompt or --force.
Installing modules failed
however, the ExtUtils::MakeMaker is already installed in proper version:
simoniki@antares:~/git/OCCE/perl$ perl -MExtUtils::MakeMaker -e 'warn $ExtUtils::MakeMaker::VERSION;'
6.6302 at -e line 1.
and
simoniki@antares:~/git/OCCE/perl$ carton install --path $HOME/perl5/perl5.16-common ExtUtils::MakeMaker
Installing modules from the command line
You have ExtUtils::MakeMaker (6.63_02)
Complete! Modules were installed into /home/simoniki/perl5/perl5.16-common
Installing Catalyst via cpanm works fine. It looks like Carton is somehow confused with version '6.63_02' and '6.6302'
I'm using Carton 0.9.4.
Is it bug in carton itself or there is something wrong in my environment?
Thanks,
Ivan
It looks like carton always fetches distributions with production-release version, even if the one with developer-release version are required. In the following example, DBD::SQLite 1.35 is installed in the local directory (instead of DBD::SQLite 1.36_01).
use strict;
use warnings;
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'Foo',
PREREQ_PM => {
'DBD::SQLite' => '1.36_01',
}
);
Will look at this at the hackathon (unless you fix this before that :)
Some of the people installed standalone version of cpanm(e.g. perlbrew install-cpanm
).
Old version of cpanm command doesn't interpret --showdeps option.
Then, old cpanm installs itself to local/ silently.
This behavior makes confusion for users. I seem carton need to check a version number of cpanm.
That way we can build a tree, then list the installation order and just pass it to cpanm.
Hi
When I run this command:
carton install --cached
I get this
Unknown option: cached
Installing modules using Makefile.PL
Usage: cpanm [options] Module [...]
Try cpanm --help
or man cpanm
for more options.
Installing modules failed
I've got the latest versions of carton and cpanm.
i could be doing something wrong let me know if so.
Thanks
Dip
Strips the module and its subtrees
If a user sets a mirror to use minicpan or private CPAN, it should be preferred over cpanmetadb (i.e. --mirror-only should be set to cpanm options).
Exit status of carton check
seems to be 0 also if modules are missing. I'd expect exit status 0 only if all dependencies are satisfied. Anyway, the actual behavior of this command should be documented.
Because the way index builder works by scanning files out of ./local, it doesn't always pick the right version for the index. It should take cpanfile deps into account first, then use the recursive search to find the right version in ./local to freeze them.
because carton internally uses cpanm's -L which could in theory create a non-deterministic tree depending on what you have in site_perl in the local machine, bundle exec on the other machine might fail if one of the modules bundled have an implicit dependency to the modules that happen to be in site_perl.
This is rare, but could happen, and running carton exec
, because it uses lib::core::only, would blow up. Turning off lib::core::only might be efficient in such cases, but it will just hide the problem than actually fixing it.
Module::Metadata can't handle versions from common::sense
Tim Bunce wrote a script to reproduce distribution list from a perl lib directory: https://github.com/timbunce/throwaway/blob/master/dist_surveyor.pl
This isn't necessary once cpanminus 1.5 is installed, but we can use this tool to recreate a carton lock file out of an existing perl lib directory (which was installed using cpanm < 1.5 or other CPAN clients).
Using carton v0.9.3 from CPAN.
If you have Gearman::Worker as a dependency, Cartoon fails to install.
Try this simple Makefile.PL:
use inc::Module::Install 0.91;
name 'Test';
abstract 'Test system';
author 'Pedro Melo <[email protected]>';
version '1.0';
license 'artistic';
# Specific dependencies
requires 'Gearman::Worker' => 0;
WriteAll;
The first time you run carton install
, it works just fine and creates a proper carton.lock
file. The second time you run carton install
, Carton tries to install the Gearman
module, but there is no such module.
My cpanfile
has only this record:
requires 'Mojolicious', '2.59';
But carton install Mojolicious 3.57 (the latest at this moment).
I'm use carton-v0.9_7.
Generated a rather large carton.lock for a project and upon calling carton.lock elsewhere I'm seeing invalid utf-8 errors:
Can't parse carton.lock: malformed UTF-8 character in JSON string, at character offset 194627 (before "\x{1b29e0}Walter <jw...") at /home/bamboo/perl5/perlbrew/perls/perl-5.14.2-carton/lib/site_perl/5.14.2/Carton/Util.pm line 21.
Coming from Jörg Walter, the author of Crypt::GeneratePassword.
I develop on windows and deploy on linux, which means that when i change the carton.lock file, the whole thing gets changed a lot, because doing so on windows results in \ separators, while on linux they all get replaced with / separators.
I'm not sure whether it's worth digging into and what the intended behavior is. Thoughts?
Due to this commit carton can no longer find the meta files and carton.lock ends up empty.
if carton.lock exists we use it to run with --index option, that will automatically bypass the cpanmetadb, and ends up loading 02packages from cpantesters.
Running Perl 5.10.1 and carton 0.9_7
It appears the way that the carton.lock
file is written and parsed my expose dependency errors in packages in fatal ways. In this case it looks like some sort of dependency issue with Net::OAuth and/or it's dependencies that gets triggered by how the carton.lock
file is written and then parsed on subsequent carton install
runs.
cpanfile:
requires 'Net::OAuth';
Running carton install
with no carton.lock
file works. (Installs 40 modules for me)
However, taking the cpanfile and carton.lock
file it creates to a new location, and carton install
fails:
Installing modules using cpanfile
Successfully installed JSON-PP-2.27200
Successfully installed CPAN-Meta-YAML-0.008
Successfully installed Parse-CPAN-Meta-1.4404 (upgraded from 1.39)
Successfully installed version-0.9901 (upgraded from 0.77)
Successfully installed Module-Metadata-1.000011
Successfully installed CPAN-Meta-Requirements-2.122
Successfully installed CPAN-Meta-2.120921
Successfully installed Perl-OSType-1.002
Successfully installed ExtUtils-CBuilder-0.280205 (upgraded from 0.2602)
Successfully installed ExtUtils-ParseXS-3.18 (upgraded from 2.2002)
Successfully installed Module-Build-0.4003 (upgraded from 0.340201)
Successfully installed Sub-Uplevel-0.24
Successfully installed Test-Simple-0.98 (upgraded from 0.92)
Successfully installed Test-Pod-1.45
Successfully installed Tree-DAG_Node-1.09
Successfully installed Carp-1.26 (upgraded from 1.11)
Successfully installed Test-Warn-0.24
! Couldn't find module or a distribution URI::Escape (3.28)
Successfully installed Digest-SHA1-2.13
Successfully installed Class-Accessor-0.34
Successfully installed Digest-HMAC-1.03
Successfully installed LWP-MediaTypes-6.02
Successfully installed Encode-Locale-1.03
Successfully installed IO-HTML-0.04
Successfully installed URI-1.60
Successfully installed HTTP-Date-6.02
Successfully installed Compress-Raw-Bzip2-2.060 (upgraded from 2.020)
Successfully installed Compress-Raw-Zlib-2.060 (upgraded from 2.020)
Successfully installed IO-Compress-2.060 (upgraded from 2.020)
Successfully installed HTTP-Message-6.06
Successfully installed HTTP-Negotiate-6.01
Successfully installed File-Listing-6.04
Successfully installed HTML-Tagset-3.20
Successfully installed HTML-Parser-3.69
Successfully installed HTTP-Daemon-6.01
Successfully installed Net-HTTP-6.05
Successfully installed HTTP-Cookies-6.01
Successfully installed WWW-RobotRules-6.02
Successfully installed libwww-perl-6.04
Successfully installed Class-Data-Inheritable-0.08
! Bailing out the installation for Net-OAuth-0.28. Retry with --prompt or --force.
39 distributions installed
Installing modules failed
Running carton install
again will then succeed:
Installing modules using cpanfile
Successfully installed Net-OAuth-0.28
1 distribution installed
Complete! Modules were installed into local
If I update the cpanfile
to require URI first, the issue goes away:
requires 'URI';
requires 'Net::OAuth';
This will create a carton.lock
file that will always succeed on carton install
.
This may be related to Issue #55 as the behavior there looks similar...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.