Skip to content

Replace every use of GNU Patch by the OCaml patch library #5892

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

Merged
merged 4 commits into from
Mar 27, 2025

Conversation

kit-ty-kate
Copy link
Member

@kit-ty-kate kit-ty-kate commented Mar 20, 2024

Fixes #6019
Fixes #3782 by removing any handling of chmod entirely (git extensions). Every patched files keep their permissions and every new file has the default file permission (644).
Fixes ocaml/setup-ocaml#933
Fixes #6052
see #5891

A large amount of work was necessary in the patch library to make this work. See hannesm/patch#9, hannesm/patch#7 and especially hannesm/patch#22

Moving the logic of OpamSystem.translate_patch into patch can be done later. Possibly during the 2.4 alpha phase.
The 2.4 alpha phase will also serve to test this new version of patch (3.0.0), once it has been sufficiently tested the stable release of patch.3.0.0 will be published.

@kit-ty-kate kit-ty-kate added the PR: WIP Not for merge at this stage label Mar 20, 2024
@kit-ty-kate
Copy link
Member Author

Could be coupled with ocaml-patch's implementation of diff via hannesm/patch#12

@kit-ty-kate kit-ty-kate force-pushed the internal-patch-for-repositories branch from 47f9c1e to d83fd0b Compare March 27, 2024 15:15
@kit-ty-kate kit-ty-kate added this to the 2.4.0~alpha1 milestone Sep 27, 2024
@kit-ty-kate kit-ty-kate force-pushed the internal-patch-for-repositories branch from 2841797 to 6a05509 Compare October 11, 2024 12:22
@kit-ty-kate kit-ty-kate force-pushed the internal-patch-for-repositories branch from 10a485e to 6da29f1 Compare February 15, 2025 03:25
@kit-ty-kate kit-ty-kate changed the title Apply patches when dealing with repositories via an OCaml implementation of patch Replace every use of GNU Patch by the OCaml patch library Mar 2, 2025
@kit-ty-kate kit-ty-kate force-pushed the internal-patch-for-repositories branch from 6d73281 to d133309 Compare March 10, 2025 17:40
@kit-ty-kate kit-ty-kate marked this pull request as ready for review March 10, 2025 17:40
@kit-ty-kate kit-ty-kate removed the PR: WIP Not for merge at this stage label Mar 11, 2025
@kit-ty-kate kit-ty-kate requested a review from rjbou March 11, 2025 15:44
@kit-ty-kate kit-ty-kate force-pushed the internal-patch-for-repositories branch 2 times, most recently from 93d5eb8 to b32bcea Compare March 13, 2025 22:53
Copy link
Collaborator

@rjbou rjbou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great & huge work!! Some comments on small thing, but in the idea and how it is done 💯

I'm wondering if we should have some reftest for it ? Or patch library test are enough ?
On testing, can you confirm that all opam repo patches are handled?

I think also that the single commit should be split, per "change" : * add patch lib

  • change patch function to use lib & remove the tool dependency
  • change diff function to use lib & remove the tool dependency

@kit-ty-kate kit-ty-kate requested a review from rjbou March 24, 2025 21:58
@kit-ty-kate kit-ty-kate requested a review from rjbou March 25, 2025 18:31
@kit-ty-kate kit-ty-kate force-pushed the internal-patch-for-repositories branch from 83dfa03 to 82d3207 Compare March 26, 2025 16:40
@kit-ty-kate
Copy link
Member Author

History cleaned

@kit-ty-kate kit-ty-kate force-pushed the internal-patch-for-repositories branch from 82d3207 to 7bdf02a Compare March 26, 2025 16:44
Copy link
Collaborator

@rjbou rjbou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!!!

@kit-ty-kate kit-ty-kate force-pushed the internal-patch-for-repositories branch from 7bdf02a to c2b5fcf Compare March 26, 2025 17:58
@kit-ty-kate kit-ty-kate force-pushed the internal-patch-for-repositories branch from c2b5fcf to 920f7c5 Compare March 26, 2025 18:10
@kit-ty-kate kit-ty-kate force-pushed the internal-patch-for-repositories branch from 920f7c5 to 9ad9ef5 Compare March 26, 2025 18:42
@rjbou rjbou merged commit 3f88d96 into ocaml:master Mar 27, 2025
44 checks passed
@zbroyar
Copy link

zbroyar commented Mar 27, 2025

@kit-ty-kate thanks. Great work :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants