Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carton removes required dependency info after carton update #253

Open
KES777 opened this issue Mar 6, 2019 · 5 comments
Open

Carton removes required dependency info after carton update #253

KES777 opened this issue Mar 6, 2019 · 5 comments

Comments

@KES777
Copy link

KES777 commented Mar 6, 2019

I have next cpanfile:
cpanfile.txt

When I clone my repo locally and I have no local directory yet. The install and update installs different count of modules.

The difference between this logs:
update.txt
install.txt

is:

Imager::File::PNG is up to date. (0.94)

but in both cases I have installed local/lib/perl5/x86_64-linux/Imager/File/PNG.pm file.

The cpanfile.snapshot for both:
cpanfile.snapshot.install.txt
cpanfile.snapshot.update.txt

The most important part of this is that while update's cpanfile.snapshot does not contain info about Imager::File::PNG like 'install's cpanfile.snapshot does:

  Imager-File-PNG-0.94
    pathname: T/TO/TONYC/Imager-File-PNG-0.94.tar.gz
    provides:
      Imager::File::PNG 0.94
    requirements:
      ExtUtils::MakeMaker 0
      Imager 0.90
      XSLoader 0

Thus the deploying modules in production with --deployment option FAILS:

! Couldn't find module or a distribution Imager::File::PNG
! Installing the dependencies failed: Module 'Imager::File::PNG' is not installed
! Bailing out the installation for WWW-Mechanize-Chrome-0.28
@KES777
Copy link
Author

KES777 commented Mar 6, 2019

After carton update I found next issues whith cpanfile.snapshot:

$ carton check
Following dependencies are not satisfied.
  Imager::File::PNG is not installed. Needs 0
  Any::Moose is not installed. Needs == 0.26
Run `carton install` to install them.

$ carton install
Installing modules using /home/kes/work/projects/tucha/monkeyman/del/monkeyman-update/cpanfile
Successfully installed Any-Moose-0.26 (downgraded from 0.27)
1 distribution installed
Complete! Modules were installed into /home/kes/work/projects/tucha/monkeyman/del/monkeyman-update/local

$ carton check
Following dependencies are not satisfied.
  Imager::File::PNG is not installed. Needs 0
Run `carton install` to install them.

The difference cpanfile.snapshot after carton install with cpanfile.snapshot after carton update is next:

--- /home/kes/t/del/monkeyman-update/cpanfile.snapshot.update.txt
+++ (clipboard)
@@ -121,6 +121,17 @@
       URI 0
       URI::Escape 0
       perl 5.006
+  Any-Moose-0.26
+    pathname: E/ET/ETHER/Any-Moose-0.26.tar.gz
+    provides:
+      Any::Moose 0.26
+    requirements:
+      Carp 0
+      ExtUtils::MakeMaker 0
+      Moose 0
+      perl 5.006_002
+      strict 0
+      warnings 0
   AnyEvent-7.15
     pathname: M/ML/MLEHMANN/AnyEvent-7.15.tar.gz
     provides:

As you can see the info about installed Imager::File::PNG dependency is not added to cpanfile.snapshot.

To my mind the dependency info should be added in any case:
module is installed by current command
module detected as installed, but does not exists at dependency tree (cpanfile.snapshot)

@KES777
Copy link
Author

KES777 commented Mar 6, 2019

subsequent command just fail with error:

$ carton update
Could not find module Imager::File::PNG.

If I manually patch cpanfile.snapshot:

--- a/cpanfile.snapshot
+++ b/cpanfile.snapshot
@@ -4282,6 +4282,14 @@ DISTRIBUTIONS
       Scalar::Util 1.00
       Test::More 0.99
       XSLoader 0
+  Imager-File-PNG-0.94
+    pathname: T/TO/TONYC/Imager-File-PNG-0.94.tar.gz
+    provides:
+      Imager::File::PNG 0.94
+    requirements:
+      ExtUtils::MakeMaker 0
+      Imager 0.90
+      XSLoader 0
   Import-Into-1.002005
     pathname: H/HA/HAARG/Import-Into-1.002005.tar.gz
     provides:

I can run $ carton update which says that everything is upto date:

Capture::Tiny is up to date. (0.48)
...
PDF::WebKit is up to date. (1.2)

and removes info about Imager-File-PNG-0.94 from cpanfile.snapshot =)

@KES777 KES777 changed the title Module is not installed Carton removes required dependency info after carton update Mar 6, 2019
@KES777
Copy link
Author

KES777 commented Mar 6, 2019

The try to workaround the problem by adding requires 'Imager::File::PNG', '==0.94'; line into cpanfile does not resolve the problem. The Imager::File::PNG dependency does not appear at cpanfile.snapshot =(

@KES777
Copy link
Author

KES777 commented Mar 6, 2019

Trying to deploy install.txt snapshot cause error:

! Couldn't find module or a distribution Cpanel::JSON::XS (2.3310)
! Installing the dependencies failed: Module 'Cpanel::JSON::XS' is not installed
! Bailing out the installation for JSON-MaybeXS-1.004000.
! Installing the dependencies failed: Module 'JSON::MaybeXS' is not installed
! Bailing out the installation for DBIx-Class-InflateColumn-Serializer-0.09.

! Installing the dependencies failed: Module 'JSON::MaybeXS' is not installed
! Bailing out the installation for DBIx-Class-Migration-0.060.

! Installing the dependencies failed: Module 'DBIx::Class::Migration' is not installed, Module 'DBIx::Class::InflateColumn::Serializer' is not installed
! Bailing out the installation for /opt/monkeyman/.
Installing modules failed

@KES777
Copy link
Author

KES777 commented Mar 6, 2019

Interestig thing. When installing modules on clean machine I got next messages (I took interesting one):

Successfully installed Devel-PPPort-3.44 (upgraded from 3.32)
Successfully installed Encode-3.00 (upgraded from 2.80_01)
Successfully installed ExtUtils-MakeMaker-7.34 (upgraded from 7.10_02)
Successfully installed IO-Socket-IP-0.39 (upgraded from 0.37)
Successfully installed Scalar-List-Utils-1.50 (upgraded from 1.42_02)
Successfully installed Test-Simple-1.302162 (upgraded from 1.001014)
Imager::File::PNG is up to date. (0.94)

Notice Imager::File::PNG it is same as for update command in first post.

How to reproduce this experiment:
carton update
git add cpanfile.snapshot && git commit (this is snapshot from first post)
Try to deploy application with this new snapshot.

I think upgraded from message occur because, when dependency is going to be installed, carton does not check version from dependecy file, but just install that version that is specified at requirements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant