#Installing zig

1 messages ยท Page 1 of 1 (latest)

sharp oar
#

Hello! I am trying to install zig so I can check out ziglings.

I'm on a Mac M1. I've downloaded the latest master, unzipped, and set the path to the executable in my .bash_profile. Trying to run zig gives me command not found.

However, using it with the path to the executable works

MacBook-Air:~ me$ /Users/me/Desktop/zig-macos-aarch64-0.12.0-dev.1830+779b8e259/zig version
0.12.0-dev.1830+779b8e259

my .bash_profile looks like this

[[ -f ~/.bashrc ]] && source ~/.bashrc # ghcup-env# Set PATH, MANPATH, etc., for Homebrew.
eval "$(/opt/homebrew/bin/brew shellenv)"
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
export PATH="/opt/homebrew/opt/llvm@12/bin:$PATH"
export PATH="/opt/homebrew/opt/llvm@12/bin:$PATH"
export PATH=/usr/local/smlnj/bin:"$PATH"
export PATH=/Applications/Racket\ v8.6/bin:"$PATH"
export PATH=$PATH:/Users/me/Desktop/zig-macos-aarch64-0.12.0-dev.1830+779b8e259/zig

Not sure how to debug from this point, any help would be appreciated ๐Ÿ™

dire sorrel
#

you need to put only the directory in path

#

export PATH=$PATH:/Users/me/Desktop/zig-macos-aarch64-0.12.0-dev.1830+779b8e259/

sharp oar
#

Thank you!! ๐Ÿ™ˆ

MacBook-Air:~ me$ zig version
0.12.0-dev.1830+779b8e259
dire sorrel
#

welcome :)

hybrid wedge
#

if people are interested, i'm happy to share a little script that ensures I always have the latest version of zig installed?

hybrid wedge
#

@sharp oar here you go! you'll obviously want to change some of the file paths (i keep my zig downloads in $HOME/toolchains/zig). for the latest version of zig, it will simply write out the new folder name to $HOME/.zig which your zshrc or bashrc can read in to export.

hybrid wedge
#

this is me just running it now

hybrid wedge