|
3 tahun lalu | |
---|---|---|
.github | 3 tahun lalu | |
ziget-build-files-copy | 3 tahun lalu | |
.gitattributes | 3 tahun lalu | |
.gitignore | 3 tahun lalu | |
README.md | 3 tahun lalu | |
build.zig | 3 tahun lalu | |
fixdeletetree.zig | 3 tahun lalu | |
test.zig | 3 tahun lalu | |
update-ziget-build-files-copy | 3 tahun lalu | |
zigup.zig | 3 tahun lalu |
Download and manage zig compilers.
# fetch a compiler and set it as the default
zigup <version>
zigup master
zigup 0.6.0
# fetch a compiler only (do not set it as default)
zigup fetch <version>
zigup fetch master
# print the default compiler version
zigup default
# set the default compiler
zigup default <version>
# list the installed compiler versions
zigup list
# clean compilers that are not the default, not master, and not marked to keep. when a version is specified, it will clean that version
zigup clean [<version>]
# mark a compiler to keep
zigup keep <version>
Things that a user may want to configure
PATH
directory that points to the default compilerPATH
directory that calls forwards calls to the default compiler executableI may support one or more configuration files. Possibly a file that lives alongside the executable, or in the user's home directory, possibly both. I've added command-line options to configure the install directory and path symlink for testing, that may be good enough because one can just wrap zigup in a script and forward those options to it.
On Linux/Bsd/Mac (which I will call "Posix" systems) the default install location is $HOME/zig
. Not sure what default directory to use for windows yet, maybe %APPDATA%\zig
. This directory will contain a unique sub-directory for every version of the compiler that is installed on the system. When a new compiler is installed, this tool will also add some scripts that will modify an environment to use that version of the zig compiler.
One compiler will be set as the "default" by linking a symlink or batch file to one of the compiler executables that have been installed. On Posix systems this will be a symlink named zig
in a PATH
directory that points to one of the zig
executables. On windows this will be a batch file named zig.bat
in a PATH
directoty that calls one of the zig
executables.
My breakdown of the operations I'd like.
zigup fetch master
)zigup fetch <version>
)zigup list
)zigup default
and zigup default <version>
)setup the environment for a specific version of the compiler?
download zig index file (zigup fetch-index
)
NOTE: by default
zigup list
should display more information, like release date, its "keep" value, etc. Maybe it should also sort them, probably by release date?
zigup depends on https://github.com/marler8997/ziget which in turn depends on other projects depending on which SSL backend is selected. You can provide -Dfetch
to zig build
to automatically clone all repository dependencies, otherwise, the build will report a missing dependency error with an explanation of how to clone it.
On linux and macos, zigup depends on tar
to extract the compiler archive files (this may change in the future).
zig build
# install to a bin directory with
cp zig-out/bin/zigup BIN_PATH