Skip to content
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

Cache fails for Windows fallback to copy #60

Closed
gaborbernat opened this issue Sep 8, 2024 · 7 comments · Fixed by #87
Closed

Cache fails for Windows fallback to copy #60

gaborbernat opened this issue Sep 8, 2024 · 7 comments · Fixed by #87

Comments

@gaborbernat
Copy link

Run uv pip install hatch --system
Resolved 38 packages in 85ms
Prepared 38 packages in 466ms
warning: Failed to hardlink files; falling back to full copy. This may lead to degraded performance.
         If the cache and target directories are on different filesystems, hardlinking may not be supported.
         If this is intentional, set `export UV_LINK_MODE=copy` or use `--link-mode=copy` to suppress this warning.

https://github.com/tox-dev/platformdirs/actions/runs/10760776068/job/29839144844?pr=300

@skshetry
Copy link

skshetry commented Sep 9, 2024

This happens because the default cache is on a different partition (D:\) than where the python packages get installed.

@gaborbernat
Copy link
Author

Yeah, I get, but I believe this tool should adjust the cache path accordingly.

@eifinger
Copy link
Collaborator

@gaborbernat are you using --system because of the error No virtual environment found for Python 3.12; run uv venvto create an environment, or pass--system to install into a non-virtual environment?

If yes, why did you not create a virtual environment? This would be created by default at the working directory which lies on the D: drive which is reported to be much (up to 20x?) faster than the C: drive.

I you want to use the C: drive I suggest to change the uv cache path to a location on it with https://github.com/astral-sh/setup-uv?tab=readme-ov-file#local-cache-path

@gaborbernat
Copy link
Author

I am just trying to install a tool within the CI for which I found it a bit excessive to create a virtual environment. Especially as then I would need to activate or put the virtual environments path. onto the system path.

I think this tool itself should change the cached path for UV, not myself.

@gaborbernat
Copy link
Author

E.g. this should work out of box:

- name: Install the latest version of uv
  uses: astral-sh/setup-uv@v3
  with:
    enable-cache: true
    cache-dependency-glob: "pyproject.toml"
    github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Add .local/bin to Windows PATH
  if: runner.os == 'Windows'
  shell: bash
  run: echo "$USERPROFILE/.local/bin" >> $GITHUB_PATH

- name: install hatch
  run: uv tool install --python-preference only-managed --python 3.13 hatch

https://github.com/tox-dev/platformdirs/actions/runs/10907772759/job/30272231706 and not warn about cannot use the cache 👍

@eifinger

This comment was marked as outdated.

@gaborbernat
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants