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

Re-enable hardlinking using fclonefileat on macOS. #18501

Merged
merged 2 commits into from
Mar 14, 2023

Conversation

stuhood
Copy link
Member

@stuhood stuhood commented Mar 14, 2023

On macOS (and on the same filesystem), Rust's std::fs::copy implementation uses fclonefileat, which is as performant as a hardlink, but more defensive (since the clones are completely independently of one another).

It also has the important benefit of playing nicely with Docker for macOS: so this change fixes #18162.

@stuhood stuhood added the category:bugfix Bug fixes for released features label Mar 14, 2023
@stuhood stuhood requested review from jsirois, tdyas and thejcannon March 14, 2023 20:45
Copy link
Contributor

@jsirois jsirois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the uses are inlined to their conditional compile location which means lifting a function - maybe inline. As is reads fine in a diff, but pretty haphazard just reading the file.

@stuhood stuhood enabled auto-merge (squash) March 14, 2023 22:41
@stuhood stuhood merged commit 81c2fa3 into pantsbuild:main Mar 14, 2023
@stuhood stuhood deleted the stuhood/macos-fclonefileat branch March 14, 2023 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:bugfix Bug fixes for released features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Testing in Docker environment fails with pex FileNotFoundError
3 participants