Comments (12)
Updating versions in a dependency tree is a known todo item.
from carton.
Same as #3.
from carton.
Alright, would you be willing to discuss this a bit more?
As i will need to have this functionality working i'm also willing to implement what is necessary. However from looking at https://github.com/miyagawa/carton/blob/master/lib/Carton.pm#L36 it is not quote obvious why only the first children from the tree are retrieved instead of all leaves. Why is that?
from carton.
Because the tree is built by analyzing the dependencies, picking up first children is enough to pull up everything.
Version changes in the middle of tree is a separate problem - because Perl projects can't depend on multiple versions of the same module, the only solution is to depend on (and lock) the higher version. The correct approach here is to implement a command to update a locked version of a module, and also prompts you to do that if one of the new dependency you added requires a newer version of the module.
Current workaround for this is to remove carton.lock and local
directory, and rerun the whole build process, which will pull the newer version of the module from CPAN.
from carton.
Ok, so what's really missing as a first step then is the possibility to interactively update one of the locked modules, possibly by showing the user all the modules depending on it; as well as catching installs of modules that are already in carton.lock and redirecting such attempts to update.
After that a deploy install can actually go and entirely rely on the contents of carton.lock because it knows they're all meant that way.
That about right?
from carton.
i am not sure about the interactive-ness. It should catch the update of locked modules, whether it is given from a command line or as a dependency, and replace the version to the later one that satisfies the requirement, rather than adding multiple versions in the tree. I actually think the default is just go ahead and update to the newer version without prompts, unless it's told not to, since the CPAN's policy is that the latest version is always the best.
Ruby's bundler can do this better by specifying the version range (with ~>) and detect conflicts too. Perl's meta spec also have the range ability but afaik nobody uses it correctly.
from carton.
I was hoping i'd get at least some answer, but you apparently don't want to answer on irc, so maybe here: The update function, are you thinking of updating all the things to latest, only the given module to latest, or given module to given version?
Also, on rereading I realize i do not understand this bit:
picking up first children is enough to pull up everything.
When i do carton install
i expect carton to install exactly what is inside the carton.lock file. However right now it does not do that and only does a half job, making it possible for modules i explicitly declared as a dependency to be installed in newer versions than what i declared, or changes in my declarations to be ignored.
This could easily be resolved by making carton install modules by walking up the tree from the tips of branches and installing exactly what the tree demands. I don't understand what that has to do with the lack or presence of an update feature.
from carton.
The update function, are you thinking of updating all the things to latest, only the given module to latest, or given module to given version?
carton update
will update all the dependencies to the latest, and carton update Foo
will update Foo to the latest.
You don't need to specify version from the command line, since the version upper limit should be specified in the makefile or cpanfile using the Version range syntax.
When i do carton install i expect carton to install exactly what is inside the carton.lock file. However right now it does not do that and only does a half job, making it possible for modules i explicitly declared as a dependency to be installed in newer versions than what i declared, or changes in my declarations to be ignored.
If you run carton install --deployment
it should not happen since the 02packages file are recreated based on the lock file. Maybe carton install
should do the same thing.
from carton.
Duplicate of problems mentioned in other issues.
from carton.
carton update will update all the dependencies
Carton update do not update all the dependencies. It update only modules mentioned at cpanfile
$ carton update
Net::IP is up to date. (1.26)
Net::DNS is up to date. (1.15)
DBD::Pg is up to date. (3.7.4)
Modern::Perl is up to date. (1.20170117)
JSON::XS is up to date. (3.04)
Data::Printer is up to date. (0.40)
Array::Set is up to date. (0.05)
Email::Sender::Transport::SMTPS is up to date. (0.04)
Successfully installed DateTime-1.48 (upgraded from 1.46)
Test::Mojo::WithRoles is up to date. (0.02)
Successfully installed CryptX-0.060 (upgraded from 0.057)
Log::Log4perl is up to date. (1.49)
Array::Diff is up to date. (0.07)
Mojolicious is up to date. (7.71)
String::CamelCase is up to date. (0.04)
DBIx::Class::InflateColumn::Serializer is up to date. (0.09)
Net::SSLeay is up to date. (1.80)
Business::MaxMind::CreditCardFraudDetection is up to date. (1.60)
Lingua::EN::Inflect is up to date. (1.903)
Successfully installed String-ShellQuote-1.04
Successfully installed CPAN-Meta-Check-0.014
Successfully installed IPC-Run3-0.048
Successfully installed HTTP-Tinyish-0.14
Successfully installed Win32-ShellQuote-0.003001
Successfully installed local-lib-2.000024
Successfully installed File-pushd-1.014
Successfully installed ExtUtils-MakeMaker-CPANfile-0.08
Successfully installed Parse-PMFile-0.41
Successfully installed CPAN-DistnameInfo-0.12
Successfully installed Tie-Handle-Offset-0.004
Successfully installed CPAN-Common-Index-0.010
Successfully installed Menlo-1.9019
Successfully installed Menlo-Legacy-1.9021
Successfully installed Carton-v1.0.33 (upgraded from v1.0.28)
Mojolicious::Plugin::TagHelpers::Pagination is up to date. (0.06)
Successfully installed XML-Simple-2.25 (upgraded from 2.24)
Net::Domain::TLD is up to date. (1.75)
Successfully installed MaxMind-DB-Reader-XS-1.000005 (upgraded from 1.000004)
Net::Subnet is up to date. (1.03)
Successfully installed Number-Phone-3.4004 (upgraded from 3.4003)
Successfully installed GeoIP2-2.005001 (upgraded from 2.005000)
Email::Valid is up to date. (1.202)
DBIx::Class::DeploymentHandler is up to date. (0.002222)
Mojolicious::Plugin::Scrypt is up to date. (0.01)
DBIx::Class::Migration is up to date. (0.060)
DateTime::Format::Pg is up to date. (0.16013)
Module::Install is up to date. (1.19)
21 distributions installed
$ carton update
Business::MaxMind::CreditCardFraudDetection is up to date. (1.60)
Array::Diff is up to date. (0.07)
Net::Domain::TLD is up to date. (1.75)
MaxMind::DB::Reader::XS is up to date. (1.000005)
Module::Install is up to date. (1.19)
DBIx::Class::DeploymentHandler is up to date. (0.002222)
Net::IP is up to date. (1.26)
DBD::Pg is up to date. (3.7.4)
Net::SSLeay is up to date. (1.80)
Carton is up to date. (v1.0.33)
Test::Mojo::WithRoles is up to date. (0.02)
DBIx::Class::Migration is up to date. (0.060)
XML::Simple is up to date. (2.25)
Lingua::EN::Inflect is up to date. (1.903)
Mojolicious is up to date. (7.71)
Net::DNS is up to date. (1.15)
Net::Subnet is up to date. (1.03)
Modern::Perl is up to date. (1.20170117)
Mojolicious::Plugin::TagHelpers::Pagination is up to date. (0.06)
Email::Valid is up to date. (1.202)
Crypt::PRNG is up to date. (0.060)
Number::Phone is up to date. (3.4004)
GeoIP2::Database::Reader is up to date. (2.005001)
Log::Log4perl is up to date. (1.49)
Email::Sender::Transport::SMTPS is up to date. (0.04)
Data::Printer is up to date. (0.40)
Array::Set is up to date. (0.05)
DateTime is up to date. (1.48)
DateTime::Format::Pg is up to date. (0.16013)
JSON::XS is up to date. (3.04)
String::CamelCase is up to date. (0.04)
Mojolicious::Plugin::Scrypt is up to date. (0.01)
DBIx::Class::InflateColumn::Serializer is up to date. (0.09)
cpanfile.txt
snapshot before update:
cpanfile.snapshot.txt
snapshot after update:
cpanfile.snapshot.txt
As you can see it did not update List-MoreUtils-0.416
despite on 0.428 is available
from carton.
Will it be applicable to implement --all
option?
carton update --all
from carton.
carton update will update all the dependencies to the latest, and carton update Foo will update Foo to the latest.
But next fails:
$ carton update List::MoreUtils
Use of uninitialized value in concatenation (.) or string at /home/kes/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Carton/CLI.pm line 346.
! Couldn't find module or a distribution List::MoreUtils~
Updating modules failed
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
- The version number in generated install.json is a number HOT 12
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.