-
Notifications
You must be signed in to change notification settings - Fork 31
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
Sort releases in XML files by version instead of date #92
Conversation
The underlying issue happened again today with the protobuf extension: they released version 3.23.0 on 2023-05-08 and version 3.22.5 on 2023-05-10, so its |
@derickr so, this PR has been merged, right? Also, reading for example https://pecl.php.net/rest/r/protobuf/allreleases.xml, it seems you already executed bin/generate-rest.php, right? |
Hi, Yes, this PR has been merged, and I did run In order to debug this, I wanted to run Once done, I then ran
It turned out that there is some bug in the PEAR/PECL installer, where it doesn't close file handles… a file handle leak so to speak. I solved it by setting the number of allowed open files to a higher number with cheers, |
@derickr the PHP community is very lucky to count you among its members. Thank you!!! |
Why we previously forced versions? See #723 Why we don't need that anymore? See php/web-pecl#92 Test: grpc, protobuf
I've started this discussion in the pecl-dev mailing list, but no one replied to it 😢 Let's see if we can start the discussion here instead... 😉
We can install PHP extensions by fetching them from the PECL website with
Where can be:
snapshot
,devel
,alpha
,beta
, orstable
)^\d+(\.\d+)*([a-zA-Z]+\d*)?$
if
<spec>
is not specified, it's assumed to bestable
When pecl resolves the actual version to be installed, it fetches
http://pecl.php.net/rest/r/<package-handle>/allreleases.xml
and returns the first version that's exactly the version specified, or has at least the stability specified (see here).The versions in the
allreleases.xml
file are sorted by the release date.That way, pecl considers as the "last" stable version the most recent one.
This works fine for packages that are published in a "linear" way.
Problems arise when there are multiple versions maintained for a package (grpc and protobuf are good examples).
For example, protobuf maintainers published version 3.21.6 on 2022-09-13 and version 3.18.3 one day later.
So, in its
allreleases.xml
we have that 3.18.3 comes before 3.21.6, and pecl would have picked up the former instead of the latter.And this is a big problem: users aren't installing the most recent "stable" version.
I think that the easiest and cleanest solution would be to fix the code that generates the
allreleases.xml
file: it should sort the versions with theversion_compare()
PHP function.PS: is this PR gets merged, someone who has access should regenerate the
allreleases.xml
files for every package published on the PECL archive (I think by executing thebin/generate-rest.php
file).