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

CircleCI phar-build job is broken #10390

Closed
edsrzf opened this issue Nov 19, 2023 · 2 comments · Fixed by #10391
Closed

CircleCI phar-build job is broken #10390

edsrzf opened this issue Nov 19, 2023 · 2 comments · Fixed by #10391

Comments

@edsrzf
Copy link
Contributor

edsrzf commented Nov 19, 2023

The CircleCI phar-build job is broken. (Example failure) According to #10363, this blocks releases.

I've been able to reproduce the failure locally with the following steps:

docker run -it --rm thecodingmachine/php:7.4-v4-cli /bin/bash
# Commands from this point are run inside the Docker container
$ git clone https://github.com/vimeo/psalm.git
$ cd psalm
$ composer install
$ bin/build-phar.sh
$ build/psalm.phar --version

This produces the error message:

PHP Fatal error:  Cannot declare class ComposerAutoloaderInit9e5dd54562a8c1ec1f3c2855414302bf, because the name is already in use in /usr/src/app/psalm/vendor/composer/autoload_real.php on line 5
Fatal error: Cannot declare class ComposerAutoloaderInit9e5dd54562a8c1ec1f3c2855414302bf, because the name is already in use in /usr/src/app/psalm/vendor/composer/autoload_real.php on line 5

From a bit of debugging, the ComposerAutoloaderInit<hash> class has the same class name in both the phar and the vendor directory. Both these autoloaders are included when psalm.phar runs, which is what causes the error. I'm not sure whether both autoloaders are supposed to be included but are expected to have different names, or whether only one should be included.

If I change into the build directory first, everything works:

$ cd build
$ ./psalm.phar --version
Psalm 5.x-dev@577808b12da647dd87abb435447dc6429361afdb

I don't know what changed or what the proper fix is, but I'm hoping that this information might be helpful and that this issue can serve as a place to discuss the problem.

Copy link

Hey @edsrzf, can you reproduce the issue on https://psalm.dev ?

@tscni
Copy link
Contributor

tscni commented Nov 21, 2023

Looks like this was caused by Composer 2.6.4 making the autoloader generation (more) reproducible (composer/composer#11663)

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 a pull request may close this issue.

2 participants