Skip to content

Fix: composer install fails because of required 'dev' packages#1103

Closed
jasny wants to merge 1 commit into
phpbrew:masterfrom
jasny:composer-dev-stability
Closed

Fix: composer install fails because of required 'dev' packages#1103
jasny wants to merge 1 commit into
phpbrew:masterfrom
jasny:composer-dev-stability

Conversation

@jasny

@jasny jasny commented Dec 19, 2019

Copy link
Copy Markdown
Contributor

The minimum stability for composer packages is stable (see docs). Running composer install on master fails because phpbrew is using dev packages.

$ composer install
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
    - Installation request for corneltek/cliframework dev-master#2650a53433854d43b91955e8f967c62ce07869d7 -> satisfiable by corneltek/cliframework[dev-master].
    - corneltek/cliframework dev-master requires corneltek/codegen 4.0.x-dev -> satisfiable by corneltek/codegen[4.0.x-dev] but these conflict with your requirements or minimum-stability.

This change sets the minimum stability to 'dev', but with stable as preferred stability.

@morozov

morozov commented Dec 19, 2019

Copy link
Copy Markdown
Contributor

@jasny for me, it only happens if I remove the lock file. How exactly do you reproduce it?

$ git checkout master
Switched to branch 'master'

$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files

$ rm composer.lock
$ composer install
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
    - corneltek/cliframework dev-master requires corneltek/codegen 4.0.x-dev -> satisfiable by corneltek/codegen[4.0.x-dev] but these conflict with your requirements or minimum-stability.
    - corneltek/cliframework dev-master requires corneltek/codegen 4.0.x-dev -> satisfiable by corneltek/codegen[4.0.x-dev] but these conflict with your requirements or minimum-stability.
    - Installation request for corneltek/cliframework dev-master#2650a53433854d43b91955e8f967c62ce07869d7 -> satisfiable by corneltek/cliframework[dev-master].

In its current state, your PR modifies the config file but doesn't update the lock:

$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.

Please do not run update as suggested above but run update --lock instead to keep the locked dependencies intact. They could be updated individually in a controlled way by @dependabot.

@morozov

morozov commented Dec 25, 2019

Copy link
Copy Markdown
Contributor

Per documentation, stability restriction can be specified on a per-package basis w/o having to allow non-stable dependencies for the entire project.

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.

2 participants