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

How do I safely clean vcpkg archives and disable it? #14157

Closed
ghost opened this issue Oct 22, 2020 · 12 comments
Closed

How do I safely clean vcpkg archives and disable it? #14157

ghost opened this issue Oct 22, 2020 · 12 comments
Assignees
Labels
category:question This issue is a question

Comments

@ghost
Copy link

ghost commented Oct 22, 2020

Recently I realize that the archives folder stored in Windows at "C:\Users\usrName\AppData\Local\vcpkg\archives" is quite big. Since I do not need this archives while it occupies some precious SSD space. How can I safely remove this folder and prevent vcpkg from storing back in future?

@NancyLi1013 NancyLi1013 added the category:question This issue is a question label Oct 23, 2020
@NancyLi1013
Copy link
Contributor

NancyLi1013 commented Oct 23, 2020

Hi @stvriver
Thanks for posting this issue.
These archives stored in C:\Users\usrName\AppData\Local\vcpkg\archives are binary caches for the ports that you build.

You can delete vcpkg folder listed in C:\Users\usrName\AppData\Local directly if you don't want to keep them.

@NancyLi1013
Copy link
Contributor

You can disable it by updating these changes in toolsrc/include/vcpkg/vcpkgcmdarguments.h file:

bool binary_caching_enabled() const { return binary_caching.value_or(false); }
bool compiler_tracking_enabled() const { return compiler_tracking.value_or(false); }

Related PR #12370.

@NancyLi1013
Copy link
Contributor

Hi @stvriver
Please let me know if this is still a problem for you.

@ghost
Copy link
Author

ghost commented Oct 27, 2020

I am sorry for late checking this. Thanks NancyLi1013 for support.

After I look into vcpkg commands help, I realize that vcpkg supports disable binary caching by "either passing
--no-binarycaching to every vcpkg command line or setting the environment variable VCPKG_FEATURE_FLAGS to -binarycaching."
So I think that is the way I should follow instead of changing the source as your suggestion.
There is one thing I am not clear is where and how can I set VCPKG_FEATURE_FLAGS to -binarycaching?.

@NancyLi1013
Copy link
Contributor

NancyLi1013 commented Oct 28, 2020

Hi @stvriver

Thanks for your further investigation about binary caching. To be honest, I also didn't focus on the workaround to disable binary caching before you pointing this out. Thanks for your help.

As you mentioned above, there are two ways to disable it:

  • passing --no-binarycaching to every vcpkg command line

    add the option --no-binarycaching to vcpkg command, such as vcpkg install sqlite3 --no-binarycaching.

  • setting the environment variable VCPKG_FEATURE_FLAGS to -binarycaching

    add VCPKG_FEATURE_FLAGS in environment variable, set the value as -binarycaching.

Capture

Note: Please restart your machine after you set it.

@ghost
Copy link
Author

ghost commented Oct 28, 2020

Hi @NancyLi1013
With your detail expression I think my confusion is clear and the issue is solved.
Again, thanks for your support.

@NancyLi1013
Copy link
Contributor

Thanks for your feedback. I'm closing this issue for now.

@talregev
Copy link
Contributor

I have simple workaround it for linux.
Just delete the zip:
sudo apt purge zip then the vcpkg will not find zip command and stop caching. it just more easy.

@Rusching
Copy link

Rusching commented Mar 9, 2023

Hi @NancyLi1013 if I directly delete vcpkg folder listed in C:\Users\usrName\AppData\Local, will there be problems such as import errors later?

@Dave-Lowndes
Copy link

I've tried deleting the vcpkg folder in AppData\Local because I had several versions that I no longer needed. Unfortunately it's caused a problem for me - none of my projects now rebuild - they can't find header files and the packages aren't being re-created.

@dg0yt
Copy link
Contributor

dg0yt commented Jul 5, 2023

I've tried deleting the vcpkg folder in AppData\Local because I had several versions that I no longer needed. Unfortunately it's caused a problem for me - none of my projects now rebuild - they can't find header files and the packages aren't being re-created.

That problem doesn't seem to be linked to deleting the compressed artifact archives in AppData\Local. The header files wouldn't be installed there (unless you did something unusual).

@Dave-Lowndes
Copy link

After deleting the directory VS behaved as though vcpkg wasn't available to it. After closing and re-opening VS, the vcpkg tab disappeared from the project settings.
To cut a long story short, I've found that all that's required to reinstate it is to run "vcpkg integrate install" from an admin VS command prompt. This has reconstituted the AppData\Local\vcpkg directory with these files:
config
vcpkg.path.txt
vcpkg.user.props
vcpkg.user.targets

My projects now build OK again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:question This issue is a question
Projects
None yet
Development

No branches or pull requests

5 participants