Skip to content

Fixed dependency problem caused by pull request #3482#3493

Merged
naderman merged 1 commit intocomposer:masterfrom
spreston:master
Dec 4, 2014
Merged

Fixed dependency problem caused by pull request #3482#3493
naderman merged 1 commit intocomposer:masterfrom
spreston:master

Conversation

@spreston
Copy link
Copy Markdown
Contributor

@spreston spreston commented Dec 2, 2014

This was causing a Symfony 2.1 project to download dependencies from 2.7.

@tommygnr
Copy link
Copy Markdown

tommygnr commented Dec 2, 2014

Can you post your composer.json file that was experiencing this issue?

@spreston
Copy link
Copy Markdown
Contributor Author

spreston commented Dec 2, 2014

Mind the PhantomInstaller commands at the bottom. They reference a bundle that's in our symfony installation--not one that's included in this file.

{
    "name": "symfony/framework-standard-edition",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": {
            "": "src/"
        }
    },
    "minimum-stability": "dev",
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "startupjob/fpdf",
                "version": "master",
                "source": {
                    "url": "https://github.com/startupjob/fpdf.git",
                    "type": "git",
                    "reference": "master"
                }
            }
        },
        {
            "type": "vcs",
            "url": "[email protected]:spreston/Search-SphinxsearchBundle.git"
        }
    ],
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.1.*",
        "doctrine/orm": ">=2.2.3,<2.5-dev",
        "doctrine/doctrine-bundle": "1.1.*",
        "doctrine/collections": "1.2",
        "doctrine/doctrine-fixtures-bundle": "dev-master",
        "doctrine/data-fixtures": "dev-master",
        "twig/extensions": "1.0.1",
        "symfony/assetic-bundle": "2.1.*",
        "symfony/swiftmailer-bundle": "2.1.*",
        "symfony/monolog-bundle": "2.1.*",
        "sensio/distribution-bundle": "2.1.*",
        "sensio/framework-extra-bundle": "2.1.*",
        "sensio/generator-bundle": "2.1.*",
        "jms/security-extra-bundle": "1.2.*",
        "jms/di-extra-bundle": "1.1.*",
        "kriswallsmith/assetic": "1.1.*@dev",
        "predis/predis": "0.8.x-dev",
        "startupjob/fpdf": "*",
        "snc/redis-bundle": "1.1.5",
        "search/sphinxsearch-bundle": "dev-master",
        "coresphere/console-bundle": "*",
        "phpunit/phpunit": "3.7.*",
        "phpcr/phpcr": "2.1.0",
        "doctrine/phpcr-bundle": "1.0.0",
        "doctrine/phpcr-odm": "1.0.x-dev",
        "jackalope/jackalope-doctrine-dbal": "1.0.x-dev",
        "jackalope/jackalope": "1.0.x-dev",
        "servergrove/translation-editor-bundle": "dev-master#201fd4d528909856476eba83358b6f680d1b8a60",
        "egeloen/ckeditor-bundle": "2.*",
        "whiteoctober/breadcrumbs-bundle": "*",
        "symfony/framework-bundle": ">=2.1,<2.3-dev",
        "leafo/scssphp": "0.0.9"
    },

    "config": {
        "bin-dir": "bin"
    },
    "scripts": {
        "post-install-cmd": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "PhantomInstaller\\Installer::installPhantomJS"
        ],
        "post-update-cmd": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "PhantomInstaller\\Installer::installPhantomJS"
        ]
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "branch-alias": {
            "dev-master": "2.1-dev"
        }
    }
}

@naderman
Copy link
Copy Markdown
Member

naderman commented Dec 2, 2014

Would be great if we can turn this into an installer functional test - see https://github.com/composer/composer/tree/master/tests/Composer/Test/Fixtures/installer

Would prefer to fix this particular problem some other way if possible and not slow composer down by a fair amount again.

@tommygnr
Copy link
Copy Markdown

tommygnr commented Dec 2, 2014

I ran composer update with your composer.json file and symfony 2.1 was definitely installed. I did also get a 2.7 version of the symfony/property-access component installed. That is working as expected as it is a dependency of another package and symfony 2.1 does not provide it. (It was made available from 2.2 and up.) Can you post the output of composer show --installed

