Skip to content

Extension conflict check ignores version #1578

@donquixote

Description

@donquixote

Bug report

Question Answer
Box version main
PHP version 8.3
Platform with version Ubuntu
Github Repo ..

I first noticed this issue with grumphp.
phpro/grumphp-shim#30

We have a box with ext-redis 6.3, the grumphp phar has a package (symfony/cache) which declares "conflict" with ext-redis < 6.1. This causes The package "symfony/cache" conflicts with the extension "redis". in the box requirements check, even though the package only has a problem with lower versions of redis.

I then looked into the code in this project in main branch.
The code that collects version conflicts only collects package names, but not the actual version constraints.

I am not sure yet how I would reproduce this with just box, but the code itself already looks wrong.
E.g. here in AppRequirementsFactory::collectComposerLockExtensionRequirements():

            foreach ($packageInfo->getConflictingExtensions() as $extension) {
                $conflicts[$extension][] = $packageInfo->getName();
            }

The $conflicts array has no place for the extension version constraint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions