-
Notifications
You must be signed in to change notification settings - Fork 349
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
Make install faster by not scanning the whole switch when no install field is present #4494
Conversation
This PR is now ready for review. cc @AltGr |
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.
This is more complicated than what I would have thought at first; I was initially pretty confused by track_files
comments saying it is "similar to [track]", while the latter is a wrapper around the execution of a job and the former just an atomic function that expects the results of a previous run as argument; there is nothing wrong with that, but what were the reasons not to go for the more straight-forward extraction of the list of files from .install
, followed by the run of a version of track
that is limited to a given set of files ? It would be useful to document more precisely the usage of track_files
in opamDirTrack.mli
.
Another remark, it seems the behaviour on pre-install
hooks is changed, since they are no longer tracked. Have you studied if that had any consequences in the wild ? Though the only other option would be to disable the optimised tracking as soon as any pre-install
hook is defined, I guess... The tracking behaviour for post-install
is already specific and detailed here.
I am otherwise happy with the code and this will be nice to have!
Just to keep a trace of the test (can't be added in reftest):
|
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.
Just a teeny bit of nitpicking, otherwise all good! ;)
Co-authored-by: Kate <kit.ty.kate@disroot.org>
…` instead of the whole switch prefix when there are no `install:` instructions (and no preinstall commands) Co-authored-by: Kate <kit.ty.kate@disroot.org>
Implements #4422
Currently opam scans the whole switch directory recursively twice when installing a package (per package). This introduces a huge strain on the IO of the machine. This is especially visible under high load (e.g. in CI)
This PR makes so that opam only scan the files that are going to be installed (if they exist already, this is rare) if the package does not have any
install
field. If the package does have aninstall
field the old behaviour is used.