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
Psalm 4.20.0 PHAR does not report correction version #7606
Comments
Hey @sebastianbergmann, can you reproduce the issue on https://psalm.dev ? |
I've had a quick look. I note that the version number is set using the PackageVersions dependency, which appears to try to extract the version number from the composer.lock file. I've extracted my phar archive and I observed that there is no composer.json or compser.lock file in it. This is probably the cause of the problem. Maybe someone just needs to include the composer.lock file in the phar archive to resolve this. It's a pain if it's not possible to determine the version of psalm from the phar archive. Please could someone investigate the above? |
Interesting. I don't have much experience using phar, would you mind providing a PR for that? It would be cool to have this fixed indeed |
I don't have experience of building phars (only using them!) and I don't have any experience/knowledge of the inner workings of psalm either. So, I'm starting from nothing here. I've had a dig around the code, and as far as I can tell, the building of the phar is outsourced to a dependency called box:
The box documentation says that, by default, composer.json and composer.lock files are excluded: https://github.com/box-project/box/blob/4.0.2/doc/configuration.md#excluding-the-composer-files-exclude-composer-files They can be included by setting So, a possible solution would be to add |
Compatibility between `ocramius/package-versions`, `composer/package-versions-deprecated`, `composer-runtime-api` and `humbug/box` (with `humbug/scoper` further complicating things)has been always a problematic area. So instead of trying to keep up with all the changes in all of those packages, we will now bake the version data (for the packages we need) into the PHAR file itself. Fixes vimeo#7606 Fixes vimeo#5399
Some months ago I opened issue #7921 and I was told its a duplicate of this issue, which appears "closed". But even today with version 5.4.0 the
Still no real version, I expected to see 5.4.0 and not dev-master@. Thank you. PS: |
We were overriding the root version with COMPOSER_ROOT_VERSION, so all PHARs had `dev-master` as the version for `vimeo/psalm` baked in. Fixed vimeo#7606
Actual
Expected
The text was updated successfully, but these errors were encountered: