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

Add option to ignore cache temporarily #7741

Open
nehaljwani opened this issue Sep 5, 2018 · 9 comments
Open

Add option to ignore cache temporarily #7741

nehaljwani opened this issue Sep 5, 2018 · 9 comments
Labels
source::community catch-all for issues filed by community members stale::recovered [bot] recovered after being marked as stale type::feature request for a new feature or capability

Comments

@nehaljwani
Copy link
Contributor

Conda should provide the ability to not honor any cache directory temporarily for a singly invocation. A most common use case for this could be:

conda install -c /path/to/some/local/channel mypkg --ignore-cache

This would be helpful for a package developer who has to make several iterations on the same recipe and doesn't want to go through the hurdle of bumping up build number each time. Especially for a package with multiple outputs.

@kalefranz
Copy link
Contributor

Pip has the option

  --no-cache-dir              Disable the cache.

I'd like to clarify what you mean. Do you mean that you don't want mypkg to be downloaded, extracted into, and linked from the cache? Or do you mean that you don't want conda to consider the state of the cache for the current solve?

The latter is governed by

conda/conda/core/index.py

Lines 232 to 237 in a4436a5

if context.offline or ('unknown' in context._argparse_args
and context._argparse_args.unknown):
# This is really messed up right now. Dates all the way back to
# https://github.com/conda/conda/commit/f761f65a82b739562a0d997a2570e2b8a0bdc783
# TODO: revisit this later
_supplement_index_with_cache(reduced_index)

The former is not yet a conda capability, and an interesting feature request.

@kalefranz
Copy link
Contributor

The "skip the package cache and install directly to the environment" concept would also be useful for building docker containers.

@kalefranz kalefranz added type::feature request for a new feature or capability source::governance created by members of the conda governance (https://github.com/conda-incubator/governance) labels Sep 24, 2018
@EtoDemerzel0427
Copy link

The "skip the package cache and install directly to the environment" concept would also be useful for building docker containers.

Seems like you have not revisit that "TODO" yet.

@jaklan
Copy link

jaklan commented Nov 8, 2019

+1 on that so badly - if you modify the original file from one of the installed packages (e.g. accidentally during debugging) and you don't have a local history of that file to revert the change (e.g. you use VSCode without any extension for that) - then the only way (from conda CLI API perspective) to repair things is running... conda clean --all --force-pkgs-dirs - definitely far from the acceptable solution.

@adam-urbanczyk
Copy link

Another +1 on this, conda clean --all --force-pkgs-dirs works fine but is a total overkill.

@mfansler
Copy link
Contributor

Wouldn't a less destructive workaround be to temporarily mask the other pkgs_dirs by pointing CONDA_PKGS_DIRS to an empty directory? For example,

CONDA_PKGS_DIRS=$(mktemp -d) conda install -c /path/to/some/local/channel mypkg

This won't cache the installed package(s). If that was needed, then one could also move the stuff from the temp cache to the original afterward:

tmp_cache=$(mktemp -d)
CONDA_PKGS_DIRS=${tmp_cache} conda install -c /path/to/some/local/channel mypkg
mv ${tmp_cache}/* /path/to/your/og/cache

I suppose this latter would entail a risk of clobbering, but right now the best alternative is completely wiping the cache. So...pick your poison.

@github-actions
Copy link

Hi there, thank you for your contribution to Conda!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue in the latest version of Conda

  2. Comment that the issue is still reproducible and include:

  • What version of Conda you reproduced the issue on
  • What OS and version you reproduced the issue on
  • What steps you followed to reproduce the issue
  1. It would also be helpful to have the output of the following commands available:
  • conda info
  • conda config --show-sources
  • conda list --show-channel-urls

NOTE: If this issue was closed prematurely, please leave a comment and we will gladly reopen the issue.

In case this issue was originally about a project that is covered by the Anaconda issue tracker (e.g. Anaconda, Miniconda, packages built by Anaconda, Inc. like Anaconda Navigator etc), please reopen the issue there again.

Thanks!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label Feb 18, 2022
@adam-urbanczyk
Copy link

It is a feature request and it is not at all stale

@github-actions github-actions bot added stale::recovered [bot] recovered after being marked as stale and removed stale [bot] marked as stale due to inactivity labels Feb 20, 2022
@chenghlee chenghlee added source::community catch-all for issues filed by community members and removed source::governance created by members of the conda governance (https://github.com/conda-incubator/governance) labels Mar 9, 2022
@djboboch
Copy link

djboboch commented May 17, 2022

Hi what is the status on this feature. It has been nearly 4 years since the request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
source::community catch-all for issues filed by community members stale::recovered [bot] recovered after being marked as stale type::feature request for a new feature or capability
Projects
Status: 🆕 New
Development

No branches or pull requests

8 participants