Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 795957 - =dev-php/composer-1.10.22 requires semver < 3
Summary: =dev-php/composer-1.10.22 requires semver < 3
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Guillaume Seren
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-06-14 13:16 UTC by Claes
Modified: 2021-10-15 10:22 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Claes 2021-06-14 13:16:00 UTC
Installing composer 1 because an old project needs it:

$ sudo emerge -qav =dev-php/composer-1.10.22
[ebuild  N    ] dev-php/semver-3.2.4 
[ebuild   R   ] dev-php/composer-1.10.22  USE="-test" 

Would you like to merge these packages? [Yes/No] 
>>> Verifying ebuild manifests
>>> Emerging (1 of 2) dev-php/semver-3.2.4::gentoo
>>> Installing (1 of 2) dev-php/semver-3.2.4::gentoo
>>> Emerging (2 of 2) dev-php/composer-1.10.22::gentoo
>>> Installing (2 of 2) dev-php/composer-1.10.22::gentoo

Running now fails with:
$ composer --version
PHP Fatal error:  Uncaught Error: Class 'Composer\Semver\Constraint\EmptyConstraint' not found in /usr/share/composer/src/Composer/DependencyResolver/Pool.php:344

EmptyConstraint was renamed in version 3: https://github.com/composer/semver/releases/tag/3.0.0

So the solution is:
$ sudo emerge -qav1 =dev-php/semver-1.7.1
$ composer --version
Composer version 1.10.22 2021-04-27 13:10:45

I know version 1 is old and the ebuild masked, but maybe it should still reflect that it doesn't work at all with semver 3?
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2021-06-14 22:48:55 UTC
I tend to cleanup <composer-2 instead. Is there a reason why you cannot move to >=composer-2?
Comment 2 Claes 2021-06-15 07:28:13 UTC
> I tend to cleanup <composer-2 instead. Is there a reason why you cannot move to >=composer-2?

I'll certainly get there at some point, I haven't exactly worked out why, but on my current project composer install fails with composer 2. I obviously need to work out why, for the long term of course.

Regardless, I wanted to report bug, even if it's not considered worth fixing, someone else might find it when searching at least.
Comment 3 Jaco Kroon 2021-09-14 15:11:33 UTC
Just an FYI, this seems to be a non-issue for me.

# equery list -ipo dev-php/semver
 * Searching for semver in dev-php ...
[-P-] [ ~] dev-php/semver-1.4.2:0
[-P-] [ ~] dev-php/semver-1.5.1:0
[-P-] [ ~] dev-php/semver-1.7.0:0
[-P-] [ ~] dev-php/semver-1.7.1:0
[IP-] [  ] dev-php/semver-3.2.4:0
$ composer --version
Composer version 1.10.22 2021-04-27 13:10:45

Saw this after looking for whether someone else was requested SLOTed composer.
Comment 4 Jaco Kroon 2021-10-01 14:12:00 UTC
Managed to reproduce this.  Odd that we don't get this on --version ... and only in certain cases.
Comment 5 Larry the Git Cow gentoo-dev 2021-10-15 10:22:49 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1dee9e868060492e4e35e374a0cc95a255b10004

commit 1dee9e868060492e4e35e374a0cc95a255b10004
Author:     Jaco Kroon <jaco@uls.co.za>
AuthorDate: 2021-10-01 14:14:28 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2021-10-15 10:22:41 +0000

    dev-php/composer: v1 dep on dev-php/semver constraints fix.
    
    Whilst we all want old software to "just go away", this is one that is
    required to be kept around for a while longer.
    
    Closes: https://bugs.gentoo.org/795957
    Bug: https://bugs.gentoo.org/813045
    
    I'll apply same to SLOT PR.
    
    Package-Manager: Portage-3.0.20, Repoman-3.0.3
    Signed-off-by: Jaco Kroon <jaco@uls.co.za>
    Closes: https://github.com/gentoo/gentoo/pull/22458
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 .../composer/{composer-1.10.22.ebuild => composer-1.10.22-r1.ebuild}    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)