-
Notifications
You must be signed in to change notification settings - Fork 28
feat: add ANYZIG_DATA_DIR env var support #52
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
base: master
Are you sure you want to change the base?
Conversation
|
what's the use case for this? I would like to add this feature for testing, though I was thinking it would probably be a command-line option. |
On Windows, Zig is installed on the C drive by default, but some people like me who have OCD tendencies prefer to install it on other drives, such as the D drive. Just like with rustup, setting RUSTUP_HOME and CARGO_HOME environment variables allows you to avoid installing to the C drive. |
|
Hmmm...at least right now, this would only affect where anyzig installs the configuration and some cached data, it wouldn't affect where the compilers are installed. Is this still a configuration you'd find helpful, having a way to modify where anyzig stores some of it's configuration and/or cached files? |
e371c52 This commit only changes the hashstore directory of anyzig. So this commit has no practical value.🥲😭 As for the configuration file, storing it in |
|
Yes I can see how changing the global cache dir would be useful. I'm not sure an environment variable is the right choice here though? What about a configuration file, basically the same thing I did for the logging configuration. anyzig can check if "appdata/global-cache-dir" exists and if so, it reads it and uses that for the global cache directory. |
I believe the appdata directory is determined only after the first use. The configuration file can be used to decide the default Zig version, or specify particular Zig versions for specific projects, or set mirror addresses, etc. Moreover, during the first use, there's only one executable file called anyzig, and the configuration file is generated after the first execution. Just like rustup - it installs Rust to RUSTUP_HOME and simultaneously creates settings.toml in the .rustup directory. |
support custom app data dir via ANYZIG_DATA_DIR env var