Skip to content

Patch sort order issues with Gitlab's Composer package registry #407

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

Closed
xurizaemon opened this issue Jun 8, 2022 · 3 comments
Closed

Patch sort order issues with Gitlab's Composer package registry #407

xurizaemon opened this issue Jun 8, 2022 · 3 comments

Comments

@xurizaemon
Copy link

xurizaemon commented Jun 8, 2022

This is a PSA, not an issue against this project. (Unless JSON specifies that sort order is undetermined?)

When applying patches from a dependency which is hosted on Gitlab's Composer package registry, patches supplied from the dependency (along with require and require-dev entries, and any other key-value JSON data) may be reordered unexpectedly.

This can cause patches to fail application if they are not applied in the order they were provided in the dependency's composer.json.

Gitlab's behaviour appears to be to sort patches by the length of the patch key, shortest first.

An external composer.patches.json is a reasonable workaround, although path considerations come into play if you're doing that from a required package.

See https://gitlab.com/gitlab-org/gitlab/-/issues/364606 for the issue against Gitlab.

@cweagans
Copy link
Owner

cweagans commented Feb 7, 2023

main no longer resolves patches from dependencies, so this shouldn't be an issue.

@xurizaemon
Copy link
Author

xurizaemon commented Feb 9, 2023

Thanks for the update, and closing this!

I see that on main at present patching from dependencies is still documented as supported.

I'm guessing a README update for that will be on your radar as it looks like there's lots of activity atm.

@cweagans
Copy link
Owner

1.x (which is based on the 1.x branch) still supports that. I don't plan on changing that. 2.x (which will eventually be tagged on main won't support it. Documentation is definitely on my radar :)

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

No branches or pull requests

2 participants