@naderman I don't believe this is a bug.

@spreston
Copy link
Copy Markdown
Contributor Author

spreston commented Dec 2, 2014

With the current version of composer with my commit

amazonwebservices/aws-sdk-for-php     dev-master 0507424 AWS SDK for PHP
coresphere/console-bundle             dev-master 6cf6090 This bundle allows you accessing the symfony2 console via your browser
cybernox/amazon-webservices-bundle    dev-master 64853f8 A Symfony2 Bundle for interfacing with Amazon Web Services (AWS)
doctrine/annotations                  dev-master 3b6668f Docblock Annotations Parser
doctrine/cache                        dev-master 85ff611 Caching library offering an object-oriented API for many cache backends
doctrine/collections                  v1.2               Collections Abstraction library
doctrine/common                       2.4.x-dev ae92d07  Common Library for Doctrine projects
doctrine/data-fixtures                dev-master ac36ccc Data Fixtures for all Doctrine Object Managers
doctrine/dbal                         2.4.x-dev 2423cce  Database Abstraction Layer
doctrine/doctrine-bundle              1.1.x-dev 78b3680  Symfony DoctrineBundle
doctrine/doctrine-fixtures-bundle     dev-master 9a5b528 Symfony DoctrineFixturesBundle
doctrine/inflector                    dev-master 8a0b96e Common String Manipulations with regard to casing and singular/plural rules.
doctrine/lexer                        dev-master 83893c5 Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.
doctrine/orm                          2.4.x-dev c701e8b  Object-Relational-Mapper for PHP
doctrine/phpcr-bundle                 1.0.0              Symfony DoctrinePHPCRBundle
doctrine/phpcr-odm                    1.0.x-dev fc72cc9  Object-Document-Mapper for PHPCR
egeloen/ckeditor-bundle               2.4.0              Provides a CKEditor integration for your Symfony2 Project.
egeloen/json-builder                  1.0.3              JSON builder with escaping control for PHP 5.3+
jackalope/jackalope                   1.0.x-dev b49d1d0  Jackalope PHPCR library
jackalope/jackalope-doctrine-dbal     1.0.x-dev d284e44  Jackalope Transport library for Doctrine DBAL
jdorn/sql-formatter                   dev-master ff0515f a PHP SQL highlighting library
jms/aop-bundle                        1.0.1              Adds AOP capabilities to Symfony2
jms/cg                                dev-master 3d2881f Toolset for generating PHP code
jms/di-extra-bundle                   1.1.x-dev ba28029  Allows to configure dependency injection using annotations
jms/metadata                          1.1.1              Class/method/property metadata management in PHP
jms/security-extra-bundle             1.2.x-dev 7868b5c  Enhances the Symfony2 Security Component by adding several new features
kriswallsmith/assetic                 1.1.x-dev ddaccff  Asset Management for PHP
leafo/scssphp                         v0.0.9             scssphp is a compiler for SCSS written in PHP.
monolog/monolog                       1.2.1              Logging for PHP 5.3
phpcr/phpcr                           2.1.0              PHP Content Repository interfaces
phpcr/phpcr-utils                     1.0.0              PHP Content Repository implementation independant utilities
phpunit/php-code-coverage             1.2.x-dev fe24668  Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator             1.3.4              FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-text-template             1.2.0              Simple template engine.
phpunit/php-timer                     1.0.5              Utility class for timing
phpunit/php-token-stream              1.2.2              Wrapper around PHP's tokenizer extension.
phpunit/phpunit                       3.7.x-dev 38709dc  The PHP Unit Testing framework.
phpunit/phpunit-mock-objects          1.2.x-dev c39c451  Mock Object library for PHPUnit
predis/predis                         0.8.x-dev 4123fcd  Flexible and feature-complete PHP client library for Redis
search/sphinxsearch-bundle            dev-master 5a991a2 Sphinx search bundle for Symfony 2. Forked from https://github.com/timewasted/Search-SphinxsearchBundle
sensio/distribution-bundle            2.1.x-dev 6ba9c46  The base bundle for the Symfony Distributions
sensio/framework-extra-bundle         2.1.x-dev dcbd694  This bundle provides a way to configure your controllers with annotations
sensio/generator-bundle               2.1.x-dev 19ec741  This bundle generates code for you
servergrove/translation-editor-bundle dev-master 201fd4d Web based UI to manage Symfony2 translations
snc/redis-bundle                      1.1.5              A Redis bundle for Symfony2
startupjob/fpdf                       master master      
swiftmailer/swiftmailer               v4.2.2             Swiftmailer, free feature-rich PHP mailer
symfony/assetic-bundle                2.1.x-dev 49ed2a7  Integrates Assetic into Symfony2
symfony/monolog-bundle                2.1.x-dev 56e6920  Symfony MonologBundle
symfony/property-access               2.7.x-dev 30b1674  Symfony PropertyAccess Component
symfony/swiftmailer-bundle            2.1.x-dev 2bf9cde  Symfony SwiftmailerBundle
symfony/symfony                       2.1.x-dev fc0a09a  The Symfony PHP framework
twig/extensions                       v1.0.1             Common additional features for Twig that do not directly belong in core
twig/twig                             dev-master efed4fa Twig, the flexible, fast, and secure template language for PHP
whiteoctober/breadcrumbs-bundle       dev-master d330a59 A small breadcrumbs bundle for Symfony2

