Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Temporarily workaround a missing conflict in symfony/type-info #10

Open
wants to merge 1 commit into
base: 2.0.x
Choose a base branch
from

Conversation

bnf
Copy link
Member

@bnf bnf commented Nov 13, 2024

symfony/type-info is currently not compatible to phpstan/phpdoc-parser 2.x which results in a PHP error in extbase modules as shown in https://forge.typo3.org/issues/105582. A fix has been merged upstream, but has not been released yet and it seems there will be no immediate hotfix release by symfony – that means it will only be released by the end of the month [2]).

Explanation of the issue:

phpdocumentor/reflection-docblock 5.6.0 [1] was released yesterday which allows composer install and composer update to raise phpstan/phpdoc-parser to 2.x.

Since symfony/type-info has an optional dependency to phpstan/phpdoc-parser, a conflict is used to express the supported version. This upstream conflict has a weak range [3] as it only forbids incompatible old versions, but not new upcoming major(!) versions.
The statement "conflict": "<1.0"[3] forbids to install any version before 1.0, but missed to opt out from future major releases (which are allowed to be breaking per semver).

Now that phpstan/phpdoc-parser 2.x has been released and is allowed to be installed by other dependencies like
phpdocumentor/reflection-docblock (which is perfectly fine), this range flaw got revealed.

This workaround will be removed once symfony/type-info has been updated to allow an upgrade to phpstan/phpdoc-parser. For that reason this conflict is only added to this composer-only package to avoid a comlete TYPO3 release and is not added to extbase (extbase is not incompatible, symfony/type-info is).

[1] https://github.com/phpDocumentor/ReflectionDocBlock/releases/tag/5.6.0
[2] symfony/symfony#58800 (comment)
[3] https://github.com/symfony/type-info/blob/v7.1.6/composer.json#L36-L37
[4] symfony/symfony#58800 (comment)

@bnf
Copy link
Member Author

bnf commented Nov 13, 2024

Tested against latest public TYPO3 v10 with a faked local v2.0.1 release:

composer update
Composer could not detect the root package (typo3/cms-base-distribution) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 2 updates, 0 removals
  - Downgrading phpstan/phpdoc-parser (2.0.0 => 1.33.0)
  - Upgrading typo3/cms-cli (2.0.0 => 2.0.1)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 2 updates, 0 removals
  - Removing typo3/cms-cli (2.0.0)
  - Downgrading phpstan/phpdoc-parser (2.0.0 => 1.33.0): Extracting archive

Verified

This commit was signed with the committer’s verified signature.
bnf Benjamin Franzke
`symfony/type-info` is currently not compatible to
`phpstan/phpdoc-parser` 2.x which results in a PHP error in extbase
modules as shown in https://forge.typo3.org/issues/105582.
A fix has been merged upstream, but has not been released yet and
it seems there will be no immediate hotfix release by symfony – that
means it will only be released by the end of the month [2]).

Explanation of the issue:

`phpdocumentor/reflection-docblock` 5.6.0 [1] was released yesterday
which allows `composer install` and `composer update` to raise
`phpstan/phpdoc-parser` to 2.x.

Since symfony/type-info has an optional dependency to
`phpstan/phpdoc-parser`, a conflict is used to express the
supported version. This upstream conflict has a weak range [3]
as it only forbids incompatible old versions, but not new upcoming
*major*(!) versions.
The statement `"conflict": "<1.0"`[3] forbids to install any
version before 1.0, but missed to opt out from future major releases
(which are allowed to be breaking per semver).

Now that `phpstan/phpdoc-parser` 2.x has been released and is allowed
to be installed by other dependencies like
`phpdocumentor/reflection-docblock` (which is perfectly fine), this
range flaw got revealed.

This workaround will be removed once `symfony/type-info` has been
updated to allow an upgrade to `phpstan/phpdoc-parser`. For that
reason this conflict is only added to this composer-only package
to avoid a comlete TYPO3 release and is not added to extbase
(extbase is not incompatible, `symfony/type-info` is).

[1] https://github.com/phpDocumentor/ReflectionDocBlock/releases/tag/5.6.0
[2] symfony/symfony#58800 (comment)
[3] https://github.com/symfony/type-info/blob/v7.1.6/composer.json#L36-L37
[4] symfony/symfony#58800 (comment)
@bnf bnf force-pushed the symfony-typeinfo-workaround-2.x branch from df2a4ea to 1701c59 Compare November 13, 2024 13:26
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.

None yet

1 participant