-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
unpack_strategy/directory: use mv for nested unpack #18518
Conversation
Will need to think about this a bit more in relation to how we are "unpacking" git repositories. |
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.
Worth a try once 🟢 and you're ready, thanks!
a803cfe
to
9f79991
Compare
6a33f07
to
d26dec1
Compare
`mv` should preserve hardlinks and allow faster unpack on the same filesystem. A secondary pass is done with `cp` to copy over attributes onto any existing directories. We only run this for nested unpacks as most direct Directory strategy usage is for repositories where moving files breaks existing code. This uses `cp -pR` for non-move as some potential user reported issues could be due to Apple's `cp -l` on specific macOS versions. Can consider re-adding `cp -l` with better handling for older macOS.
Thanks @cho-m! Good to merge when you are. |
Will merge now and keep an eye out for any user issues. Should speed up pour time for large bottle, e.g. for
I did try removing nested part of extraction (directly extracting to cellar), which ran in |
Wow, great speedup there @cho-m! |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?mv
should preserve hardlinks and allow faster unpack on the same filesystem. A secondary pass is done withcp
to copy over attributes onto any existing directories.We only run this for nested unpacks as most direct Directory strategy usage is for repositories where moving files breaks existing code.
This uses
cp -pR
for non-move as some potential user reported issues could be due to Apple'scp -l
on specific macOS versions. Can consider re-addingcp -l
with better handling for older macOS.This improves performance when pouring bottles if user has brew installed on same filesystem as
/tmp
directory (~1.2-1.4x when tested viabrew reinstall
which means directbrew install
).macOS
mv
man page says:Which should essentially be similar to
cp -pR
when combined with other logic.