Using a fork that also needs a requirement packaged to be forked

14 views
Skip to first unread message

Luís Gonçalves

unread,
May 7, 2021, 10:28:29 AM5/7/21
to composer-users
Hi,

I have this issue, i need to fork a package so i can update the PHP requirement to allow v8. But there is a caveat, this package also has a package as requirement that needs to have PHP updated to v8 as well.
I tried to use the same logic that i have in my local composer.json project in the parent fork, but it didnt work and it gave me an error. Not an expert on this matter :)

I did something like this:

In my local composer.json project:

"require": {
    "something/special": "dev-php8"
},
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/something/special"
     }
]

And inside the composer.json of something/special i have the same logic:

"require": {
    "something/other-special": "dev-php8"
},
"repositories": [
    {
        "type": "vcs",
     }
]

Error from composer:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - Root composer.json requires something/special dev-php8 -> satisfiable by something/special[dev-php8].
    - something/special dev-php8 requires something/other-special dev-php8 -> found something/other-special[dev-master, 0.1, 0.1.1, 0.1.2] but it does not match the constraint.


My question is, what is best way to solve this?


Thanks,
Luís

Jordi Boggiano

unread,
May 7, 2021, 1:16:51 PM5/7/21
to compose...@googlegroups.com
You can use this to allow other-special to be installed in dev version from your root project:

"require": {
    "something/special": "dev-php8" ,
    "something/other-special": "@dev"
},
"repositories": [
    {
        "type": "vcs",
     }
]

Or alternatively you can set minimum-stability:dev and prefer-stable:true - but this is less targetted.

Best,
Jordi
--
You received this message because you are subscribed to the Google Groups "composer-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to composer-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/composer-users/3fa923eb-38b3-445e-8a61-a38a25c0698bn%40googlegroups.com.
-- 
Jordi Boggiano
@seldaek - https://seld.be

Luís Gonçalves

unread,
May 7, 2021, 2:03:20 PM5/7/21
to composer-users
Thanks Jordi :)

I managed to solve it a while ago, but i did in the same way +- like you suggested, and it worked. Just added the other repo to the require in my composer.json and it worked.

I did this in my composer.json:

"require": {
    "something/special": "dev-php8",
    "something/other-special": "dev-php8"
},
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/something/special"
     },
    {
        "type": "vcs",
     }
]

Reply all
Reply to author
Forward
0 new messages