-
Notifications
You must be signed in to change notification settings - Fork 348
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 post-install-commands
hooks to modify/remove installed files
#4388
Allow post-install-commands
hooks to modify/remove installed files
#4388
Conversation
LGTM, thanks! |
I'm a bit sceptical this is a good idea - is there an overview which phases and hooks are allowed to do what? At least, the documentation should be adjusted:
wouldn't such a post-install and a corresponding pre-remove work for |
Note that this PR does not allow a |
Lets not be hasty about adding in hook features this late in opam 2.1's release cycle without careful justification, please. I think it's important to understand the power of these hooks:
|
Hooks completely bypass the sandboxing process : it is already possible for post-install hooks (and other hooks) to modify files anywhere on the system. |
Just clarifying two points:
The latter explains I have no objection, since the PR does not change existing features but improves handling for a specific case of an existing feature. EDIT: but yes the PR title is pretty misleading :) |
thanks for the explanation @AltGr. |
Thanks for the explanations. Could we get the Changes entry to be more accurate then? Specifically, it appears that opam 2.1 is now tracking the results of ~/.opam changes made during the post-install hook execution and registering those with opam. Are there any other implications of making this change (e.g. to |
There is already an entry in the Changes that is added with the PR. Note that only the files that were installed by the package are checked for modification, other files added/modified by the |
Users that do not use |
Just one last tidbit, the last sentence in the manual here should be updated to reflect the change. The doc doesn't become incorrect, but just precise something along the lines of "Modified installed files will be handled correctly by opam" Source: https://github.com/ocaml/opam/blob/master/doc/pages/Manual.md |
978191e
to
0f5706b
Compare
Indeed, I have modified the Manual file in this new version. |
Co-authored-by: R. Boujbel <rjbou@ocamlpro.com>
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.
Small changes, but LGTM!
In order to keep consistency with function inf OpamDirTrack
, update
should take a dirname
and not a string
.
Co-authored-by: R. Boujbel <rjbou@ocamlpro.com>
Co-authored-by: R. Boujbel <rjbou@ocamlpro.com>
Co-authored-by: R. Boujbel <rjbou@ocamlpro.com>
This modification is necessary because
opam-bin
uses thepost-install-commands
to share files between switches using hard links. Unfortunately, without this PR, such actions modify the digests of the files just after their recording, so thatopam remove
will complain that the installed files have been modified.Please update
master_changes.md
file with your changes.