You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
uv creates CACHEDIR.TAG in .venv, indicating that backup tools need not make copies of this directory. Unfortunately, as far as I can tell, the builtin macOS backup tool Time Machine does not respect this file, meaning that the virtual environment is backed up incrementally.
While I appreciate that the right way to fix this is for Apple to teach Time Machine to respect CACHEDIR.TAG, the probability of that seems remote.
Is there any interest in handling this in uv? One way to do this would be to shell out to tmutil addexclusion .venv/ when the environment is created. This is what e.g. https://github.com/stevegrunwell/asimov/ does and it is supported by macOS.
For what it's worth, the performance impact of this would be measurable, but perhaps tolerable since this would only need to run each time .venv is created:
$ hyperfine "tmutil addexclusion .venv"
Benchmark 1: tmutil addexclusion .venv
Time (mean ± σ): 18.0 ms ± 6.3 ms [User: 4.3 ms, System: 4.3 ms]
Range (min … max): 9.6 ms … 39.1 ms 95 runs
The text was updated successfully, but these errors were encountered:
Cargo's solution to this was to use the core-foundation crate to set the relevant extended attributes on macOS to exclude their target directory from Time Machine:
uv
createsCACHEDIR.TAG
in.venv
, indicating that backup tools need not make copies of this directory. Unfortunately, as far as I can tell, the builtin macOS backup tool Time Machine does not respect this file, meaning that the virtual environment is backed up incrementally.While I appreciate that the right way to fix this is for Apple to teach Time Machine to respect CACHEDIR.TAG, the probability of that seems remote.
Is there any interest in handling this in
uv
? One way to do this would be to shell out totmutil addexclusion .venv/
when the environment is created. This is what e.g. https://github.com/stevegrunwell/asimov/ does and it is supported by macOS.For what it's worth, the performance impact of this would be measurable, but perhaps tolerable since this would only need to run each time
.venv
is created:The text was updated successfully, but these errors were encountered: