#+TITLE: zup * What ~Zup~ is a [[https://ziglang.org][Zig]] language version manager (Zig-UPdater). * Requirements ** System libraries - libarchive ** Zig version You need at least Zig 0.10.0 to compile zup, if your system package manager does not have a high enough version of Zig, you can download a precompiled tarball from [[https://ziglang.org/download/]] and use the ~zig~ binary from it manually. In general, any zup version should be able to install a newer (hopefully the newest!) Zig version that should enable you to compile the newest zup. | Zig version | zup version | |-------------+-------------| | 0.10.0 | 0.2.1 | | 0.10.1 | 0.2.1 | | master | main | * How ** Compiling & installing #+begin_src shell git clone https://git.sr.ht/~ukko/zup cd zup zig build -Doptimize=ReleaseSafe -p ~/.local #+end_src ** Using Sample usage: #+begin_src shell zup install master # Installs the master version of zig zup switch master # Actually use it #+end_src For more information, refer to ~zup help~. ~Zup~ currently installs stuff internally to ~$XDG_DATA_HOME/zup~ (if ~XDG_DATA_HOME~ is not set, ~~/.local/share~ is used). ~zup switch~ symlinks the current binary into ~~/.local/bin~ (currently not configurable). * Configuration Configuration file goes in ~/etc/xdg/zup/zup.json~, ~~/.config/zup/zup.json~, or any of the magical ~XDG_CONFIG_...~ locations. (In the future zup might support some more human-friendly format like TOML or YAML.) Multiple different configs get read in order, the user-specific configuration file coming in last. A configuration file should be a single JSON object, the following keys are supported: - ~supported_targets~ :: An array of targets your machine supports running in addition to the native architecture. The running native architecture will be preferred when installing and then the targets listed in this array (earlier in the array -- higher priority). If this value is set in multiple configuration files, the values get concatenated. Examples: #+begin_src json "supported_targets": [ "x86_64-linux", "i386-linux" ] #+end_src #+begin_src json "supported_targets": [ "aarch64-macos", "x86_64-macos" ] #+end_src ** Example configuration file #+begin_src json { "supported_targets": [ "x86_64-linux", "i386-linux" ] } #+end_src