composer: Inline Alias not working in 2.0.0-alpha1
My composer.json
:
...
"cakephp/authentication": "^2.0",
"cakephp/authorization": "^2.0",
"cakephp/cakephp": "dev-4.next as 4.1.0-RC2",
...
Output of composer diagnose
:
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com oauth access: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0 87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B 0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 2.0.0-alpha1
PHP version: 7.4.4 - Package overridden via config.platform, actual: 7.4.7-dev
PHP binary path: c:\program files\php\php.exe
OpenSSL version: OpenSSL 1.1.1g 21 Apr 2020
When I run this command:
composer update
I get the following output:
Problem 1
- Root composer.json requires cakephp/authentication ^2.0 -> satisfiable by cakephp/authentication[2.3.0].
- cakephp/authentication 2.3.0 requires cakephp/core ^4.0 -> could not be found in any version, there may be a typo in the package name.
Problem 2
- Root composer.json requires cakephp/authorization ^2.0 -> satisfiable by cakephp/authorization[2.0.3].
- cakephp/authorization 2.0.3 requires cakephp/cakephp ^4.0 -> found cakephp/cakephp[dev-4.next] but it does not match the constraint.
...
And I expected this to happen:
In Composer 1.10.7 running composer update
works fine and installs dev-4.next branch without issues.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18 (8 by maintainers)
Commits related to this issue
- Fix inline aliases not being loaded when extracting dev requirements, fixes #8954 — committed to Seldaek/composer by Seldaek 4 years ago
- Fix inline aliases not being loaded when extracting dev requirements, fixes #8954 — committed to Seldaek/composer by Seldaek 4 years ago
This works now (built a phar from github clone), and wow, impressive stats from Composer 2!
Composer 1 for this particular app:
Memory usage: 1114.79MiB (peak: 3529.46MiB), time: 277.78s
Composer 2 for the same app:
Memory usage: 80.84MiB (peak: 824.72MiB), time: 155.29s
(cache and vendor dir cleared before each run)
Thanks!
The minimum repro case was something like:
Anyway there is a fix in https://github.com/composer/composer/pull/8982 - thanks for reporting!
Regardless of whether adding branch alias to CakePHP’s
composer.json
is a better option or not, claiming that the use of inline aliases in one’s app is a hack is pretty bad choice of words on your part.