With the current version of composer without my commit

amazonwebservices/aws-sdk-for-php     dev-master 0507424 AWS SDK for PHP
coresphere/console-bundle             dev-master 6cf6090 This bundle allows you accessing the symfony2 console via your browser
cybernox/amazon-webservices-bundle    dev-master 64853f8 A Symfony2 Bundle for interfacing with Amazon Web Services (AWS)
doctrine/annotations                  dev-master 3b6668f Docblock Annotations Parser
doctrine/cache                        dev-master 85ff611 Caching library offering an object-oriented API for many cache backends
doctrine/collections                  v1.2               Collections Abstraction library
doctrine/common                       2.4.x-dev ae92d07  Common Library for Doctrine projects
doctrine/data-fixtures                dev-master ac36ccc Data Fixtures for all Doctrine Object Managers
doctrine/dbal                         2.4.x-dev 2423cce  Database Abstraction Layer
doctrine/doctrine-bundle              1.1.x-dev 78b3680  Symfony DoctrineBundle
doctrine/doctrine-fixtures-bundle     dev-master 9a5b528 Symfony DoctrineFixturesBundle
doctrine/inflector                    dev-master 8a0b96e Common String Manipulations with regard to casing and singular/plural rules.
doctrine/lexer                        dev-master 83893c5 Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.
doctrine/orm                          2.4.x-dev c701e8b  Object-Relational-Mapper for PHP
doctrine/phpcr-bundle                 1.0.0              Symfony DoctrinePHPCRBundle
doctrine/phpcr-odm                    1.0.x-dev fc72cc9  Object-Document-Mapper for PHPCR
egeloen/ckeditor-bundle               2.5.2              Provides a CKEditor integration for your Symfony2 Project.
egeloen/json-builder                  1.0.3              JSON builder with escaping control for PHP 5.3+
jackalope/jackalope                   1.0.x-dev b49d1d0  Jackalope PHPCR library
jackalope/jackalope-doctrine-dbal     1.0.x-dev d284e44  Jackalope Transport library for Doctrine DBAL
jdorn/sql-formatter                   dev-master ff0515f a PHP SQL highlighting library
jms/aop-bundle                        1.0.1              Adds AOP capabilities to Symfony2
jms/cg                                dev-master 3d2881f Toolset for generating PHP code
jms/di-extra-bundle                   1.1.x-dev ba28029  Allows to configure dependency injection using annotations
jms/metadata                          1.1.1              Class/method/property metadata management in PHP
jms/security-extra-bundle             1.2.x-dev 7868b5c  Enhances the Symfony2 Security Component by adding several new features
kriswallsmith/assetic                 1.1.x-dev ddaccff  Asset Management for PHP
leafo/scssphp                         v0.0.9             scssphp is a compiler for SCSS written in PHP.
monolog/monolog                       1.2.1              Logging for PHP 5.3
phpcr/phpcr                           2.1.0              PHP Content Repository interfaces
phpcr/phpcr-utils                     1.0.0              PHP Content Repository implementation independant utilities
phpunit/php-code-coverage             1.2.x-dev fe24668  Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator             1.3.4              FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-text-template             1.2.0              Simple template engine.
phpunit/php-timer                     1.0.5              Utility class for timing
phpunit/php-token-stream              1.2.2              Wrapper around PHP's tokenizer extension.
phpunit/phpunit                       3.7.x-dev 38709dc  The PHP Unit Testing framework.
phpunit/phpunit-mock-objects          1.2.x-dev c39c451  Mock Object library for PHPUnit
predis/predis                         0.8.x-dev 4123fcd  Flexible and feature-complete PHP client library for Redis
psr/log                               dev-master a78d650 Common interface for logging libraries
search/sphinxsearch-bundle            dev-master 5a991a2 Sphinx search bundle for Symfony 2. Forked from https://github.com/timewasted/Search-SphinxsearchBundle
sensio/distribution-bundle            2.1.x-dev 6ba9c46  The base bundle for the Symfony Distributions
sensio/framework-extra-bundle         2.1.x-dev dcbd694  This bundle provides a way to configure your controllers with annotations
sensio/generator-bundle               2.1.x-dev 19ec741  This bundle generates code for you
servergrove/translation-editor-bundle dev-master 201fd4d Web based UI to manage Symfony2 translations
snc/redis-bundle                      1.1.5              A Redis bundle for Symfony2
startupjob/fpdf                       master master      
swiftmailer/swiftmailer               v4.2.2             Swiftmailer, free feature-rich PHP mailer
symfony/assetic-bundle                2.1.x-dev 49ed2a7  Integrates Assetic into Symfony2
symfony/config                        2.7.x-dev 770b9d4  Symfony Config Component
symfony/debug                         2.7.x-dev 4d01c33  Symfony Debug Component
symfony/dependency-injection          2.7.x-dev cc8338d  Symfony DependencyInjection Component
symfony/event-dispatcher              2.7.x-dev a8d31f9  Symfony EventDispatcher Component
symfony/filesystem                    2.7.x-dev f14e640  Symfony Filesystem Component
symfony/form                          2.7.x-dev ab6389f  Symfony Form Component
symfony/framework-bundle              2.7.x-dev a0e1e45  Symfony FrameworkBundle
symfony/http-foundation               2.7.x-dev 11e0711  Symfony HttpFoundation Component
symfony/http-kernel                   2.7.x-dev 8f1ed1c  Symfony HttpKernel Component
symfony/intl                          2.7.x-dev a07b44f  A PHP replacement layer for the C intl extension that includes additional data from the ICU library.
symfony/monolog-bundle                2.1.x-dev 56e6920  Symfony MonologBundle
symfony/property-access               2.7.x-dev 30b1674  Symfony PropertyAccess Component
symfony/routing                       2.7.x-dev 8306250  Symfony Routing Component
symfony/security-core                 2.7.x-dev 9c56600  Symfony Security Component - Core Library
symfony/security-csrf                 2.7.x-dev 78fc21b  Symfony Security Component - CSRF Library
symfony/stopwatch                     2.7.x-dev 69e540b  Symfony Stopwatch Component
symfony/swiftmailer-bundle            2.1.x-dev 2bf9cde  Symfony SwiftmailerBundle
symfony/symfony                       2.1.x-dev fc0a09a  The Symfony PHP framework
symfony/translation                   2.7.x-dev 74034cb  Symfony Translation Component
twig/extensions                       v1.0.1             Common additional features for Twig that do not directly belong in core
twig/twig                             dev-master efed4fa Twig, the flexible, fast, and secure template language for PHP
whiteoctober/breadcrumbs-bundle       dev-master d330a59 A small breadcrumbs bundle for Symfony2

