Skip to content

Simple instructions for installing the latest version of Zig on macOS.

License

Notifications You must be signed in to change notification settings

disciple-dev/install-zig-macOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Installing Zig on macOS

Intro

Hi! If you've got here, maybe you had the same journey that I did: follow the instuctions on the Zig website for installing on macOS, only to discover that most Zig tutorials (like Ziglings) don't support the latest stable version, but usually something closer to bleeding edge.

Well... this is what I did, and hopefully it helps.

Installation

  1. Download

    Head on over to the Zig download page and downloadt the appropriate file. If you're on an M-series processor, that is the aarch64, otherise x86_64.

  2. Extract

    I have put my binary in my user's home folder, at ~/bin. You might have to create the bin folder if you don't already have one.

    tar -xzf ~/Downloads/zig-macos-aarch64-<version>.tar.xz -C ~/bin
  3. Symlink

    This is optional, but it makes things easier in the future, such as for updating.

    ln -s ~/bin/zig-macos-aarch64-<version>/zig ~/bin/zig
  4. Add to Path

    If you chose to put your zig executable in the ~/bin folder, and you have not already added that folder to your path, you will need to do that.

    echo 'export PATH=$PATH:~/bin' >> ~/.zshrc

    then, apply the changes to your .zshrc to the current shell.

    source ~/.zshrc
  5. Test

    You should now be able to use Zig from your terminal:

    zig version

About

Simple instructions for installing the latest version of Zig on macOS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published