-
Notifications
You must be signed in to change notification settings - Fork 5
Add an opatch package and command-line tool
#35
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
Conversation
| patches | ||
| with Invalid_argument msg -> Printf.eprintf "Fatal error: %s\n" msg | ||
|
|
||
| let () = main Version.v |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can write %%VERSION%% and the dune subst will replace it -- so there's no need for the custom dune rule, and generating a version.ml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got bitten by this because this works only in dev mode. dune subst doesn’t run on release tarballs (which is reasonable as it pulls info from git describe). So the packages that use those placeholders generate explicit release tarballs where they are substituted. I find this trick simpler and lighter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, ok. My experience is when use dune-release these watermarks get replaced. But if you prefer the version.ml generated by dune rule, let's go with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather not use dune subst
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the aftermath of the xz-attack, I got convinced (by a talk? a post somewhere? I forget :-/) that the changes between the tagged version of the source and the actual release tarball are harmful. So much so that I’m advocating using automatically github-generated tarballs instead of user-created tarballs, to remove one link in the trust chain.
This patch reuses a lot of code written by Kate Deplaix for opam
|
I’ve tested this command mostly with the patches for the compiler in OCaml/Solo5. |
|
Can not really test but don't hesitate to go forward without me on this topic. |
|
Thanks. So how to move forward? Since we have some tests, could we use opatch there? From a maintenance point of view, I'd be in favour to remove src/patch_command.ml. About dependencies and complexity, I would be happy to merge this into the patch library --- even if you plan to depend on cmdliner. Are there any downsides of having it in the same opam package? |
avoiding the extra dependency would be great. I also personally don't think we should mix binaries and libraries in the same package |
|
@kit-ty-kate which extra dependency are you talking about? I also don't quite understand why mixing library and binary would be a bad idea - is there some reasoning behind that? |
According to
I don’t plan to add another dependency, but |
ah nevermind i thought this was depending on cmdliner
mostly the rule of least surprise. If someone calls |
|
Ok, thank you. I'll merge and release (opatch only). |
CHANGES: * Only a release of opatch (hannesm/patch#35 @shym @kit-ty-kate)
CHANGES: * Introduce opatch (hannesm/patch#35 @shym @kit-ty-kate)
This PR proposes to add a new
opatchcommand-line tool to implement a pure OCaml alternative to GNUpatch.The proposal is to add this new command to the
patchrepository so that:opatchcommand and thepatchlibrary if/when that makes sense (in particular, the same licence has been chosen to make sure this is possible),opatchcan be used (eventually) in the test suite.It is added as a new package so that:
opatchcan depend on a much more recent OCaml version (I’d rather add support for older versions only if there’s an actual need, and usingstdcompatin that case, probably),patchlibrary don’t end up with a new command-line tool they might didn’t want,opatchis currently a lot less tested than the rest of thepatchlibrary; even if it is heavily based on @kit-ty-kate’s code in opam, all the changes I’ve made where not yet tested as thoroughly.The initial goal of this new command is to have a portable
patchtool for MirageOS OCaml compilers.