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

Composer 2.1 and 2.2 incompatibility #18

Open
yuriysklyarenko opened this issue Jun 13, 2023 · 0 comments
Open

Composer 2.1 and 2.2 incompatibility #18

yuriysklyarenko opened this issue Jun 13, 2023 · 0 comments

Comments

@yuriysklyarenko
Copy link

We want to use the plugin on the Magento2 application, which officially supports only composer 2.2 for the fresh versions, however, the plugin throws an exception on composer versions < 2.3:

$ composer integrity

+--------+-------------------------------------------------------------------+-----------+------------------+------------------+------------+---------+
| Status | Package                                                           | Version   | Package ID       | Checksum         | Percentage | Patched |
+--------+-------------------------------------------------------------------+-----------+------------------+------------------+------------+---------+
|   ✓    | 2tvenom/cborencode                                                | 1.0.2     | 5F99DF3AE163D0FC | 7EB6DBC42A758CF7 |    98%     |   No    |
|   ✓    | allure-framework/allure-codeception                               | 1.5.2     | BCAC10B18DEB1505 | BD1D6052672950F5 |    100%    |   No    |
...
|   ✓    | wikimedia/less.php                                                | v3.1.0    | 21EB7FA165C2EF34 | 12455C57A421EF6E |    96%     |   No    |
+--------+-------------------------------------------------------------------+-----------+------------------+------------------+------------+---------+

PHP Fatal error:  Uncaught Error: Undefined constant Symfony\Component\Console\Command\Command::SUCCESS in ..vendor/sansec/composer-integrity-plugin/src/IntegrityCommand.php:77
Stack trace:
#0 phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php(245): Sansec\Integrity\IntegrityCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(835): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(185): Symfony\Component\Console\Application->doRunCommand(Object(Sansec\Integrity\ComposerIntegrityCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 phar:///usr/local/bin/composer/src/Composer/Console/Application.php(327): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(117): Composer\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 phar:///usr/local/bin/composer/src/Composer/Console/Application.php(128): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 phar:///usr/local/bin/composer/bin/composer(73): Composer\Console\Application->run()
#7 /usr/local/bin/composer(29): require('phar:///usr/loc...')
#8 {main}
  thrown in ../vendor/sansec/composer-integrity-plugin/src/IntegrityCommand.php on line 77

It works fine on composer 2.3:

$ composer -V
Composer 2.3.0 2022-03-30 11:15:36

However composer 2.2.21 and for example 2.1.14 do not work with the message above (we can see the output but due to non-zero return code it is impossible to use the plugin as a part of CICD process).

I used PHP 8.1.20:

$ php -v
PHP 8.1.20 (cli) (built: Jun  8 2023 19:55:40) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.20, Copyright (c) Zend Technologies
    with Xdebug v3.2.0, Copyright (c) 2002-2022, by Derick Rethans
    with Zend OPcache v8.1.20, Copyright (c), by Zend Technologies

Is it possible to make it compatible with composer 2.1-2.2?
Thanks!

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

No branches or pull requests

1 participant