armory3d / armsdk

Single-clone Armory SDK
37 stars 30 forks source link

Fixed long-standing permissions bug on Linux and macOS. #54

Closed TriVoxel closed 1 year ago

TriVoxel commented 1 year ago

Since Armory is a Blender addon that must be distributed through a .zip file, executable files will not work on macOS or Linux. This update adds code that automatically assigns the correct permissions every time the Armory addon is initialized. This allows users to simply install the addon on macOS and Linux and have it work. This has never been the case, and has always required extra setup on these platforms.

Unlike the last two pull requests, this one actually fixes the problem once and for all! The first time, untested code had issues on macOS. The second time, Xcode decided to undo all my work for some reason and I didn't notice until after I submitted the PR. This code is tested and working on macOS and Linux.

luboslenco commented 1 year ago

Thanks a lot!

This allows users to simply install the addon on macOS and Linux and have it work. This has never been the case, and has always required extra setup on these platforms.

Not sure on what it depends, but testing ArmorySDK-2022-10.zip on Ubuntu 20.04 seems to work out of the box? Extract the zip and install armory.py.

TriVoxel commented 1 year ago

Ah yes! So the issue is, Armory will install and show up in Blender's interface. However, when you try to build a scene it will usually fail with some errors in the console. This fixes those errors which were caused by the programs Armory uses to byild being blocked from running on Linux. This issue is only apparent when trying to build a scene.

luboslenco commented 1 year ago

Yes, it builds & runs the scene fine on Ubuntu 20.04 out of the box with 2022-10 release for some reason.

I guess the reason is that the permissions should be preserved even in zip file? Just wondering why it did not work on your Linux machine before, it's still great to have this patch in place to make it more reliable.

https://unix.stackexchange.com/questions/313656/preserving-permissions-while-zipping https://serverfault.com/questions/585817/is-zip-archive-capable-of-storing-permissions/585889#585889