composer icon indicating copy to clipboard operation
composer copied to clipboard

dev-main found instead of dev-master

Open iranimij opened this issue 1 year ago • 1 comments

In 2021 there was an issue https://github.com/composer/composer/issues/10360 and the fix for this issue made an exact opposite issue for us, we have dev-master and now composer just found dev-main

My composer.json:

{
    "name": "foobar/project",
    "type": "project",
    "require": {
        "foobar/package": "dev-master"
    },
    "repositories": {
        "foobar/package": {
            "type": "path",
            "url": "/path/to/package/"
        }
    }
}

/path/to/package/composer.json

{
    "name": "foobar/package",
    "type": "library"
}

Output of composer diagnose:

$ composer update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires foobar/package dev-main, found foobar/package[dev-master] but it does not match the constraint.

When I run this command:

composer update foobar/package

I get the following output:

$ composer update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires foobar/package dev-master, found foobar/package[dev-main] but it does not match the constraint.

And I expected this to happen: I expect it to work fine without any errors

there was a fix here to have aliases for branches I do not know why it is removed here : and when we are removing a PR changes I expect to revert everything, in the previous PR it is changed to dev-main and when we removed the changes we didn't move it back to dev-master!

iranimij avatar Aug 06 '24 13:08 iranimij

The default version if no other version can be guessed is dev-main, so why not require dev-main in your main composer.json? Or you can set a version explicitly in path/to/package/composer.json

Seldaek avatar Aug 22 '24 08:08 Seldaek

This issue has been automatically marked Stale and will be closed in 15 days if no further activity happens.

github-actions[bot] avatar Jul 22 '25 02:07 github-actions[bot]