Fixing Access Denied error on MacOS

In MacOS beta 27 (Golden Gate), if experiencing the error AccessDenied; example: error: unable to load "" AccessDenied.

  1. Simply reset permissions for the ~/.cache/zig using the chown command sudo chown -R $USER:staff ~/.cache/zig
  2. Delete it using sudo rm -r ~/.cache/zig

Finally run zig build and it should compile. At least that is what worked for me

1 Like

The second step seems to obviate the first?

Hmm I have the beta 27 installed too and haven’t noticed problems so far. How did you install the zig toolchain?

My ~/.cache/zig existed before installing the beta though.

FWIW, a zig clean command would be nice which deletes the global cache and all the local .zig-* and zig-* directories (but I guess in that case it wouldn’t help much since zig wouldn’t have permission to access ~/.cache/zig.

These are just the steps I did. I can’t replicate the issue but prehaps you are right.

I did a fresh first time zig install on macos beta27 and used both brew install and the zig binary (both yielding same error)