Skip to content
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

Allow specifying command to apply patches #4551

Closed
MisterDA opened this issue Feb 16, 2021 · 3 comments
Closed

Allow specifying command to apply patches #4551

MisterDA opened this issue Feb 16, 2021 · 3 comments

Comments

@MisterDA
Copy link
Contributor

MisterDA commented Feb 16, 2021

The patches field allows listing patches that are applied sequentially to the source as with the patch command, however not all patches are created equal. For instance, Git has a custom format for binary diffs that the venerable patch utility doesn't understand. In order to support such patches, the patch utility should be changed to git apply (although I haven't yet checked if that works outside a git repo). An example of a binary file that cannot be patched easily today is the configure script from the OCaml compiler.

@rjbou
Copy link
Collaborator

rjbou commented Feb 16, 2021

It is not possible ftm to specify a patch command, as for make, curl, etc. [g]patch is an opam required tool, but even if git is widely used, it is not required by opam. There is several issues where pops the idea to use an ocaml written patch, to get ride of some patch limits (see #3782 (comment)).

@dra27
Copy link
Member

dra27 commented Feb 16, 2021

Early versions of the Windows patches used git apply during 2.0 development... it was unreliable which is why the patch rewriter got added. It just swaps one set of problems for another 😉

@rjbou has referenced the tracking issue - for the time being, it's better to amend the patch - see, for example, https://github.com/ocaml/opam/blob/master/shell/re-patch.sh

@dra27
Copy link
Member

dra27 commented Mar 12, 2021

Closing this in favour of the main patch issue

@dra27 dra27 closed this as completed Mar 12, 2021
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

3 participants