Summary
I am using uv to build a whl file in a docker container as part of a Gitlab CI/CD pipeline. However, since uv 0.8.1, we get the following error when running uv build:
$ python --version
Python 3.13.5
$ which python
/usr/local/bin/python
$ uv --version
uv 0.8.4
$ uv build
Building source distribution...
× Failed to build `/builds/myproject`
├─▶ I/O operation failed during extraction
├─▶ failed to unpack
│ `/builds/myproject/.uv-cache/sdists-v9/.tmpPnC5xs/myproject-1.0.1/.uv-cache/builds-v0/.tmpTVvP5v/bin/python`
╰─▶ symlink destination for /usr/bin/python3 is outside of the target directory
Cleaning up project directory and file based variables 00:01
ERROR: Job failed: exit code 1
Relevant areas of pyproject.toml:
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
And the .gitlab-ci.yaml:
variables:
PYTHON_VERSION: "3.13"
IMAGE: ghcr.io/astral-sh/uv:python$PYTHON_VERSION-bookworm
UV_CACHE_DIR: .uv-cache
UV_SYSTEM_PYTHON: 1
UV_LINK_MODE: copy
I am able to build fine within a virtual environment on a local system, but this fails using the system python install in the base uv image.
Platform
Debian Bookworm x86_64
Version
0.8.4
Python version
3.13.5