@stof
Copy link
Copy Markdown
Contributor

stof commented Dec 2, 2014

@naderman it looks like the conflicts between the symfony/symfony and the component it replaces are not registered properly. The deduplication based on the id should probably be applied only for packages with the same name, because for replacements the other side will not register the same conflict.

@spreston
Copy link
Copy Markdown
Contributor Author

spreston commented Dec 2, 2014

There are 3 other requires in a private repo which should have been included with the previous composer.json:

      "symfony/symfony": "2.1.*",
      "cybernox/amazon-webservices-bundle": "*",
      "jakoch/phantomjs-installer": "1.9.7"

@naderman
Copy link
Copy Markdown
Member

naderman commented Dec 2, 2014

@stof Indeed, I was pretty sure that was taken care of by the loop further up, but I guess I made a mistake there?

@tommygnr
Copy link
Copy Markdown

tommygnr commented Dec 2, 2014

@spreston what version of php are you running?

@spreston
Copy link
Copy Markdown
Contributor Author

spreston commented Dec 3, 2014

5.5.9
php -v:

PHP 5.5.9-1ubuntu4.5 (cli) (built: Oct 29 2014 11:59:10) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies

@1ed
Copy link
Copy Markdown
Contributor

1ed commented Dec 4, 2014

As @stof said the replace stuff does not work as expected, here is a simple example:

