Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Can not composer install / update -> No version set (parsed as 1.0.0) #342

Closed
GuillaumeSeren opened this issue Dec 9, 2016 · 16 comments
Closed

Comments

@GuillaumeSeren
Copy link

Hi there,
I am working on phpunit to package it for gentoo (as a source package not a phar),
and during my test I try 'composer up' sometimes to check if I choose the right dependencies and version, because there are really old dependencies in composer.json.

In the case of phpunit-mock-object, when I 'composer up', I get this error:

composer up
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - phpunit/phpunit 5.4.0 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.4.1 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.4.2 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.4.3 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.4.4 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.4.5 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.4.6 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.4.7 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.4.8 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.5.0 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.5.1 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.5.2 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.5.3 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.5.4 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.5.5 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.5.6 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.5.7 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.6.0 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.6.1 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.6.2 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.6.3 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.6.4 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.6.5 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.6.6 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.6.7 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.6.8 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.7.0 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.7.1 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.7.2 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - phpunit/phpunit 5.7.3 requires phpunit/phpunit-mock-objects ^3.2 -> satisfiable by phpunit/phpunit-mock-objects[3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3].
    - Can only install one of: phpunit/phpunit-mock-objects[3.2.1, No version set (parsed as 1.0.0)].
    - Can only install one of: phpunit/phpunit-mock-objects[3.2.2, No version set (parsed as 1.0.0)].
    - Can only install one of: phpunit/phpunit-mock-objects[3.2.3, No version set (parsed as 1.0.0)].
    - Can only install one of: phpunit/phpunit-mock-objects[3.2.4, No version set (parsed as 1.0.0)].
    - Can only install one of: phpunit/phpunit-mock-objects[3.2.5, No version set (parsed as 1.0.0)].
    - Can only install one of: phpunit/phpunit-mock-objects[3.2.6, No version set (parsed as 1.0.0)].
    - Can only install one of: phpunit/phpunit-mock-objects[3.2.7, No version set (parsed as 1.0.0)].
    - Can only install one of: phpunit/phpunit-mock-objects[3.3.0, No version set (parsed as 1.0.0)].
    - Can only install one of: phpunit/phpunit-mock-objects[3.3.1, No version set (parsed as 1.0.0)].
    - Can only install one of: phpunit/phpunit-mock-objects[3.4.0, No version set (parsed as 1.0.0)].
    - Can only install one of: phpunit/phpunit-mock-objects[3.4.1, No version set (parsed as 1.0.0)].
    - Can only install one of: phpunit/phpunit-mock-objects[3.4.2, No version set (parsed as 1.0.0)].
    - Can only install one of: phpunit/phpunit-mock-objects[3.4.3, No version set (parsed as 1.0.0)].
    - Installation request for phpunit/phpunit-mock-objects No version set (parsed as 1.0.0) -> satisfiable by phpunit/phpunit-mock-objects[No version set (parsed as 1.0.0)].
    - Installation request for phpunit/phpunit ^5.4 -> satisfiable by phpunit/phpunit[5.4.0, 5.4.1, 5.4.2, 5.4.3, 5.4.4, 5.4.5, 5.4.6, 5.4.7, 5.4.8, 5.5.0, 5.5.1, 5.5.2, 5.5.3, 5.5.4, 5.5.5, 5.5.6, 5.5.7, 5.6.0, 5.6.1, 5.6.2, 5.6.3, 5.6.4, 5.6.5, 5.6.6, 5.6.7, 5.6.8, 5.7.0, 5.7.1, 5.7.2, 5.7.3].

I try'ed on different version, with the same error.

composer-1.2.2 / phpunit-5.7.3

@GrahamCampbell
Copy link
Contributor

Try running composer clear-cache. Also, maybe upgrade to composer 1.2.4?

@GrahamCampbell
Copy link
Contributor

Also, composer's package version resolution is somewhat non-deterministic. Try removing the vendor folder and composer.lock, then running the command again.

@GuillaumeSeren
Copy link
Author

@GrahamCampbell Thank you for quick reply
It is done on the 'phpunit-mock-objects-3.4.3' source without modification,

Cleaning the cache did not fix, still the same error, here the directory after the error:

build/  src/  tests/  build.xml  composer.json  CONTRIBUTING.md  LICENSE  phpunit.xml  README.md

About the composer package version resolution, from my experience it is more like you need at least this version, but not this version exactly (this version is the one written in the composer.json), so I should be able to pickup a newer releaser with no problem.

@GuillaumeSeren
Copy link
Author

Also I try'ed with the last composer-1.2.4.phar, it return the same error.

@GrahamCampbell
Copy link
Contributor

Please paste your composer.json file, and provide your php version.

@GrahamCampbell
Copy link
Contributor

Do you have any globally installed packages that could be screwing with this?

@GuillaumeSeren
Copy link
Author

@GrahamCampbell
The composer.json (the one of phpunit-mock-object):

{
    "name": "phpunit/phpunit-mock-objects",
    "description": "Mock Object library for PHPUnit",
    "type": "library",
    "keywords": [
        "xunit",
        "mock"
    ],
    "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
    "license": "BSD-3-Clause",
    "authors": [
        {
            "name": "Sebastian Bergmann",
            "email": "sb@sebastian-bergmann.de",
            "role": "lead"
        }
    ],
    "support": {
        "issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues",
        "irc": "irc://irc.freenode.net/phpunit"
    },
    "require": {
        "php": "^5.6 || ^7.0",
        "phpunit/php-text-template": "^1.2",
        "doctrine/instantiator": "^1.0.2",
        "sebastian/exporter": "^1.2 || ^2.0"
    },
    "require-dev": {
        "phpunit/phpunit": "^5.4"
    },
    "conflict": {
        "phpunit/phpunit": "<5.4.0"
    },
    "suggest": {
        "ext-soap": "*"
    },
    "autoload": {
        "classmap": [
            "src/"
        ]
    },
    "autoload-dev": {
        "classmap": [
            "tests/_fixture/"
        ]
    },
    "extra": {
        "branch-alias": {
            "dev-master": "3.2.x-dev"
        }
    }
}

