TokisanGames / Terrain3D

A high performance, editable terrain system for Godot 4.
MIT License
1.92k stars 108 forks source link

Distribute signed binaries for MacOS #227

Open phire opened 9 months ago

phire commented 9 months ago

Apple have gone out of their way to make it painful to run unsigned binaries downloaded from the internet.

Every time you install the add-on into a project, you have to

  1. Launch Godot
  2. Click Cancel when the dialog offers to delete the .dynlib
  3. Open system preferences
  4. Navigate to Privacy and Security
  5. Scroll down to Security, find the "libterrain.macos.debug was blocked from use because it's not from an identified developer" (which doesn't show up until after you hit cancel the first time)
  6. Click "Allow Anyways"
  7. Switch back to Godot and Click Cancel a second time.
  8. Finally, the third dialog will finally allow you to click "Open" to bypass the security and run the unsigned binary.

You then have to repeat this when running the release version of the project. And end users will need to follow these complex steps too.

Also, there appears to be a bug. Depending on exactly how many times you hit cancel during launch, Godot will corrupt all external references in the project, which breaks demo project. Took me a long time to work out why the demo project wasn't working for me.

mccolljr commented 3 weeks ago

I just ran into this. The above steps did resolve my problem, but it would be beneficial if this wasn't required.

TokisanGames commented 3 weeks ago

@mccolljr Thanks for the confirmation.

These steps are good enough for testing and development. When it comes to release, someone needs to pay Apple for a developer account and sign the binaries. That's either me or you. I don't have a mac, nor enough macos users, nor income generated from macos games sales (exactly $0) to justify paying them at this time. On the other hand, gamedevs who plan to release on macos/ios are already paying Apple so they can sign their own binaries. Once setup, it's only a few more minutes to build Terrain3D and sign it with that key.

You can read the journey of Godot's signing here, which didn't happen until they had ~20k users, 5 years after its first release.

mccolljr commented 3 weeks ago

That's fair. I wouldn't expect anyone to pay Apple's ridiculous price when they aren't making any money on the signed thing. Are you open to documentation enhancements to clarify the necessary steps for macos users to use the pre-built binaries? If so, I would be happy to contribute something as long as you can point me to where I should make changes.

TokisanGames commented 3 weeks ago

Yes, of course I'll take documentation updates. Please update the instructions above, even with screenshots if you like, right here. I can make a documentation page for it like I did with mobile/web.

mccolljr commented 2 weeks ago

Sounds good. I will spend some time this weekend and write something up.

jamonholmgren commented 6 days ago

Just FYI, you can just get rid of the download quarantine attribute, which is what is causing this issue. Just cd to the terrain_3d directory and run this command:

find . -type f -exec xattr -r -d com.apple.quarantine {} \;

After doing this, you won't have any pop-ups about untrusted files.

(If you're leery of running this command, I understand -- run man xattr to learn more about it, and the find . -type f just finds all files recursively and applies this command. com.apple.quarantine is the attribute we're removing.)

(Also note: I haven't gotten Terrain3D working on macOS yet, unfortunately -- even the demo code. I'm getting a parse error for editor.gd: res://addons/terrain_3d/editor.gd:13 - Parse Error: Could not find type "Terrain3D" in the current scope. ... still working through the troubleshooting steps.)

TokisanGames commented 6 days ago

@jamonholmgren Thanks for the tip. That message means you don't have a binary library accessible for Godot to load, because you didn't download the binary release build, the files are in the wrong place, you didn't build the source yourself, or apple security is preventing access.

I see you updated your note on the other thread. Please update your note and instructions here so we have the full set for working with Apple security with the distributed binaries.