$  cat composer.json
{
    "require": {
        "symfony/symfony": "2.6.*",
        "phpmd/phpmd": "2.1.*"
    }
}

Using an old composer version it installs phpmd/phpmd (2.1.1) instead of phpmd/phpmd (2.1.3) as it requires only stable symfony packages @stable (symfony/dependency-injection: @stable) but phpmd/phpmd (2.1.3) requires symfony/dependency-injection: 2.5* and so on.

# an old version (ffffab37a294f3383c812d0329623f0a4ba45387)
$ composer update -vv
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing psr/log (1.0.0)
    Loading from cache
    Extracting archive

    REASON: symfony/symfony v2.6.1 requires psr/log ~1.0 -> satisfiable by psr/log[1.0.0].

  - Installing twig/twig (v1.16.2)
    Loading from cache
    Extracting archive

    REASON: symfony/symfony v2.6.1 requires twig/twig ~1.12 -> satisfiable by twig/twig[v1.12.0, v1.12.1, v1.12.2, v1.12.3, v1.13.0, v1.13.1, v1.13.2, v1.14.0, v1.14.1, v1.14.2, v1.15.0, v1.15.1, v1.16.0, v1.16.1, v1.16.2].

  - Installing doctrine/lexer (v1.0)
    Loading from cache
    Extracting archive

    REASON: doctrine/common v2.4.2 requires doctrine/lexer 1.* -> satisfiable by doctrine/lexer[v1.0].

  - Installing doctrine/annotations (v1.2.1)
    Loading from cache
    Extracting archive

    REASON: doctrine/common v2.4.2 requires doctrine/annotations 1.* -> satisfiable by doctrine/annotations[v1.0, v1.1, v1.1.1, v1.1.2, v1.2.0, v1.2.1].

  - Installing doctrine/collections (v1.2)
    Loading from cache
    Extracting archive

    REASON: doctrine/common v2.4.2 requires doctrine/collections 1.* -> satisfiable by doctrine/collections[v1.0, v1.1, v1.2].

  - Installing doctrine/cache (v1.3.1)
    Loading from cache
    Extracting archive

    REASON: doctrine/common v2.4.2 requires doctrine/cache 1.* -> satisfiable by doctrine/cache[v1.0, v1.1, v1.2.0, v1.3.0, v1.3.1].

  - Installing doctrine/inflector (v1.0)
    Loading from cache
    Extracting archive

    REASON: doctrine/common v2.4.2 requires doctrine/inflector 1.* -> satisfiable by doctrine/inflector[v1.0].

  - Installing doctrine/common (v2.4.2)
    Loading from cache
    Extracting archive

    REASON: symfony/symfony v2.6.1 requires doctrine/common ~2.2 -> satisfiable by doctrine/common[2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.3.0, v2.4.0, v2.4.1, v2.4.2].

  - Installing symfony/symfony (v2.6.1)
    Loading from cache
    Extracting archive

    REASON: Required by root: Install command rule (install symfony/symfony v2.6.0|install symfony/symfony v2.6.1)

  - Installing pdepend/pdepend (2.0.3)
    Loading from cache
    Extracting archive

    REASON: phpmd/phpmd 2.1.1 requires pdepend/pdepend 2.0.* -> satisfiable by pdepend/pdepend[2.0.0, 2.0.1, 2.0.2, 2.0.3].

  - Installing phpmd/phpmd (2.1.1)
    Loading from cache
    Extracting archive

    REASON: Required by root: Install command rule (install phpmd/phpmd 2.1.1|install phpmd/phpmd 2.1.2|install phpmd/phpmd 2.1.3)

