Skip to content

Instantly share code, notes, and snippets.

@M64GitHub
Last active September 8, 2024 19:53
Show Gist options
  • Select an option

  • Save M64GitHub/6d2e0cedb69edd9041c92e1422d9f6b6 to your computer and use it in GitHub Desktop.

Select an option

Save M64GitHub/6d2e0cedb69edd9041c92e1422d9f6b6 to your computer and use it in GitHub Desktop.

Managing multiple versions of ZIG on your system easily

Sometimes you need a specific version of ZIG. It's been the case to me the other day, when I wanted to try out a repo I found on github just quickly.
In particular it was my twin brother's repo GPT4All.zig, and I wanted to see if it would run even on my small powered dev laptop (a 2nd hand IBM thinkpad I bought on amazon for EUR 350.00).

ZIG is moving ahead quite fast, and usually does not break a backwards-compatibility for no reason of course. But the build system in this particular case had already been updated in a way, so my currently installed version 14 of ZIG was not building the repo (required zig 0.11). And I did not want to look further into it, but just see how the AI chat would perform.

This made me think of creating a quick zig version selection solution, where all files are in a declared place, and I can switch between them easily. I particularly did not want to mess my new dev system up with temporarely downloaded files, where I later often don't know whether I can safely remove them, or not etc ...

For programming languages or frameworks I tend to follow the trend to have them installed in my home directory, like you can do for example with go, Arduino, platformio, etc. Else I usually prefer not to create too many folders in my home- directory.

... work in progress ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment