Skip to content

uv build fails on GitLab where cache directory is in source directory #20050

Closed

Description

@RazerM

Summary

On GitLab, cache directories are relative to the project directory:

Both artifacts and caches define their paths relative to the project directory, and can’t link to files outside it.

uv's own GitLab docs also show this pattern.

uv build fails in this scenario due to #19991

The build backend we use does not include the cache directory, so this hard error seems rather unfortunate. Ideally we wouldn't have to disable the cache.

Platform

N/A

Version

0.11.25

Python version

N/A

Activity

  1. Sillocan commented on Jun 29, 2026

    @Sillocan

    Agh, I just ran into this as well and its a full blocker for caching. Gitlab's caching requires that the folder must be inside the project directory.

    Command that fails:

    $ uv build
    error: The cache directory `.uv-cache` is inside the build source directory `.`
    
  2. Sillocan commented on Jun 29, 2026

    @Sillocan

    @woodruffw I hate to @ people, but I think your opinion on the path forward for this will be valuable. I think we need a workaround for #19991 since this blocks caching with Gitlab CICD.

    I've recreated the issue in an example repo: uv_issue_20050. I could not find a successful workaround with v0.11.25 of uv 😭

  3. zanieb commented on Jun 30, 2026

    @zanieb
    Member

    Thanks for the reports. Let me know if #20056 is not sufficient.

  4. added a commit that references this issue on Jun 30, 2026
    c1ef5a0
  5. Sillocan commented on Jun 30, 2026

    @Sillocan

    Thanks for the reports. Let me know if #20056 is not sufficient.

    Thank you for the quick turnaround! It's passing on main now https://gitlab.com/Sillocan/uv_issue_20050/-/jobs/15095330950#L28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions