Closed drupol closed 11 months ago
Oh, I think I accidentally built it with php 8.2...
Will have to look at it when I find more time to see how I can fix this because it's already tagged.
Also I'll have to think about how I can avoid this issue in the future probably :)
Great. Looking forward packaging this in Nix then... Thank you mate!
Hello,
Just took a closer look. It seems like the phar got compiled correctly and the lock file is valid given the way it has been built. Can you give me some more details on how to reproduce the error on my system? A list of commands to execute manually would be nice!
There are 2 things in your diff:
plugin-api-version
: This one is added based on the composer version that built the lock file. Not sure why it changed on your machine since it is locked at 2.3 during build.platform-overrides
get cleared. I lock the dependencies at the minimum supported PHP version to assume it keeps on working in upstream PHP releases since it does not include any newer PHP syntax. You might need to lock this one in your script as well? I'm currently using PHP=8.1
to compile everythingCurrently I'm building this stuff locally. It might make sense to either do it in a pipeline with stable dependencies or maybe through a flake to make sure it gets compiled consistently. However, I don't think the issue here is the provided lock file.
Right, let me retry the procedure with PHP 8.1.
I can reproduce the issue with PHP 8.1, see this quick screencast: https://asciinema.org/a/1vlHjh3G6RIiDQAk5nr66KQNY
The validate problem might be related to the platform.php
configuration we set when building the phar:
https://github.com/phpro/grumphp-shim/blob/36418a55fe97b1b6b12272b31ae261f1c66a6b48/Makefile#L43
You might need to run this command on the grumphp directory as well, so that the composer.json file has the correct configuration as well. Which results in this lock:
The API version of composer plugins is set because you are using a more recent composer version as I do. Yet I don't think validate complains about this.
@drupol Can you revalidate on tag v2.2.0?
Sadly nope :( https://asciinema.org/a/gldqtNIjSwXv1hMJOVB7VRdeJ
Hint 1: How about committing platform.php
to the lowest supported PHP version in composer.json
?
Hint 2: how about just exposing the composer.lock
available as a release artifact (so you don't need to commit it anymore)
Hint 3: ext-json
is not more mandatory in composer.json
, it's enabled by default in PHP >= 8.
Can you figure out exactly what is not ok?
Hint 1 is not possible: I cannot set that config on the main repo, cause it's installable on al versions and otherwise ci will start fetching invalid resources maybe you could use the exact same composer command for setting the php config instead of patching?
Hint 2 is possible but doesnt fix the issue right?
Hint 3 not sure if you can install php without Json, but that shouldn't cause any issues right?
I'm lacking time to doing deep dives into this. All the tools you need to build the lock a f phar are in this repo. Feel free to see if you can find a way to do this from within this repo.
Hello @drupol,
Thanks for guiding me through this at SymfonyCon. I'm now shipping the composer.lock file at the GrumPHP repository as well. This PHAR is built based on that lock file (with some additional "optional" dependencies). The resulting phar lock file is still being committed to this repo, so it can be investigated as well.
This should make it reproducable from your end:
WOW, that's a breakthrough !
Thank you Toon !!!!
Oh yes, forgot to mention:
If you want the phparser task to work, you'll need to bake in composer require 'nikic/php-parser:~4.0' --update-no-dev --no-interaction
. It's an optional dependency for grumphp for that task, but it breaks if it's not baked in because of php-scoper.
Hello,
I'm trying to update the Nix package with the new Composer builder, and it's failing at validating the
composer.lock
file.Here's how to reproduce it locally:
Here's the diff of the updated
composer.lock
:Do you think you could have some time to look at it?
Related PRs: