Skip to content

Warn when a root constraint bypasses extra.symfony.require - #1100

Open
Amoifr wants to merge 1 commit into
symfony:2.xfrom
Amoifr:fix-1073-warn-exempted-packages
Open

Warn when a root constraint bypasses extra.symfony.require#1100
Amoifr wants to merge 1 commit into
symfony:2.xfrom
Amoifr:fix-1073-warn-exempted-packages

Conversation

@Amoifr

@Amoifr Amoifr commented Aug 19, 2026

Copy link
Copy Markdown

Fixes the silent part of #1073.

Since #713, a root constraint that has no intersection with extra.symfony.require wins over it, on purpose: that's what allows requiring symfony/foo:dev-main while the filter is active. But the same rule kicks in when the root constraint is disjoint by mistake (e.g. "symfony/yaml": "^6.0 || ^7.4" with SYMFONY_REQUIRE=8.*): the package is silently kept unrestricted and the solver happily picks a version outside the requested range, which is how #1073 went unnoticed.

This keeps the #713 behavior untouched and simply makes the exemption loud, once per package:

Version constraint "^6.0 || ^7.4" for "symfony/yaml" has no intersection with "8.*", keeping the package unrestricted

The $this->io = null trick used to print the "Restricting packages" notice once is replaced with a boolean flag, as it would otherwise swallow warnings emitted after it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant