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

PEAR repository type does not process PEAR installer dependency #6413

Closed
glensc opened this issue May 11, 2017 · 16 comments
Closed

PEAR repository type does not process PEAR installer dependency #6413

glensc opened this issue May 11, 2017 · 16 comments
Labels
Milestone

Comments

@glensc
Copy link
Contributor

glensc commented May 11, 2017

do you consider this problem reported here something you fix,
or i just workaround and load "PEAR" in root composer.json?

eventum/eventum#256 (comment)

My composer.json:

{
        "repositories": [
                {
                        "type": "pear",
                        "url": "https://pear.php.net",
                        "vendor-alias": "pear"
                }
        ],
        "require": {
                "pear-pear.php.net/mail_mimedecode": "*"
        }
}

this does not install any variant of pear package (pear/pear, pear/pear-core-minimal, pear-pear.php.net/pear)

reproducer:
https://gist.github.com/glensc/46fe580cab09efb35b8da3f2fe9f87e3

TL;DR

pear package is fine, just seems composer does not parse this:

   <pearinstaller>
    <min>1.6.0</min>
   </pearinstaller>

as i understand, it's supposed to mean pear/pear >= 1.6.0

@alcohol
Copy link
Member

alcohol commented May 12, 2017

I am not clear on what the "problem" is..?

@glensc
Copy link
Contributor Author

glensc commented May 12, 2017

mail_mimedecode and pear/mail_mime are installed without pear/pear (any variant) being installed. the problem is that "provider": "pear" does not seem to extract such dependency altho it seems to be present in package.xml of pear package.

@alcohol
Copy link
Member

alcohol commented May 12, 2017

