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

Introduce DFX_CACHE_ROOT instead of using DFX_CONFIG_ROOT for the cache directory #2106

Closed
paulyoung opened this issue Mar 26, 2022 · 1 comment · Fixed by #2112
Closed

Comments

@paulyoung
Copy link
Contributor

Introducing a new DFX_CACHE_ROOT environment variable would address the issue I describe in paulyoung/nixpkgs-dfinity-sdk#4.

I imagine the change involves changing the following code, falling back to DFX_CONFIG_ROOT for DFX_CACHE_ROOT for backwards compatibility, and adding some new tests.

pub fn get_cache_root() -> DfxResult<PathBuf> {
let config_root = std::env::var("DFX_CONFIG_ROOT").ok();


I'd like to make a PR but can't because of #1955:

$ nix-shell --show-trace                                                         ~/projects/dfinity/sdk/main
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
error: program 'git' failed with exit code 128

       … while fetching the input 'git+ssh://[email protected]/dfinity-lab/common?ref=refs%2fheads%2fmaster&rev=da56c3d8094a0f2e18533b529ecb4eb8804927d1'
@paulyoung
Copy link
Contributor Author

paulyoung commented Mar 29, 2022

I noticed that my machine has both ~/.cache/dfinity/versions/ and ~/.config/dfx/ directories.

I'm not sure if these are from an older version of the SDK but they still seem appropriate and further support having DFX_CACHE_ROOT.

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.

1 participant