My php version:

php --version
PHP 5.6.28-pl0-gentoo (cli) (built: Dec  8 2016 17:57:15)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

No packages installed globally, I try to avoid that.

@GrahamCampbell
Copy link
Contributor

No, what's your composer.json please. I don't need the one from this project copying/pasting here!

@GrahamCampbell
Copy link
Contributor

Oh, are you trying to install the dependencies for this project itself?

@GrahamCampbell
Copy link
Contributor

Travis itself demonstrates this is broken: https://travis-ci.org/sebastianbergmann/phpunit-mock-objects/builds.

@GrahamCampbell
Copy link
Contributor

Interesting it worked fine on master, but failed for the tag just after.

@GuillaumeSeren
Copy link
Author

GuillaumeSeren commented Dec 9, 2016

@GrahamCampbell

Oh, are you trying to install the dependencies for this project itself?

Yes

Travis itself demonstrates this is broken:

If travis agree it should be real, did you test it ?

Interesting it worked fine on master

I confirm it works well on the git tree !

composer up                                                                                                                               master 
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing symfony/yaml (v3.2.0)
    Downloading: 100%

  - Installing sebastian/version (2.0.1)
    Downloading: 100%

  - Installing sebastian/resource-operations (1.0.0)
    Downloading: 100%

  - Installing sebastian/recursion-context (2.0.0)
    Downloading: 100%

  - Installing sebastian/object-enumerator (2.0.0)
    Downloading: 100%

  - Installing sebastian/global-state (1.1.1)
    Downloading: 100%

  - Installing sebastian/exporter (2.0.0)
    Downloading: 100%

  - Installing sebastian/environment (2.0.0)
    Downloading: 100%

  - Installing sebastian/diff (1.4.1)
    Downloading: 100%

  - Installing sebastian/comparator (1.2.2)
    Downloading: 100%

  - Installing doctrine/instantiator (1.0.5)
    Downloading: 100%

  - Installing phpunit/php-text-template (1.2.1)
    Downloading: 100%

  - Installing phpunit/php-timer (1.0.8)
    Downloading: 100%

  - Installing phpunit/php-file-iterator (1.4.2)
    Downloading: 100%

  - Installing sebastian/code-unit-reverse-lookup (1.0.0)
    Downloading: 100%

  - Installing phpunit/php-token-stream (1.4.9)
    Downloading: 100%

  - Installing phpunit/php-code-coverage (4.0.3)
    Downloading: 100%

  - Installing webmozart/assert (1.2.0)
    Downloading: 100%

  - Installing phpdocumentor/reflection-common (1.0)
    Downloading: 100%

  - Installing phpdocumentor/type-resolver (0.2.1)
    Downloading: 100%

  - Installing phpdocumentor/reflection-docblock (3.1.1)
    Downloading: 100%

  - Installing phpspec/prophecy (v1.6.2)
    Downloading: 100%

  - Installing myclabs/deep-copy (1.5.5)
    Downloading: 100%

  - Installing phpunit/phpunit (5.7.3)
    Downloading: 100%

symfony/yaml suggests installing symfony/console (For validating YAML files using the lint command)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/php-code-coverage suggests installing ext-xdebug (>=2.4.0)
phpunit/php-code-coverage suggests installing ext-xmlwriter (*)
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
phpunit/phpunit suggests installing ext-xdebug (*)
Writing lock file
Generating autoload files

So it seems to be a bug in the release tarball right ?

@GrahamCampbell
Copy link
Contributor

Not really. It looks like a fundamental limitation of composer, due to cyclic dependencies. I don't think what you're experiencing can really be classed as bug in this project.

@GuillaumeSeren
Copy link
Author

GuillaumeSeren commented Dec 9, 2016

I am not sure but the error did not occur on the git version, even if you checkout the related tag (3.4.3) so I guess, it could ether a diff in the tarball or a problem with composer, but it is interesting !

@GrahamCampbell Thank you for helping, I will check the diffs tomorrow but I suspect it is related to this error:

Can only install one of: phpunit/phpunit-mock-objects[3.4.3, No version set (parsed as 1.0.0)].

@GuillaumeSeren
Copy link
Author

GuillaumeSeren commented Dec 10, 2016

@sebastianbergmann @GrahamCampbell
Ok I compare the phpunit-mock-object-3.4.3 and the git tree on the 3.4.3 tag,
(both freshly extracted, no composer run):

diff -r --brief  phpunit-mock-objects-3.4.3/ phpunit-mock-objects-git
Only in phpunit-mock-objects-git: .git

It is mysterious to me and, I agree it seems to related to other thing (composer resolution or something else), but not the source, which is the same so it is likely not a bug, and it was not breaking my usage.

As I was finding that, I just wanted to report to let you decide, if it is important or not.

Thank you for the feedback.

@zlikavac32
Copy link

Someone might find this useful (although the issue is closed). Composer checks for environment variable COMPOSER_ROOT_VERSION (Composer src)

The way I solved this is with COMPOSER_ROOT_VERSION=X.Y.Z composer install ...

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

No branches or pull requests

4 participants