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

RFC: Compatibility with composer/composer 2.3.x #694

Open
BSchwetzel opened this issue Mar 30, 2022 · 4 comments
Open

RFC: Compatibility with composer/composer 2.3.x #694

BSchwetzel opened this issue Mar 30, 2022 · 4 comments
Labels

Comments

@BSchwetzel
Copy link

BSchwetzel commented Mar 30, 2022

Describe the bug
I believe satis is no longer working with Composer 2.3:

To Reproduce
Try a satis build with Composer 2.3

Outcome

$ php satis/bin/satis build -vvv satis.json /var/jenkins_home/composer-repo

In BaseCommand.php line 59:
[RuntimeException]                                                           
Composer commands can only work with an Composer\Console\Application instance set

Exception trace:
  at /var/jenkins_home/jobs/XXX/jobs/satis-update/workspace/satis/vendor/composer/composer/src/Composer/Command/BaseCommand.php:59
 Composer\Command\BaseCommand->getApplication() at /var/jenkins_home/jobs/XXX/jobs/satis-update/workspace/satis/src/Console/Command/BuildCommand.php:183
 Composer\Satis\Console\Command\BuildCommand->execute() at /var/jenkins_home/jobs/XXX/jobs/satis-update/workspace/satis/vendor/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at /var/jenkins_home/jobs/XXX/jobs/satis-update/workspace/satis/vendor/symfony/console/Application.php:1015
 Symfony\Component\Console\Application->doRunCommand() at /var/jenkins_home/jobs/XXX/jobs/satis-update/workspace/satis/vendor/symfony/console/Application.php:299
 Symfony\Component\Console\Application->doRun() at /var/jenkins_home/jobs/XXX/jobs/satis-update/workspace/satis/src/Console/Application.php:49
 Composer\Satis\Console\Application->doRun() at /var/jenkins_home/jobs/XXX/jobs/satis-update/workspace/satis/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at /var/jenkins_home/jobs/XXX/jobs/satis-update/workspace/satis/bin/satis:60

build [--repository-url REPOSITORY-URL] [--repository-strict] [--no-html-output] [--skip-errors] [--stats] [--minify] [--] [<file> [<output-dir> [<packages>...]]]

Expected behavior

$ php satis/bin/satis build -vvv satis.json /var/jenkins_home/composer-repo

Loading config file /var/jenkins_home/jobs/XXX/jobs/satis-update/workspace/auth.json
Checked CA file /etc/pki/tls/certs/ca-bundle.crt does not exist or it is not a file.
Checked directory /etc/pki/tls/certs/ca-bundle.crt does not exist or it is not a directory.
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/var/jenkins_home/jobs/XXX/jobs/satis-update/workspace): git branch -a --no-color --no-abbrev -v
Executing command (/var/jenkins_home/jobs/XXX/jobs/satis-update/workspace): git rev-list remotes/origin/master..ab5180af5811f3cd4d23691542f9be02f6556f4c
Executing command (/var/jenkins_home/jobs/XXX/jobs/satis-update/workspace): git describe --exact-match --tags
...

Additional context

Before every satis build we execute a composer update inside our satis directory (the one created by composer create-project composer/satis:dev-main --stability=dev --remove-vcs). Today this updated composer:

Updating dependencies
Lock file operations: 0 installs, 2 updates, 0 removals
  - Upgrading composer/composer (2.2.10 => 2.3.0)
  - Upgrading composer/pcre (1.0.1 => 3.0.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 2 updates, 0 removals
  - Downloading composer/pcre (3.0.0)
  - Downloading composer/composer (2.3.0)
  - Upgrading composer/pcre (1.0.1 => 3.0.0): Extracting archive
  - Upgrading composer/composer (2.2.10 => 2.3.0): Extracting archive
Generating autoload files

After that the job failed, as is shown in the outcome section above.

To make it work again I executed the following in the satis directory:

composer req -W 'composer/composer:<2.3.0'

Then the output was again like shown in expected behaviour.

@BSchwetzel BSchwetzel added the bug label Mar 30, 2022
@alcohol
Copy link
Member

alcohol commented Mar 31, 2022

I've noticed that there were several releases for the 2.3 branch of composer/composer since then with numerous bugfixes. Can you check if the latest release (2.3.2) still causes issues?

@BSchwetzel
Copy link
Author

BSchwetzel commented Mar 31, 2022

Unfortunately, 2.3.2 still has the same issue.

@alcohol
Copy link
Member

alcohol commented Apr 1, 2022

Alright, I updated the composer.json to reflect this. Also updating your OP.

@alcohol alcohol changed the title Satis no longer working with Composer 2.3? RFC: Compatibility with composer/composer 2.3.x Apr 1, 2022
@alcohol alcohol added feature and removed bug labels Apr 1, 2022
@ralflang
Copy link
Contributor

I think I fixed 2.3 and 2.4 compat in #700 - unfortunately that is not fit for simply being a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants