Skip to content

self.version don't get resolved for component's composer.json's #578

Closed
cordoval opened this Issue Apr 14, 2012 · 5 comments

3 participants

@cordoval

Proposal

add a --version command to install/update
or try and detect if this is in a vcs repo itself

Problem

~ composer update --install-suggests
Updating dependencies
Your requirements could not be solved to an installable set of packages.

    Problems:
        - The requested package "symfony/form" with constraint == 1.0.0.0 could not be found.
        - The requested package "symfony/routing" with constraint == 1.0.0.0 could not be found.
        - The requested package "symfony/translation" with constraint == 1.0.0.0 could not be found.
        - The requested package "symfony/yaml" with constraint == 1.0.0.0 could not be found.
~/sites-2/symfony-standard/vendor/symfony/symfony/src/Symfony/Bridge/Twig ((3d84153...) %)

with this composer.json:

{
    "name": "symfony/twig-bridge",
    "type": "symfony-bridge",
    "description": "Symfony Twig Bridge",
    "keywords": [],
    "homepage": "http://symfony.com",
    "license": "MIT",
    "authors": [
        {
            "name": "Fabien Potencier",
            "email": "fabien@symfony.com"
        },
        {
            "name": "Symfony Community",
            "homepage": "http://symfony.com/contributors"
        }
    ],
    "require": {
        "php": ">=5.3.2",
        "twig/twig": ">=1.1,<2.0-dev"
    },
    "suggest": {
        "symfony/form": "self.version",
        "symfony/routing": "self.version",
        "symfony/translation": "self.version",
        "symfony/yaml": "self.version"
    },
    "autoload": {
        "psr-0": { "Symfony\\Bridge\\Twig": "" }
    },
    "target-dir": "Symfony/Bridge/Twig",
    "extra": {
        "branch-alias": {
            "dev-master": "2.1-dev"
        }
    }
}

Explanation

In regular circumstances self.version gets resolved by packagist if it detects the greater package is VCS repository and autodetects the versions for all dependencies. However in this case composer does not know how to do it automatically.

@Seldaek
Composer member
Seldaek commented May 9, 2012

Composer now resolves the version to the current branch if you're in a git repo, in other cases though this will probably still fail, but it is not really possible to fix it unfortunately. I guess adding a --force-version=1.0.0 flag or something would be the only last-resort option.

@Seldaek
Composer member
Seldaek commented May 24, 2012

COMPOSER_ROOT_VERSION=xxx composer install does that now. Not great, but it's a fix for those rare edge cases.

@Seldaek Seldaek closed this May 24, 2012
@cordoval

did you make this entry on the docu? would rock, thanks man

@Seldaek
Composer member
Seldaek commented May 25, 2012
@rk3rn3r
rk3rn3r commented Jan 28, 2014

see PR #2602 that will make self.version work with svn

then git, mercurial and svn (new) will be supported

@sagikazarmark sagikazarmark referenced this issue in thomaspark/bootswatch Sep 3, 2015
Open

Composer dependency #506

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.