You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, all zig compiler installs through zigup are stored in $HOME/zig by default. I would like to configure that my compilers be stored in $HOME/.zigup/compilers. In the current version of zigup, I need to pass --install-dir $HOME/.zigup/compilers each time I fetch a compiler version. I would like to set a globally configured "install dir" that zigup respects unless explicitly passed an --install-dir argument.
Solutions
There are a couple ways to do this.
1. Environment variables
The simplest way would be to create an environment variable:
# This might store a `$ZIGUP_HOME` env var?
zigup --set-install-dir $HOME/.zigup
And subsequent calls to zigup might check for $ZIGUP_HOME existence before proceeding.
2. Use a configuration options file
2.1. A config file in $ZIGUP_HOME
Rustup, the zigup equivalent for rust, has a default $RUSTUP_HOME at $HOME/.rustup which can be overridden by setting the env var. The settings.toml file provides configuration options to set the default toolchain and to allow for project-specific toolchain overrides (configured through the CLI):
Zigup might follow a similar convention and have a settings.toml or settings.json file at $ZIGUP_HOME that allows for fine-grained configuration. This also addresses issue #69.
2.2 A known folders search
zls uses a configuration file called zls.json which is stored in a known folder. The known-folders project provides the set of utilities needed for this. zigup can take a similar approach and search for a zigup.json configuration file in known folders. (And for MacOS also look for $HOME/.config/zigup)
Folder
Windows
xdg
MacOS
Roaming Configuration
%APPDATA%
XDG_CONFIG_HOME
HOME/Library/Preferences
Local Configuration
%LOCALAPPDATA%
XDG_CONFIG_HOME
HOME/Library/Application Support
3. A combination of both env vars and a config
In order to accommodate for various config options, zigup might prioritize an env var (e.g., $ZIGUP_HOME) over a config, and if not found, search for a config file, and if not found, use the default.
Discussion
This is obviously my preference, but the actual implementation would require discussion with the community to reach a consensus. Moving the compiler storage dir to $HOME/.zigup/compilers enables storage of other metadata and info in the $HOME/.zigup dir including the index file (allowing for a quick search for available versions), and potentially a settings/config file as specified in 2.1.
Note: my reasoning for this is that I like to store all zig bins in $HOME/.zig/bin. Cargo stores bins in $HOME/.cargo/bin and rustup toolchains are stored in $HOME/.rustup/toolchains
The text was updated successfully, but these errors were encountered:
Issue
Currently, all zig compiler installs through zigup are stored in
$HOME/zig
by default. I would like to configure that my compilers be stored in$HOME/.zigup/compilers
. In the current version of zigup, I need to pass--install-dir $HOME/.zigup/compilers
each time I fetch a compiler version. I would like to set a globally configured "install dir" that zigup respects unless explicitly passed an--install-dir
argument.Solutions
There are a couple ways to do this.
1. Environment variables
The simplest way would be to create an environment variable:
And subsequent calls to zigup might check for
$ZIGUP_HOME
existence before proceeding.2. Use a configuration options file
2.1. A config file in $ZIGUP_HOME
Rustup, the zigup equivalent for rust, has a default
$RUSTUP_HOME
at$HOME/.rustup
which can be overridden by setting the env var. Thesettings.toml
file provides configuration options to set the default toolchain and to allow for project-specific toolchain overrides (configured through the CLI):Zigup might follow a similar convention and have a
settings.toml
orsettings.json
file at$ZIGUP_HOME
that allows for fine-grained configuration. This also addresses issue #69.2.2 A known folders search
zls uses a configuration file called
zls.json
which is stored in a known folder. The known-folders project provides the set of utilities needed for this. zigup can take a similar approach and search for azigup.json
configuration file in known folders. (And for MacOS also look for$HOME/.config/zigup
)3. A combination of both env vars and a config
In order to accommodate for various config options, zigup might prioritize an env var (e.g.,
$ZIGUP_HOME
) over a config, and if not found, search for a config file, and if not found, use the default.Discussion
This is obviously my preference, but the actual implementation would require discussion with the community to reach a consensus. Moving the compiler storage dir to
$HOME/.zigup/compilers
enables storage of other metadata and info in the$HOME/.zigup
dir including the index file (allowing for a quick search for available versions), and potentially a settings/config file as specified in 2.1.Note: my reasoning for this is that I like to store all zig bins in
$HOME/.zig/bin
. Cargo stores bins in$HOME/.cargo/bin
and rustup toolchains are stored in$HOME/.rustup/toolchains
The text was updated successfully, but these errors were encountered: