Files
uv/crates/uv-static
Alessandro Molina 6036575324 Handle the hard link limit gracefully instead of failing (#17699)
## Summary

Handle the case where too many hardlinks were created and thus
installing packages fails.

There are cases where the file system can have a hardlinks limit and
when it's hit `uv` fails,
for example AWS EFS that has a limit of 177 hard links (
https://docs.aws.amazon.com/efs/latest/ug/troubleshooting-efs-fileop-errors.html#hardlinkerror
)

This PR address this by resetting the hardlinks when the limit is
reached (it does this by replacing the file in the cache, so new
hardlinks can be made)

There can be race conditions over the limit, but those are ok, as the
links are reset atomically so in case of race conditions the worst case
will be that the limit is reset twice, but nothing will break.

## Test Plan

Add a `install_hardlink_after_emlink` function, it successfully
reproduced the issue on my system.
The issue is that it's expensive to run as it has to generate a lot of
hardlinks

---------

Co-authored-by: Tomasz Kramkowski <tom@astral.sh>
2026-03-05 23:43:34 +00:00
..
2026-03-03 15:08:03 -06:00
2026-03-03 15:08:03 -06:00

uv-static

This crate is an internal component of uv. The Rust API exposed here is unstable and will have frequent breaking changes.

This version (0.0.28) is a component of uv 0.10.8. The source can be found here.

See uv's crate versioning policy for details on versioning.