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

Update dependencies for compatibility with PHP 8.0 #4200

Closed
1 task done
morozov opened this issue Aug 6, 2020 · 5 comments · Fixed by #4203 or #4207
Closed
1 task done

Update dependencies for compatibility with PHP 8.0 #4200

morozov opened this issue Aug 6, 2020 · 5 comments · Fixed by #4203 or #4207
Assignees
Milestone

Comments

@morozov
Copy link
Member

morozov commented Aug 6, 2020

$ php --version
PHP 8.0.0beta1 (cli) (built: Aug  6 2020 12:22:10) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.0beta1, Copyright (c), by Zend Technologies
    with Xdebug v3.0.0-dev, Copyright (c) 2002-2020, by Derick Rethans

$ composer install
composer install 
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for phpdocumentor/reflection-docblock 5.1.0 -> satisfiable by phpdocumentor/reflection-docblock[5.1.0].
    - phpdocumentor/reflection-docblock 5.1.0 requires ext-filter ^7.1 -> the requested PHP extension filter has the wrong version (8.0.0beta1) installed.
  Problem 2
    - phpdocumentor/reflection-docblock 5.1.0 requires ext-filter ^7.1 -> the requested PHP extension filter has the wrong version (8.0.0beta1) installed.
    - phpspec/prophecy v1.10.3 requires phpdocumentor/reflection-docblock ^2.0|^3.0.2|^4.0|^5.0 -> satisfiable by phpdocumentor/reflection-docblock[5.1.0].
    - Installation request for phpspec/prophecy v1.10.3 -> satisfiable by phpspec/prophecy[v1.10.3].

$ composer why phpdocumentor/reflection-docblock
felixfbecker/advanced-json-rpc  v3.1.1  requires  phpdocumentor/reflection-docblock (^4.0.0 || ^5.0.0)       
phpspec/prophecy                1.9.0   requires  phpdocumentor/reflection-docblock (^2.0|^3.0.2|^4.0|^5.0)  

$ composer why felixfbecker/advanced-json-rpc     144ms
vimeo/psalm  3.11.5  requires  felixfbecker/advanced-json-rpc (^3.0.3)

Updating Psalm to ^3.13 solves the dependency problem but psalm itself fails after the update regardless of the PHP version:

$ composer update vimeo/psalm --with-dependencies
Dependency "nikic/php-parser" is also a root requirement, but is not explicitly allowed. Ignoring.
Dependency "composer/package-versions-deprecated" is also a root requirement, but is not explicitly allowed. Ignoring.
Dependency "symfony/console" is also a root requirement, but is not explicitly allowed. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 10 updates, 0 removals
  - Updating symfony/polyfill-ctype (v1.17.0 => v1.18.1): Loading from cache
  - Updating webmozart/assert (1.8.0 => 1.9.1): Loading from cache
  - Updating sebastian/diff (4.0.1 => 4.0.2): Loading from cache
  - Updating phpdocumentor/reflection-common (2.1.0 => 2.2.0): Loading from cache
  - Updating phpdocumentor/type-resolver (1.1.0 => 1.3.0): Loading from cache
  - Updating phpdocumentor/reflection-docblock (5.1.0 => 5.2.0): Loading from cache
  - Updating composer/xdebug-handler (1.4.1 => 1.4.2): Loading from cache
  - Updating amphp/amp (v2.4.4 => v2.5.0): Loading from cache
  - Updating amphp/byte-stream (v1.7.3 => v1.8.0): Loading from cache
  - Updating vimeo/psalm (3.11.5 => 3.13.1):  Checking out afd8874a9e
Writing lock file
Generating autoload files
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
25 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

