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

discuss cache and config locations on Windows #1098

Closed
rkitover opened this issue Jun 16, 2022 · 2 comments
Closed

discuss cache and config locations on Windows #1098

rkitover opened this issue Jun 16, 2022 · 2 comments
Labels
closed: duplicate Duplicate of another issue improvement Improvement that is not a bug fix or new feature

Comments

@rkitover
Copy link
Contributor

@jrosdahl @cristianadam @Predelnik

Hi guys, I noticed that the default locations for the cache and configs on Windows right now does not seem ideal.

From the output of ccache -s -v I have:

Cache directory:      C:\Users\rkitover\AppData\Roaming/ccache
Primary config:       C:\Users\rkitover\AppData\Roaming/ccache/ccache.conf
Secondary config:     C:/Program Files (x86)/ccache/etc/ccache.conf

Cache Location

We should be using AppData\Local and not Roaming for the cache because Roaming data can be copied/moved, and this is potentially many gigs that don't need to be. Local is available in the LOCALAPPDATA environment variable, and we can still fallback to APPDATA if for some reason it's not available due to Windows version or whatever.

Global Config

Instead of C:/Program Files (x86)/ccache/etc we could use C:\ProgramData\ccache as C:\ProgramData serves the purpose of a global /etc on modern Windows versions. This location is generally available in the ALLUSERSPROFILE environment variable. I'm not sure here what the fallback should be if any, or if we care about old versions of Windows, the (x86) suffix is definitely wrong because I am using a 64 bit build.

If you agree I can work on a PR to make these adjustments.

@rkitover rkitover added the improvement Improvement that is not a bug fix or new feature label Jun 16, 2022
@cristianadam
Copy link
Contributor

There is also a longer discussion at #1023

@Predelnik
Copy link
Contributor

Using %LOCALAPPDATA% seems to be a correct idea. ProgramData seems to be better as well since Program Files would require administrator access to write most of the time. In ProgramData file modification seems to be restricted to original creator, don't know if it would be a problem. But maybe as @cristianadam points out this issue could probably be closed in favor of #1023

@jrosdahl jrosdahl added the closed: duplicate Duplicate of another issue label Jun 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: duplicate Duplicate of another issue improvement Improvement that is not a bug fix or new feature
Projects
None yet
Development

No branches or pull requests

4 participants