I honestly have no clue how the pear dependency stuff works, and your description really does not make things more clear for me I have to say. Sorry, I do not think I can help you with this. Maybe someone else has a better understanding of how pear works :-(

@glensc
Copy link
Contributor Author

glensc commented May 12, 2017

did you read the linked comment? it gives pretty detailed info (imho). i'll post step by step example in few jiffies.

@glensc
Copy link
Contributor Author

glensc commented May 12, 2017

@alcohol
Copy link
Member

alcohol commented May 12, 2017

All I understood was that some pear package does not work correctly, and as a result, https://github.com/roojs/mail_mimeDecode/ has been created, which should address the issue. I do not understand exactly what is or was wrong with the pear package though.

@alcohol
Copy link
Member

alcohol commented May 12, 2017

From your gist I am not sure how Composer is supposed to infer that there is a dependency on pear-pear.php.net/pear or pear/pear-core-minimal ?

@glensc
Copy link
Contributor Author

glensc commented May 12, 2017

from what i wrote eventum/eventum#256 (comment):

pear package is fine, just seems composer does not parse this:

   <pearinstaller>
    <min>1.6.0</min>
   </pearinstaller>

as i understand, it's supposed to mean pear/pear >= 1.6.0

@glensc
Copy link
Contributor Author

glensc commented May 12, 2017

the gist uses satis generated repo for pear. you did not read the referred comment at all it seems
eventum/eventum#256 (comment)

i'll update gist to use "repositories" "pear" directly. the test will be heavily slower but more isolated.

@alcohol
Copy link
Member

alcohol commented May 12, 2017

I glanced over the comments briefly, yes. My time is limited. They are describing another issue which I have little interest in. I was merely trying to find anything that could hint at what Composer is doing "wrong" here.

pear package is fine, just seems composer does not parse this:

...

That was the summary I was looking for, thanks.

@glensc
Copy link
Contributor Author

glensc commented May 12, 2017

(updated gist)

@alcohol
Copy link
Member

alcohol commented May 12, 2017

Peculiar, the resulting json that is generated and cached for the pear repo provider is as follows:


Click to expand/collapse

provider-pear$mail-mime.json

{
   "packages" : {
      "pear/mail_mime" : {
         "dev-gpg-20938" : {
            "include-path" : [
               "./"
            ],
            "keywords" : [],
            "homepage" : "http://pear.php.net/package/Mail_Mime",
            "authors" : [
               {
                  "role" : "Lead",
                  "name" : "Cipriano Groenendal",
                  "email" : "cipri@php.net"
               },
               {
                  "name" : "Aleksander Machniak",
                  "email" : "alec@php.net",
                  "role" : "Lead"
               }
            ],
            "autoload" : {
               "psr-0" : {
                  "Mail" : "./"
               }
            },
            "name" : "pear/mail_mime",
            "version_normalized" : "dev-gpg-20938",
            "require" : {
               "pear/pear-core-minimal" : "*"
            },
            "version" : "dev-gpg-20938",
            "uid" : 509376,
            "source" : {
               "type" : "git",
               "reference" : "7e8e7c9f18770231f296fd2a906a9606c3c26509",
               "url" : "https://github.com/pear/Mail_Mime.git"
            },
            "license" : [
               "BSD Style"
            ],
            "dist" : {
               "shasum" : "",
               "reference" : "7e8e7c9f18770231f296fd2a906a9606c3c26509",
               "url" : "https://api.github.com/repos/pear/Mail_Mime/zipball/7e8e7c9f18770231f296fd2a906a9606c3c26509",
               "type" : "zip"
            },
            "description" : "Mail_Mime provides classes to create MIME messages",
            "time" : "2015-10-20T19:45:36+00:00",
            "type" : "library"
         },
         "1.8.9" : {
            "name" : "pear/mail_mime",
            "autoload" : {
               "psr-0" : {
                  "Mail" : "./"
               }
            },
            "version_normalized" : "1.8.9.0",
            "require" : {
               "pear/pear_exception" : "*"
            },
            "version" : "1.8.9",
            "uid" : 440464,
            "include-path" : [
               "./"
            ],
            "keywords" : [],
            "require-dev" : {
               "phpunit/phpunit" : "*"
            },
            "homepage" : "",
            "authors" : [
               {
                  "role" : "Lead",
                  "name" : "Cipriano Groenendal",
                  "email" : "cipri@php.net"
               },
               {
                  "role" : "Lead",
                  "name" : "Aleksander Machniak",
                  "email" : "alec@php.net"
               }
            ],
            "description" : "More info available on: http://pear.php.net/package/Mail_Mime",
            "time" : "2014-05-14T08:27:27+00:00",
            "type" : "library",
            "source" : {
               "reference" : "407c330caf79ae36090c5ad6ed8b6fc8954d2828",
               "url" : "https://github.com/pear/Mail_Mime.git",
               "type" : "git"
            },
            "license" : [
               "BSD Style"
            ],
            "dist" : {
               "shasum" : "",
               "type" : "zip",
               "url" : "https://api.github.com/repos/pear/Mail_Mime/zipball/407c330caf79ae36090c5ad6ed8b6fc8954d2828",
               "reference" : "407c330caf79ae36090c5ad6ed8b6fc8954d2828"
            }
         },
         "1.10.0" : {
            "type" : "library",
            "time" : "2015-09-13T12:42:41+00:00",
            "description" : "Mail_Mime provides classes to create MIME messages",
            "license" : [
               "BSD Style"
            ],
            "dist" : {
               "shasum" : "",
               "reference" : "e071727cf41a4b85ecc1de210ed4fd7f4f8d1ec4",
               "url" : "https://api.github.com/repos/pear/Mail_Mime/zipball/e071727cf41a4b85ecc1de210ed4fd7f4f8d1ec4",
               "type" : "zip"
            },
            "source" : {
               "reference" : "e071727cf41a4b85ecc1de210ed4fd7f4f8d1ec4",
               "url" : "https://github.com/pear/Mail_Mime.git",
               "type" : "git"
            },
            "require" : {
               "pear/pear-core-minimal" : "*"
            },
            "version_normalized" : "1.10.0.0",
            "uid" : 525542,
            "version" : "1.10.0",
            "name" : "pear/mail_mime",
            "autoload" : {
               "psr-0" : {
                  "Mail" : "./"
               }
            },
            "homepage" : "http://pear.php.net/package/Mail_Mime",
            "authors" : [
               {
                  "name" : "Cipriano Groenendal",
                  "email" : "cipri@php.net",
                  "role" : "Lead"
               },
               {
                  "role" : "Lead",
                  "email" : "alec@php.net",
                  "name" : "Aleksander Machniak"
               }
            ],
            "keywords" : [],
            "include-path" : [
               "./"
            ]
         },
         "1.9.0" : {
            "time" : "2015-08-05T12:54:39+00:00",
            "type" : "library",
            "description" : "Mail_Mime provides classes to create MIME messages",
            "dist" : {
               "shasum" : "",
               "type" : "zip",
               "url" : "https://api.github.com/repos/pear/Mail_Mime/zipball/66b2a01acabe0b8d0ce606833d5cefc1a49a8887",
               "reference" : "66b2a01acabe0b8d0ce606833d5cefc1a49a8887"
            },
            "license" : [
               "BSD Style"
            ],
            "source" : {
               "url" : "https://github.com/pear/Mail_Mime.git",
               "reference" : "66b2a01acabe0b8d0ce606833d5cefc1a49a8887",
               "type" : "git"
            },
            "version" : "1.9.0",
            "uid" : 486120,
            "version_normalized" : "1.9.0.0",
            "require" : {
               "pear/pear-core-minimal" : "*"
            },
            "name" : "pear/mail_mime",
            "autoload" : {
               "psr-0" : {
                  "Mail" : "./"
               }
            },
            "authors" : [
               {
                  "email" : "cipri@php.net",
                  "name" : "Cipriano Groenendal",
                  "role" : "Lead"
               },
               {
                  "email" : "alec@php.net",
                  "name" : "Aleksander Machniak",
                  "role" : "Lead"
               }
            ],
            "homepage" : "http://pear.php.net/package/Mail_Mime",
            "include-path" : [
               "./"
            ],
            "keywords" : []
         },
         "dev-drop_php4" : {
            "description" : "More info available on: http://pear.php.net/package/Mail_Mime",
            "time" : "2015-06-14T09:44:21+00:00",
            "type" : "library",
            "source" : {
               "type" : "git",
               "url" : "https://github.com/pear/Mail_Mime.git",
               "reference" : "941695f10f41313c2798e402305362a12ec0252f"
            },
            "dist" : {
               "shasum" : "",
               "reference" : "941695f10f41313c2798e402305362a12ec0252f",
               "url" : "https://api.github.com/repos/pear/Mail_Mime/zipball/941695f10f41313c2798e402305362a12ec0252f",
               "type" : "zip"
            },
            "license" : [
               "BSD Style"
            ],
            "autoload" : {
               "psr-0" : {
                  "Mail" : "./"
               }
            },
            "name" : "pear/mail_mime",
            "version" : "dev-drop_php4",
            "uid" : 148626,
            "version_normalized" : "dev-drop_php4",
            "require" : {
               "pear/pear_exception" : "*"
            },
            "keywords" : [],
            "include-path" : [
               "./"
            ],
            "authors" : [
               {
                  "name" : "Cipriano Groenendal",
                  "email" : "cipri@php.net",
                  "role" : "Lead"
               },
               {
                  "role" : "Lead",
                  "email" : "alec@php.net",
                  "name" : "Aleksander Machniak"
               }
            ],
            "require-dev" : {
               "phpunit/phpunit" : "*"
            },
            "homepage" : ""
         },
         "dev-master" : {
            "autoload" : {
               "psr-0" : {
                  "Mail" : "./"
               }
            },
            "name" : "pear/mail_mime",
            "require" : {
               "pear/pear-core-minimal" : "*"
            },
            "version_normalized" : "9999999-dev",
            "uid" : 136978,
            "version" : "dev-master",
            "keywords" : [],
            "include-path" : [
               "./"
            ],
            "homepage" : "http://pear.php.net/package/Mail_Mime",
            "authors" : [
               {
                  "email" : "cipri@php.net",
                  "name" : "Cipriano Groenendal",
                  "role" : "Lead"
               },
               {
                  "role" : "Lead",
                  "email" : "alec@php.net",
                  "name" : "Aleksander Machniak"
               }
            ],
            "description" : "Mail_Mime provides classes to create MIME messages",
            "type" : "library",
            "time" : "2016-07-14T17:53:27+00:00",
            "source" : {
               "type" : "git",
               "reference" : "179235d12ac1be4b7b62b5bcba5ca09334c5f529",
               "url" : "https://github.com/pear/Mail_Mime.git"
            },
            "license" : [
               "BSD-3-clause"
            ],
            "dist" : {
               "shasum" : "",
               "type" : "zip",
               "reference" : "179235d12ac1be4b7b62b5bcba5ca09334c5f529",
               "url" : "https://api.github.com/repos/pear/Mail_Mime/zipball/179235d12ac1be4b7b62b5bcba5ca09334c5f529"
            }
         },
         "dev-travis7" : {
            "source" : {
               "type" : "git",
               "url" : "https://github.com/pear/Mail_Mime.git",
               "reference" : "94686c92483fb00289c2d1fa2ced6d47ff5d62ec"
            },
            "dist" : {
               "shasum" : "",
               "reference" : "94686c92483fb00289c2d1fa2ced6d47ff5d62ec",
               "url" : "https://api.github.com/repos/pear/Mail_Mime/zipball/94686c92483fb00289c2d1fa2ced6d47ff5d62ec",
               "type" : "zip"
            },
            "license" : [
               "BSD Style"
            ],
            "description" : "Mail_Mime provides classes to create MIME messages",
            "type" : "library",
            "time" : "2015-08-20T20:33:35+00:00",
            "include-path" : [
               "./"
            ],
            "keywords" : [],
            "authors" : [
               {
                  "role" : "Lead",
                  "email" : "cipri@php.net",
                  "name" : "Cipriano Groenendal"
               },
               {
                  "email" : "alec@php.net",
                  "name" : "Aleksander Machniak",
                  "role" : "Lead"
               }
            ],
            "homepage" : "http://pear.php.net/package/Mail_Mime",
            "autoload" : {
               "psr-0" : {
                  "Mail" : "./"
               }
            },
            "name" : "pear/mail_mime",
            "uid" : 509375,
            "version" : "dev-travis7",
            "require" : {
               "pear/pear-core-minimal" : "*"
            },
            "version_normalized" : "dev-travis7"
         }
      }
   }
}

This does seem to suggest a dependency on pear-core-minimal:

"require" : {
    "pear/pear-core-minimal" : "*"
}

Why it does not get installed nor show up when running composer show pear-pear.php.net/mail_mime I do not know.

name     : pear-pear.php.net/Mail_Mime
descrip. : Mail_Mime provides classes to deal with the creation and manipulation of MIME messages.
It allows people to create e-mail messages consisting of:
* Text Parts
* HTML Parts

* Inline HTML Images
* Attachments
* Attached messages

It supports big messages, base64 and quoted-printable encodings and
non-ASCII characters in filenames, subjects, recipients, etc. encoded
using RFC2047 and/or RFC2231.
keywords :
versions : * 1.10.0
type     : pear-library
license  : BSD Style
source   : []
dist     : [file] https://pear.php.net/get/Mail_Mime-1.10.0.tgz
names    : pear-pear.php.net/mail_mime, pear-pear/mail_mime, pear/mail_mime

autoload
classmap

include-path
/

requires
php >=5.0.0.0

replaces
pear-pear/mail_mime == 1.10.0.0
pear/mail_mime == 1.10.0.0

@alcohol alcohol added the Bug label May 12, 2017
@glensc
Copy link
Contributor Author

glensc commented May 12, 2017

pear-pear.php.net/mail_mimedecode is the package missing in packagist.

in gist i've used only pear-pear.php.net/mail_mimedecode
https://gist.github.com/glensc/46fe580cab09efb35b8da3f2fe9f87e3

(updating issue summary)

@alcohol
Copy link
Member

alcohol commented May 12, 2017

It seems that in PackageDependencyParser there is a case statement for os | pearinstaller which is basically a NOOP. This should probably be modified to make pearinstaller create a simple DependencyConstraint on pear-core-minimal (would that always be the right package?).

@glensc
Copy link
Contributor Author

glensc commented May 12, 2017

i would resolve it to "pear" type package, as packages may want real PEAR package, not the minimal version.

thus pear-pear.php.net/mail_mimedecode would get pear-pear.php.net/pear. not sure how much the "vendor-alias": "pear" plays role here.

@Seldaek Seldaek added this to the Bugs milestone Dec 19, 2017
@glensc
Copy link
Contributor Author

glensc commented May 1, 2019

I'm no longer using these PEAR packages, so it's not important for me to solve this.

closing.

@glensc glensc closed this as completed May 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants