-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Wheel Build failures when installing via multiple simultaneous UV instances #3512
Description
I've been attempting to switch our CI system over to UV, and after doing so we began encountering a relatively high failure rate. Investigating, it appears that there is a problem when multiple UV processes under the same user attempt to install in different venvs at once.
This can be reproduced with the following shell script on ubuntu 22 with any version of UV I tested with, up to 0.1.41.
#!/bin/bash
make_venv(){
uv venv $1
source $1/bin/activate
uv pip install jaeger-client
}
for i in {1..8}
do
make_venv $1/$i &
done
This inevitably produces failure messages like:
--- stderr:
error removing build/bdist.linux-x86_64/wheel/threadloop-1.0.2-py3.8.egg-info: [Errno 39] Directory not empty: 'build/bdist.linux-x86_64/wheel/threadloop-1.0.2-py3.8.egg-info'
error: [Errno 17] File exists: 'build/bdist.linux-x86_64/wheel/threadloop-1.0.2.dist-info'
It also appears to leave the uv cache in a corrupted state, where calling uv cache clean produces errors like:
Clearing cache at: ~/.cache/uv
error: Failed to clear cache at:~/.cache/uv
Caused by: IO error for operation on ~/.cache/uv/built-wheels-v3/pypi/jaeger-client/4.8.0/0rRHp2ho5iISrFqrp0Brr/jaeger-client-4.8.0.tar.gz/build/bdist.linux-x86_64/wheel/jaeger_client: Permission denied (os error 13)
Caused by: Permission denied (os error 13)
This can be resolved by calling chmod +rx on whatever the offending file is and re-clearing the cache. This could perhaps be classified as a separate issue with failed builds leaving the cache in a corrupted state?