Writing lock file
Generating autoload files

But when I use the latest composer it installs phpmd/phpmd (2.1.3) and e.g. symfony/dependency-injection: 2.5* as well along with symfony/symfony (2.6.1):

$ composer self-update
Updating to version 37ec0bde9dd6826591308e7a1ad55cb5e38ef117.
    Downloading: 100%         
Use composer self-update --rollback to return to version ffffab37a294f3383c812d0329623f0a4ba45387
$ composer update -vv
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing psr/log (1.0.0)
    Loading from cache
    Extracting archive

    REASON: symfony/symfony v2.6.1 requires psr/log ~1.0 -> satisfiable by psr/log[1.0.0].

  - Installing twig/twig (v1.16.2)
    Loading from cache
    Extracting archive

    REASON: symfony/symfony v2.6.1 requires twig/twig ~1.12 -> satisfiable by twig/twig[v1.12.0, v1.12.1, v1.12.2, v1.12.3, v1.13.0, v1.13.1, v1.13.2, v1.14.0, v1.14.1, v1.14.2, v1.15.0, v1.15.1, v1.16.0, v1.16.1, v1.16.2].

  - Installing doctrine/lexer (v1.0)
    Loading from cache
    Extracting archive

    REASON: doctrine/common v2.4.2 requires doctrine/lexer 1.* -> satisfiable by doctrine/lexer[v1.0].

  - Installing doctrine/annotations (v1.2.1)
    Loading from cache
    Extracting archive

    REASON: doctrine/common v2.4.2 requires doctrine/annotations 1.* -> satisfiable by doctrine/annotations[v1.0, v1.1, v1.1.1, v1.1.2, v1.2.0, v1.2.1].

  - Installing doctrine/collections (v1.2)
    Loading from cache
    Extracting archive

    REASON: doctrine/common v2.4.2 requires doctrine/collections 1.* -> satisfiable by doctrine/collections[v1.0, v1.1, v1.2].

  - Installing doctrine/cache (v1.3.1)
    Loading from cache
    Extracting archive

    REASON: doctrine/common v2.4.2 requires doctrine/cache 1.* -> satisfiable by doctrine/cache[v1.0, v1.1, v1.2.0, v1.3.0, v1.3.1].

  - Installing doctrine/inflector (v1.0)
    Loading from cache
    Extracting archive

    REASON: doctrine/common v2.4.2 requires doctrine/inflector 1.* -> satisfiable by doctrine/inflector[v1.0].

  - Installing doctrine/common (v2.4.2)
    Loading from cache
    Extracting archive

    REASON: symfony/symfony v2.6.1 requires doctrine/common ~2.2 -> satisfiable by doctrine/common[2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.3.0, v2.4.0, v2.4.1, v2.4.2].

  - Installing symfony/symfony (v2.6.1)
    Loading from cache
    Extracting archive

    REASON: Required by root: Install command rule (install symfony/symfony v2.6.0|install symfony/symfony v2.6.1)

  - Installing symfony/filesystem (v2.5.8)
    Loading from cache
    Extracting archive

    REASON: phpmd/phpmd 2.1.3 requires symfony/filesystem 2.5.* -> satisfiable by symfony/filesystem[v2.5.0, v2.5.1, v2.5.2, v2.5.3, v2.5.4, v2.5.5, v2.5.6, v2.5.7, v2.5.8].

  - Installing symfony/config (v2.5.8)
    Loading from cache
    Extracting archive

    REASON: phpmd/phpmd 2.1.3 requires symfony/config 2.5.* -> satisfiable by symfony/config[v2.5.0, v2.5.1, v2.5.2, v2.5.3, v2.5.4, v2.5.5, v2.5.6, v2.5.7, v2.5.8].

  - Installing symfony/dependency-injection (v2.5.8)
    Loading from cache
    Extracting archive

    REASON: phpmd/phpmd 2.1.3 requires symfony/dependency-injection 2.5.* -> satisfiable by symfony/dependency-injection[v2.5.0, v2.5.1, v2.5.2, v2.5.3, v2.5.4, v2.5.5, v2.5.6, v2.5.7, v2.5.8].

  - Installing pdepend/pdepend (2.0.3)
    Loading from cache
    Extracting archive

    Skipped installation of bin src/bin/pdepend for package pdepend/pdepend: name conflicts with an existing file
    REASON: phpmd/phpmd 2.1.3 requires pdepend/pdepend 2.0.* -> satisfiable by pdepend/pdepend[2.0.0, 2.0.1, 2.0.2, 2.0.3].

  - Installing phpmd/phpmd (2.1.3)
    Loading from cache
    Extracting archive

    Skipped installation of bin src/bin/phpmd for package phpmd/phpmd: name conflicts with an existing file
    REASON: Required by root: Install command rule (install phpmd/phpmd 2.1.1|install phpmd/phpmd 2.1.2|install phpmd/phpmd 2.1.3)

Writing lock file
Generating autoload files

@1ed
Copy link
Copy Markdown
Contributor

1ed commented Dec 4, 2014

I have tried to create a failing test

--TEST--
Something
--COMPOSER--
{
    "repositories": [
        {
            "type": "package",
            "package": [
                { "name": "a/a", "version": "1.0.0" },
                { "name": "a/a", "version": "1.1.0" },
                { "name": "b/b", "version": "1.0.0", "replace": {"a/a": "1.0.0"} },
                { "name": "b/b", "version": "1.1.0", "replace": {"a/a": "1.1.0"} },
                { "name": "c/c", "version": "1.0.0", "require": {"a/a": "*"} },
                { "name": "c/c", "version": "1.0.1", "require": {"a/a": "1.0.*"} }
            ]
        }
    ],
    "require": {
        "b/b": "1.1.*",
        "c/c": "1.0.*"
    }
}
--RUN--
update
--EXPECT--
Installing b/b (1.1.0)
Installing c/c (1.0.0)

...but it passes, so I think I'm doing something wrong here

@Seldaek Seldaek added this to the Urgent milestone Dec 4, 2014
@Seldaek Seldaek added the Bug label Dec 4, 2014
@stof
Copy link
Copy Markdown
Contributor

stof commented Dec 4, 2014

@naderman I think the issue is related to the optimization restricting packages based on the root package requirements. This can cause the opposite side of the conflict to not be added in the rule set.

this issue has been reported again in #3507.
I suggest merging this revert of #3482 quickly, to have a working Composer again, and then looking at a working way of optimizing duplicates

@naderman
Copy link
Copy Markdown
Member

naderman commented Dec 4, 2014

Ah that's a good point, I was trying to come up with a decent test case for this, and ended up working on a tool to extract one from a composer.json ... But yeah I guess we might have to just slow down composer again and figure out a proper fix afterwards.

naderman added a commit that referenced this pull request Dec 4, 2014
Fixed dependency problem caused by pull request #3482
@naderman naderman merged commit 6340f4c into composer:master Dec 4, 2014
@stof
Copy link
Copy Markdown
Contributor

stof commented Dec 4, 2014

@naderman try looking at my idea about the root requirement optimization. Each report until now was about a package which was appearing in the root requirements too.

@naderman
Copy link
Copy Markdown
Member

naderman commented Dec 4, 2014

Yeah, but I kind of want to have this test generation tool to debug other solve issues too now ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants