Zig on MacOS: ...not signed. Can't execute

I am currently on vacation and I am using a Apple iMac (Darwin), which is not my own and on which I have no sysadmin rights. I am an ordinary user.
I want to use zig on this PC. I tried the master version and the last official release. Both are flagged as
“from an unknown source” and marked as “unsigned” and therefore won’t be executed.
Homebrew is not installed.
Is there any package/image/… of a recent Zig available, which I am able to execute on this iMac whitout haveing the rights to change any system configuration?

Cheers!
Tuxic

After you get the access denied error, go to System Preferences > Security & Privacy and at the lower right. corner you shoud see a button to allow Zig to run. Once you press that and run zig again, it will prompt asking if you want to execute a file downloaded from the Internet, click Open and it should then run fine from that point onwards. I’m on a Mac M1 and with each new version of Zig I download, I have to repeat these steps. But only the first time I run it. But I do think you need Admin rights to do this; in that case you would need to ask a user with admin rights to do the process at least once to allow zig to run system-wide for all users.

Hi,

as said: This is not my computer and asked for a solution/workaround which does not need to change any system configuration (see inital post) and a mentioned, that I don’t have ssyadmin rights/access.
So…I assume the short answer to my question is:
No.

Cheers!
Tuxic

Here are some options:

Boot from live usb stick

You might be able to create a live usb stick with some linux distribution, do whatever magic incantations (I think there are some special key combinations to open up the boot menu) are required to get the iMac to open a boot menu and then boot from that usb stick.

You then can just work in that linux live usb distro, without having to install it on the hardware, then store your work on another usb stick or online etc. Just make sure to leave the harddrive/storage of the machine untouched, so that after restarting it can boot into osx like normally.

While I have successfully done that with some old mac book, I can’t remember the details, so you will have to search for articles describing that. With more recent hard-/software the process may be different.
I am also not sure whether getting boot access will be behind some kind of password, also I am not very familiar with newer uefi stuff and whats different there.

It is probably a long shot, unless you already have a bit experience in that direction or find some guide that helps you. Also only try something like this if you understand what you are doing, so you can avoid turning someone elses computer into a brick. :wink:

VNC viewer or Virtual machine

Another probably safer/easier option would be to use a remote desktop tool (some VNC viewer) to work on some other machine via internet, or use some virtual machine software (Virtualbox etc.) and work in that virtual machine locally. Of course that only works if you are able to install and use one of those fully, without any admin rights. I think osx may already have a vnc client pre installed.

ssh into another machine via terminal

Lastly another thing would be using ssh to connect to some other machine from commandline/terminal and than work within that terminal, but that way you only have the typical ssh terminal interaction which can be quite limiting, if you want to do something more graphical.


All of these have varying degrees of usefulness and difficulty to make them work, maybe one of these options is useful for you. I have mostly avoided macs so my knowledge of them is very limited.

Maybe I’m confusing this problem with something else, but usually I just right-click on the executable and select Open from the contextual menu. Opening the program like that (as opposed to just double clicking on it) will show a popup that asks me to confirm that I want to run an untrusted program. After I give confirmation, every subsequent access to the executable will be fine.

Holy crap @kristoff ! That totally worked for me! Can’t believe how simple this method is compared to the mess I was doing before. Thanks.

1 Like

Does not work for me. Shows a dialog saying (something like):
“You are overrideing system configurations!” and asked for the
root passwd.

This only happens if you download via a web browser. If you download the archive via curl it won’t bother you:

curl -O https://ziglang.org/builds/zig-macos-x86_64-0.11.0-dev.1017+d86685ac9.tar.xz
1 Like