-
Notifications
You must be signed in to change notification settings - Fork 213
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
Pull Request for Bug #533 #537
base: devel
Are you sure you want to change the base?
Conversation
Fixes miyagawa#533. This also removes the numify_ver_metacpan method, since alpha version matching is now in sync between 'version' and MetaCPAN's API.
I don't quite understand the point of this PR. Now that cpanminus queries are going through a shim, there is little point in changing the query sent to metacpan. Changing it only means more work in the shim to accommodate additional forms of the query. The shim and the download_url endpoint that it uses will accept versions in any form and handle them appropriately. If there is a problem in that code, it will need to be handled in metacpan, not cpanm. The only changes that would be sensible to make to cpanm's usage of metacpan is to convert to the /download_url/ endpoint, like #522. |
Ultimately, the point of this PR is to fix the root problem of #533, or more specifically Perl-Toolchain-Gang/CPAN-Meta-Requirements#32, which is illustrated in The TravisCI failures above appear to be related to the older version of CMR in the fatpack. I was about to push those changes up, but if you have a different approach, we can close this and move the conversation there. |
To clarify the situation with the shim: MetaCPAN is going to be decommissioning the v0 API soon, so we are doing what we can for backwards compatibility. We've worked with current users of the v0 API to migrate to v1. We can't fix deployed versions of cpanm though, so we've developed a shim to allow it to work even after the v0 API goes away. Part of what the v1 API provides is a /download_url/ end point. Given a module, a version, and a flag to include development versions, it will provide a download URL. The query used for that internally is actually based on the one in cpanm. The shim layer takes the query cpanm sends and converts it back into the module, version, and dev flag. It then uses the /download_url/ end point to find the correct dist information. It is rather strict about the query forms it accepts: it only accepts the exact forms that cpanm uses (or has used). Modifications to the form of the query cpanm sends will result in the shim refusing to parse it, and wouldn't change the output even if they were handled by the shim. If there are issues with the handling of the version or dev flag, those are in the MetaCPAN API. I've already changed the API to numify the versions when doing an exact match. I believe there may still be an issue with the handling of the dev flag though. |
Checking the new test against the original 'devel' branch, there's still this case:
MetaCPAN did find the match, but cpanm didn't believe the result, because its own comparison failed. This may just be a case of cpanm needing a CMR+version upgrade within its fatpacked libs. However, it looks like the upgrader needs some work to get it to install version correctly, so I can't test that scenario at the moment. |
Not sure how to proceed here. We can't get away with a shim-only fix, since cpanm does its own |
The changes to the metacpan query used should be removed from this PR. Then it would probably be suitable for merging. |
This is the PR for #533.