-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Update dependencies for PHAR distribution of PHPUnit 9.6 #5712
Comments
Hello @sebastianbergmann As author of nikic/PHP-Parser#981, I approve this request, especially because it has also an impact on GitHub Action This action uses the PHAR version of PHPUnit (see https://github.com/shivammathur/setup-php/blob/v2/dist/index.js#L969) So, when we run a workflow with such declaration : uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: phpunit:9.6 We've got trouble ! For example : https://github.com/composer-unused/symbol-parser/actions/runs/7990344120/job/21818955371#step:5:15 Workaround, as suggested Nikita, is to use the And it's works ! See https://github.com/composer-unused/symbol-parser/actions/runs/7996055440 |
With PHPUnit 9.6, the
For backward compatibility, the PHAR build process for PHPUnit 9.6 installs
I do not know how. Let me explain: PHPUnit's "config": {
"platform": {
"php": "7.3.0" to make sure that no package which requires a version of PHP that is newer than PHP 7.3.0 can be installed regardless of the actual PHP version that is used to build the PHAR, for instance. This leads to version 1.6.1 of This is due to the fact that version 1.6.1 of The only solution for this problem that I can see is a version of |
@jaapio Any chance of TypeResolver supporting PHP 7.3 ? |
@sebastianbergmann Thank you the detailed explanation! The easiest solution would probably be to release a 1.6.2 version of phpdocumentor/type-resolver with that patch cherry-picked. But maybe this isn't worth the bother, given that using phpunit as a dev dependency avoids the problem. |
I think we can fix that quite easy, will investigate that tomorrow and create a new release 1.6.2 |
I managed to have a look today, what would be the easiest way for me to validate this issue is solved before I create a new release? The new release will be based on 1.8.1 and has support for php 7.3 I cannot go lower without to many changed. |
I do not how this could be validated before the release. Once that release has been made, you can use |
Ok, will give it a try |
1.6.2 was already tagged in October 2022. We are talking about 1.6.3 as the new version here, right? |
Oh, that's tricky. I didn't realize that the PHP 7.4 requirement was added in 1.6.2, rather than 1.7.0. In that case the version would have to be something like |
@nikic If we follow real semantic perharps. But for an older version I think we may accept to downgrade PHP compatibility between 1.6.2 ( |
I was thinking about reintroducing php 7.3 support in our main branch and release 1.8.2 because that version is compatible with php-parser 5 |
PR is ready, please let me know what you think, apart from 7.3 drop there is nothing breaking, yes we had to remove all typed properties. But that's about it |
@sebastianbergmann Just a little question about PHPUnit 9.6 : I don't see any schema |
@jaapio I 've checked your PR and check your new branch I've re-tested again the https://github.com/composer-unused/symbol-parser project on PHP 7.4 platform
With With a rebuild of PHPUnit 9.6 with code of https://github.com/phpDocumentor/TypeResolver/tree/php73 seems works fine !
|
Thanks for confirming, I will merge this and tag a new version |
Hope I don't missed anything ;-) |
@jaapio Is it not supposed to release a 1.6.3 rather than https://github.com/phpDocumentor/TypeResolver/releases/tag/1.8.2 ? |
No, because the base version was 1.8.1, the 1.6 series is not compatible with the new php parser, it would have resulted in the same errors. |
I just noticed that with -phpunit/phpunit: 9.6.16
+phpunit/phpunit: 9.6@b59fa6534869a57ccfe0142d08aef3db59cd2680
+doctrine/deprecations: 1.1.3
doctrine/instantiator: 1.5.0
myclabs/deep-copy: 1.11.1
nikic/php-parser: v4.18.0
@@ -6,8 +7,9 @@
phar-io/version: 3.2.1
phpdocumentor/reflection-common: 2.2.0
phpdocumentor/reflection-docblock: 5.3.0
-phpdocumentor/type-resolver: 1.6.1
+phpdocumentor/type-resolver: 1.8.2
phpspec/prophecy: v1.18.0
+phpstan/phpdoc-parser: 1.25.0
phpunit/php-code-coverage: 9.2.30
phpunit/php-file-iterator: 3.0.6
phpunit/php-invoker: 3.1.1 |
That's correct, we use the doctrine/deprecations and stan parser to process the new types like array shapes |
I have released PHPUnit 9.6.17. The PHAR for this release has the updated dependencies. |
I confirmed that all still run fine with official PHAR release 9.6.17 on PHP 7.4 and 8.2 (my quick tests about contextual project https://github.com/composer-unused/symbol-parser/ that used nikic/php-parser 4.18 or 5.0) |
Summary
Based on the composer.lock file in the phar, it currently contains
phpdocumentor/type-resolver
version 1.6.1, which is quite old (predating the release date of PHPUnit 9.6.16 significantly). In particular, it does not contain the fix for PHP-Parser 5 compatibility in phpDocumentor/TypeResolver#197, which is part of 1.7.4. This caused a good bit of confusion over in nikic/PHP-Parser#981, because an error was only reproducible with the phpunit phar release, but not the composer dev dependency.Is it possible to update this dependency? It's not really obvious to me how this version is determined, because the composer.lock in the phar doesn't seem to match https://github.com/sebastianbergmann/phpunit/blob/9.6/composer.lock at all (that one does not contain phpdocumentor/type-resolver in the first place).
The text was updated successfully, but these errors were encountered: