godot: 3.2.2 Linux headless version exports invalid Mac app
Godot version:
3.2.2 Linux Headless
OS/device including version:
Ubuntu 18.04 for building, Mac OS Catalina (10.15.5) for running the app
Issue description:
When exporting a Mac build with the Linux headless version of Godot 3.2.2 the result is an .app file that cannot be run.
I’m using my GitHub workflow that runs the Linux headless version of Godot to export projects. After updating the workflow to use Godot 3.2.2, this workflow no longer outputs a valid Mac app. When attempting to run the app on my Mac I receive a dialog that states:
Exporting the Mac app from the Windows version of Godot 3.2.2 produces an app that can be run without issue.
Steps to reproduce:
- Create an empty project
- Create a minimal Mac export
- Using the Linux Headless version of 3.2.2, export the Mac app from the command line
- Attempt to run the app on a Mac, observe the error
Minimal reproduction project:
ActionsTest-master.zip Please note that the standard project is the project directory. You can also try with the mono project in project-mono to see the same result.
If it helps, here is the output app for the standard build: https://drive.google.com/file/d/16aYbNx7ovtIKkqvgd_SAZ7ya-7uo6L93/view?usp=sharing
And here is the output app for the mono build: https://drive.google.com/file/d/1-HJnBxJ3-n8XokI-NBsz0QA3xBncPL7P/view?usp=sharing
This issue originally stated this was a mono-specific issue. After some more troubleshooting it was found that the issue also applies to the standard version.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 26 (22 by maintainers)
Actually it’s just constant size issue, changed it to:
(results in following output by zip-info, and is extracted correctly by all apps I have tested):
instead of
(results in following output by zip-info, and have broken files when extracted by Archive Util)
or
(results in following output by zip-info, and seems to be extracted correctly)
Also, I have checked info-zip source and it’s setting attributes as following (result seems to be the same, not sure why it’s done it this way):
Thanks @firebelley! That means this regression is due to my changes in #39700.
I don’t really understand why, but it seems the file type flags I’ve added are invalid when zipping from a linux system then. A possible hotfix might be to set zip flags differently depending on the platform we’re exporting from. I’ll try and reproduce it in the coming days to see if I can figure it out.
@bruvzg I agree it would be worth checking with a different zip library, although at this point I have no idea if the problems we’re encountering are mostly coming from the library itself or some weirdness in macOS archivers 😃
Skimming this thread, am I correct to assume that we’ll have to wait for 4.0 until headless export to OSX works, and will have to export using the normal editor build in the meantime?
Good catch! That makes a lot of sense. Bit-wise operators on signed integers are undefined and probably made the result compiler specific.
It’s strange. I’m not getting the same results as you do, and my change is only setting some standard “normal file” flag on all files 😕 I agree it makes sense to revert #39700 for now though, and if needed we’ll make another fix later.
The next thing I’ll do is testing again with the official 3.2.2 release to see if my problem could be specific to my compilation of godot somehow.
Here’s my previous test case scenario:
Zip export created on Windows 10 (godot master, compiled with vs 2019) Zip extracted on OSX, version: 10.13.6 (High Sierra)
Before #39700: Doesn’t work with default Archive Utility (file not executable) Works when extracted using unzip in command line
After #39700: Works with both Archive Utility & unzip in command line
Given the confusion that’s resulted from https://github.com/godotengine/godot/issues/527 still being open despite https://github.com/godotengine/godot/pull/33447 & https://github.com/godotengine/godot/issues/527#issuecomment-500594602, would it be good to:
BTW @pouleyKetchoupp during my research I discovered this project which seems to document some of the issues they encountered with Mac + Zip support:
(It was described in https://github.com/sindresorhus/gulp-zip/issues/38#issuecomment-75138908 as “…spent about 6 hours today working with every zip library for node. [It was] The only one that has worked…” )
Some extra info:
Also checked it on the current 3.2 head, same effect, files full of 0x00 when extracted with Archive Util, normal when extracting with Keka. Reverting #39700 do fix it and extracted files have correct permissions with both Archive Util and Keka.
I have rechecked this ZIP and it seems to have +x on executable when extracting with both Archive Utility and Keka, but result of Archive Utility contains only 0x00 in all files (size is valid)!