-
Notifications
You must be signed in to change notification settings - Fork 62
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
Make zigup configurable through an enviroment #154
Conversation
* First step into making this actually useful without a lot of prior setup. Try to copy what rustup does.
* This make so that it's possible to configure zigup through an .env file which just sets `$ZIGUP_DIR` and `$ZIGUP_INSTALL_DIR`. The current active compiler then is just `$ZIGUP_DIR/current`, which is in the `$PATH`.
* Test if the current terminal is a tty so we can ask the user things.
* `undefine` will undefine the current default compiler, this is useful for using a system-wide installation of zig.
* Since now we allow for arbitrary paths to be set as the default compiler, we can't use the path to determine the version. Instead, use `zig version` to do so.
See my comments on other issues/PRs for my thoughts on adding support for environment variable configuration. |
Care to explain? You could do away with the environment variables, that's not a problem, it'd still need an environment (like cargo and others). + it would allow for zigup to be packaged, without the problems from it being in the global path that happen now. This also avoids having the user pass |
Previous comment/thoughts here: #91 (comment) (see the linked comment in that comment) I'm not aware of any problems with packaging zigup at the moment. |
Using the AUR package as an example: zigup gets installed under If contributions are welcomed I'm happy to make changes, like removing the environment variables (still need an environment to configure the PATH). |
Ah i see yes that is a problem. I'm thinking the solution here might be to add a build-option so that distribution maintainers can specify the default path-link at build time for their distribution. What do you think? Does arch have a standard directory for the user to place binaries (or in this case a symlink to a binary) meant to be accessible via |
Most distros will have |
Well I have no problem with adding a build option to change the default path link, something like |
Understandable, I will maintain a fork here: https://github.com/mulling/zup with the changes above and more, if anyone is interested. |
This PR adds a few things and ideas:
zigup
configurable through an environment, defined at$ZIGUP_DIR/env
. Inline with Support system-wide configuration for zigup directory #113;zigup
to auto-configure itself (with minimal action required by the user);--install-dir
and--path-link
with$ZIGUP_INSTALL_DIR
and$ZIGUP_DIR
. Inline with Proposal: Rename the zig compiler storage directory fromzig
to.zig
or.zig-compilers
#148;zigup default
to set the default compiler from a path, i.e.,zigup default zig/build
;zigup undefine
to unset the current default compiler;-v
or--verbose
, to enable verbose output;Overall, this makes
zigup
work when installed globally (from a package manager); and allows persistent configuration. For now, only tested on Linux.