composer-versions-check icon indicating copy to clipboard operation
composer-versions-check copied to clipboard

Wrong displayed version after downgrading dependency

Open rmasclef opened this issue 8 years ago • 1 comments

Hi,

I may have found an issue with the displaying of the current installed version of a subdependency after downgrading it.

For example, when I downgrade the symfony-framework-bundle dependency from 2.8 to 2.3, the composer-versions-check display me this for the http-kernel sub-dependency :

symfony/http-kernel (v2.8.2) last version is v3.0.1

The dependecies are well displayed, but the sub-dependencies seems not to be handle well.

composer_version_checker

rmasclef avatar Jan 22 '16 17:01 rmasclef

It looks like it is not an issue ...

The dependencies definied in some sub-dependencies (ex: framework-bundle) are set with ~2.3 in the composer.json of the dependency.

This appears to allow composer to download the latest 2.x version (2.8) which, as I think, is really wrong.


If we take a look at symfony/framework-bundle

The 2.3 version of symfony/framework-bundle requires php 5.3.3 and symfony/config component ~2.3 (which allows 2.8). If we take a look at symfony/config component in 2.8 version, it requires php 5.3.9 which is not good at all if we use a server running php 5.3.3 (centOS 6 server for example).

Here is an example:

If we take a look at symfony/framework-bundle

  • The 2.3 version of symfony/framework-bundle requires php 5.3.3 and symfony/config component ~2.3 (which allows 2.8).
  • The symfony/config component in 2.8 version requires php 5.3.9 which is not good at all if we use a server running php 5.3.3 (centOS 6 server for example).

A little bit of code

If we launch a composer install with a PHP Client having PHP5.4 (YES it is completly dumb not to use the same php version in dev as in prod), the subdependencies will be installed with the 2.8version and then, a composer install will fail in production environment.

We need to add those lines in the composer.json in order to force the 2.3 version to be installed:

"conflict": {
      "symfony/config": "2.3",
      "symfony/console": "2.3",
      "symfony/debug": "2.3",
      "symfony/doctrine-bridge": "2.3",
      "symfony/dom-crawler": "2.3",
      "symfony/event-dispatcher": "2.3",
      "symfony/filesystem": "2.3",
      "symfony/http-kernel": "2.3",
      "symfony/http-foundation": "2.3",
      "symfony/routing": "2.3",
      "symfony/stopwatch": "2.3",
      "symfony/templating": "2.3",
      "symfony/translation": "2.3",
      "symfony/yaml": "2.3"
    }

rmasclef avatar Jan 25 '16 11:01 rmasclef