I played around and wanted to create a container image to streamline my Zig build experience. Doing so, I used the official tarball and copied over the
zig binary, put it into
/usr/local/bin, and assumed this was going to work.
zig version even proved me correct:
$ zig version
However, once I wanted to build, I got this error message:
error: unable to find zig installation directory '/usr/local/bin/zig': FileNotFound
As usual, Zig error messages aren't that helpful (yet). Only coincidentally, I found an old dump of zigs freenode IRC channel pointing me in the right direction:
21:25 <ifreund> the
zigbinary needs to stay at the same relative path to the
So the solution is not only to copy the binary but also the lib directory from the tarball.
Hopefully, this will be picked up by the search engines, so next time someone encounters the issue, it's a little bit less of a riddle.