$ psalm --threads=1
Scanning files...
Analyzing files...

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░E░░░░░░░░░░░░░░  60 / 431 (13%)
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 120 / 431 (27%)
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░Uncaught Psalm\Exception\ComplicatedExpressionException in /home/morozov/Projects/dbal/vendor/vimeo/psalm/src/Psalm/Type/Algebra.php:670
Stack trace:
#0 /home/morozov/Projects/dbal/vendor/vimeo/psalm/src/Psalm/Type/Algebra.php(816): Psalm\Type\Algebra::groupImpossibilities(Array)
#1 /home/morozov/Projects/dbal/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Block/SwitchCaseAnalyzer.php(381): Psalm\Type\Algebra::negateFormula(Array)
#2 /home/morozov/Projects/dbal/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Block/SwitchAnalyzer.php(118): Psalm\Internal\Analyzer\Statements\Block\SwitchCaseAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(Psalm\Codebase), Object(PhpParser\Node\Stmt\Switch_), NULL, Object(PhpParser\Node\Stmt\Case_), Object(Psalm\Context), Object(Psalm\Context), 'return_throw', Array, true, Object(Psalm\Internal\Scope\SwitchScope))
#3 /home/morozov/Projects/dbal/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(480): Psalm\Internal\Analyzer\Statements\Block\SwitchAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\Switch_), Object(Psalm\Context))
#4 /home/morozov/Projects/dbal/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(169): Psalm\Internal\Analyzer\StatementsAnalyzer::analyzeStatement(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\Switch_), Object(Psalm\Context), NULL)
#5 /home/morozov/Projects/dbal/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php(198): Psalm\Internal\Analyzer\StatementsAnalyzer->analyze(Array, Object(Psalm\Context))
#6 /home/morozov/Projects/dbal/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php(308): Psalm\Internal\Analyzer\Statements\Block\LoopAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Array, Array, Array, Object(Psalm\Internal\Scope\LoopScope), Object(Psalm\Context), false, false)
#7 /home/morozov/Projects/dbal/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(460): Psalm\Internal\Analyzer\Statements\Block\ForeachAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\Foreach_), Object(Psalm\Context))
#8 /home/morozov/Projects/dbal/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(169): Psalm\Internal\Analyzer\StatementsAnalyzer::analyzeStatement(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\Foreach_), Object(Psalm\Context), Object(Psalm\Context))
#9 /home/morozov/Projects/dbal/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php(564): Psalm\Internal\Analyzer\StatementsAnalyzer->analyze(Array, Object(Psalm\Context), Object(Psalm\Context), true)
#10 /home/morozov/Projects/dbal/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/ClassAnalyzer.php(1887): Psalm\Internal\Analyzer\FunctionLikeAnalyzer->analyze(Object(Psalm\Context), Object(Psalm\Internal\Provider\NodeDataProvider), Object(Psalm\Context))
#11 /home/morozov/Projects/dbal/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/ClassAnalyzer.php(739): Psalm\Internal\Analyzer\ClassAnalyzer->analyzeClassMethod(Object(PhpParser\Node\Stmt\ClassMethod), Object(Psalm\Storage\ClassLikeStorage), Object(Psalm\Internal\Analyzer\ClassAnalyzer), Object(Psalm\Context), Object(Psalm\Context))
#12 /home/morozov/Projects/dbal/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/FileAnalyzer.php(217): Psalm\Internal\Analyzer\ClassAnalyzer->analyze(Object(Psalm\Context), Object(Psalm\Context))
#13 /home/morozov/Projects/dbal/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Analyzer.php(349): Psalm\Internal\Analyzer\FileAnalyzer->analyze(NULL)
#14 /home/morozov/Projects/dbal/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Analyzer.php(583): Psalm\Internal\Codebase\Analyzer->Psalm\Internal\Codebase\{closure}(161, '/home/morozov/P...')
#15 /home/morozov/Projects/dbal/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Analyzer.php(275): Psalm\Internal\Codebase\Analyzer->doAnalysis(Object(Psalm\Internal\Analyzer\ProjectAnalyzer), 1)
#16 /home/morozov/Projects/dbal/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php(630): Psalm\Internal\Codebase\Analyzer->analyzeFiles(Object(Psalm\Internal\Analyzer\ProjectAnalyzer), 1, false, true)
#17 /home/morozov/Projects/dbal/vendor/vimeo/psalm/src/psalm.php(666): Psalm\Internal\Analyzer\ProjectAnalyzer->check('/home/morozov/P...', false)
#18 /home/morozov/Projects/dbal/vendor/vimeo/psalm/psalm(2): require_once('/home/morozov/P...')
#19 {main}
(Psalm 3.13.1@afd8874a9e4562eac42a02de90e42e430c3a1db1 crashed due to an uncaught Throwable)

TODO:

@morozov morozov added the Blocker label Aug 6, 2020
@morozov morozov added this to the 3.0.0 milestone Aug 6, 2020
@morozov
Copy link
Member Author

morozov commented Aug 6, 2020

The failure is caused by vimeo/psalm#3954.

@morozov morozov linked a pull request Aug 7, 2020 that will close this issue
@morozov
Copy link
Member Author

morozov commented Aug 7, 2020

Additionally, the currently locked version of composer/package-versions-deprecated is incompatible with PHP 8:

$ cat composer.json
{
    "require": {
        "doctrine/dbal": "3.0.x-dev"
    }
}

$ composer update

  Problem 1
    - doctrine/dbal 3.0.x-dev requires composer/package-versions-deprecated ^1.8 -> satisfiable by composer/package-versions-deprecated[1.10.99, 1.8.0, 1.8.1, 1.8.2].
    - doctrine/dbal 3.0.x-dev requires composer/package-versions-deprecated ^1.8 -> satisfiable by composer/package-versions-deprecated[1.10.99, 1.8.0, 1.8.1, 1.8.2].
    - composer/package-versions-deprecated 1.8.2 requires php ^7 -> your PHP version (8.0.0beta1) does not satisfy that requirement.
    - composer/package-versions-deprecated 1.8.1 requires php ^7 -> your PHP version (8.0.0beta1) does not satisfy that requirement.
    - composer/package-versions-deprecated 1.8.0 requires php ^7 -> your PHP version (8.0.0beta1) does not satisfy that requirement.
    - composer/package-versions-deprecated 1.10.99 requires php ^7 -> your PHP version (8.0.0beta1) does not satisfy that requirement.
    - composer/package-versions-deprecated 1.10.99 requires php ^7 -> your PHP version (8.0.0beta1) does not satisfy that requirement.
    - Installation request for doctrine/dbal 3.0.x-dev -> satisfiable by doctrine/dbal[3.0.x-dev].

See composer/package-versions-deprecated#7.

@LocalHeroPro
Copy link

  - Installing composer/package-versions-deprecated (1.11.99.4): Extracting archive
composer/package-versions-deprecated contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "composer/package-versions-deprecated" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] 

That package is now EOL: https://github.com/composer/package-versions-deprecated#readme

@morozov
Copy link
Member Author

morozov commented Dec 23, 2021

The dependency on this package will be removed in 3.3.0. See #5078.

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.