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-dir" flag is ignored when specifying "--resolver=backtracking" #1795

Closed
kikones34 opened this issue Jan 10, 2023 · 3 comments · Fixed by #1827
Closed

"--cache-dir" flag is ignored when specifying "--resolver=backtracking" #1795

kikones34 opened this issue Jan 10, 2023 · 3 comments · Fixed by #1827
Labels
bug Something is not working cache Related to dependency cache

Comments

@kikones34
Copy link

kikones34 commented Jan 10, 2023

When using the backtracking resolver, the custom cache dir flag appears to be ignored.

Environment Versions

  1. Ubuntu 22.04
  2. Python version: 3.11.1
  3. pip version: 22.3.1
  4. pip-tools version: 6.12.1

Steps to replicate

Execute the command pip-compile -v --cache-dir /tmp/pip-cache --resolver=backtracking --upgrade requirements/requirements.in

Expected result

The cache found in /tmp/pip-cache is used.

Actual result

The default cache folder in ~/.cache/pip-tools is used. No files are generated in /tmp/pip-cache.
Note that without the --resolver=backtracking flag, the cache is properly generated and read from the custom path.

@kikones34 kikones34 changed the title "--cache-dir" flag is ignored when specifying " "--cache-dir" flag is ignored when specifying "--resolver=backtracking" Jan 10, 2023
@q0w
Copy link
Contributor

q0w commented Jan 11, 2023

New resolver uses the pip cache so you can override cache-dir by using pip-args

--pip-args "--cache-dir=/tmp/pip-cache"

@kikones34
Copy link
Author

New resolver uses the pip cache so you can override cache-dir by using pip-args

--pip-args "--cache-dir=/tmp/pip-cache"

That worked, thank you! I suggest maybe showing a warning if you try to use --cache-dir together with the --resolver=backtracking flag, as it's quite confusing that it gets silently ignored.

@atugushev
Copy link
Member

Or we can pass --cache-dir (if presented) to --pip-args with —resolver=backtracking.

@atugushev atugushev added bug Something is not working cache Related to dependency cache labels Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working cache Related to dependency cache
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants