Skip to content

'Invalid cross-device link (os error 18)' during 'ruff' installation in Docker container #11163

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

Closed
heso opened this issue Feb 2, 2025 · 0 comments · Fixed by #11167
Closed
Assignees
Labels
bug Something isn't working

Comments

@heso
Copy link

heso commented Feb 2, 2025

Problem:

When trying to install dependencies mentioned in the dependencies section (only ruff at the moment) using:

docker-compose build
docker-compose run --rm test_app uv sync -v

I get the following error:

error: Failed to install: ruff-0.1.15-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (ruff==0.1.15)
  Caused by: failed to rename file from /usr/local/lib/python3.11/site-packages/ruff-0.1.15.data/scripts/ruff to /usr/local/bin/ruff: Invalid cross-device link (os error 18)

Configuration:

Dockerfile:

FROM docker-proxy.kontur.host/python:3.11-slim

ENV UV_LINK_MODE=copy
ENV UV_PROJECT_ENVIRONMENT=/usr/local
ENV UV_SYSTEM_PYTHON=1

RUN pip install uv~=0.5.26

compose.yml

services:
  test_app:
    build:
      context: .
    working_dir:  /opt/test
    volumes:
      - site_packages:/usr/local/lib/python3.11/site-packages
      - usr_local_bin:/usr/local/bin
      - uv_cache:/root/.cache/uv
      - ./src:/opt/test

volumes:
  site_packages:
  usr_local_bin:
  uv_cache:

pyproject.toml:

[project]
name = "example-app"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
    "ruff~=0.1.14",
]

structure:

project/
├── compose.yml
├── Dockerfile
└── src/
    ├── main.py
    ├── pyproject.toml
    └── uv.lock

Platform

Linux 5.15.153.1-microsoft-standard-WSL2 x86_64 GNU/Linux

Version

uv 0.5.26

Python version

Python 3.11.11

@heso heso added the bug Something isn't working label Feb 2, 2025
@konstin konstin self-assigned this Feb 2, 2025
loic-lescoat pushed a commit to loic-lescoat/uv that referenced this issue Mar 2, 2025
Fallback to copy if renaming a script doesn't work, similar to the site
packages installation.

Fixes astral-sh#11163

**Test Plan**

Failing:
```
docker volume rm -f gh11163_usr_local_bin
docker run -v gh11163_usr_local_bin:/usr/local/bin -e UV_LINK_MODE=copy -v $(pwd):/io -it --rm ghcr.io/astral-sh/uv:0.5-python3.11-bookworm-slim uv pip install --system ruff
```

Passing:
```
cargo build --target x86_64-unknown-linux-musl
docker volume rm -f gh11163_usr_local_bin
docker run -v gh11163_usr_local_bin:/usr/local/bin -e UV_LINK_MODE=copy -v $(pwd):/io -it --rm ghcr.io/astral-sh/uv:0.5-python3.11-bookworm-slim /io/target/x86_64-unknown-linux-musl/debug/uv pip install --system ruff
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants