Codesign on Mac fails when including shapely

112 views
Skip to first unread message

Israel Brewster

unread,
May 25, 2022, 2:18:21 AM5/25/22
to pyins...@googlegroups.com
I am trying to code sign my application created with pyinstaller (actually, it looks like pyinstaller tries to do that for me as well!), but said attempt is failing with the following message:

/Users/israel/Downloads/SO2 Explorer 2.5.2-beta.app: bundle format unrecognized, invalid, or unsuitable
In subcomponent: /Users/israel/Downloads/SO2 Explorer 2.5.2-beta.app/Contents/MacOS/shapely/.dylibs

What it looks like is that the codesign tool is mistakenly seeing the .dylibs *folder* as a bundle of some sort, and is trying to sign it - which, of course, fails since it is just a directory, not a bundle.

How might I be able to fix this?
---
Israel Brewster
Software Engineer
Alaska Volcano Observatory 
Geophysical Institute - UAF 
2156 Koyukuk Drive 
Fairbanks AK 99775-7320

bwoodsend

unread,
May 26, 2022, 4:12:31 AM5/26/22
to PyInstaller

For some reason, codesign is allergic to names with . in them in the Contents/MacOS/ subdirectory. Normally the hacky workaround is to move shapely to Contents/Resources then create a symlink (using ln -s) from Contents/MaOS/shapely to Contents/Resources/shapely. See also the same issue here.

Israel Brewster

unread,
May 27, 2022, 5:00:34 AM5/27/22
to pyins...@googlegroups.com
That worked beautifully, thanks! Now to go script that up so I don’t have to do it manually every time.

Any way to get pyinstaller to do this automatically when packaging the shapely dependency? Some way to modify the hook file to stick it in a different location and create the symlink?

---
Israel Brewster
Software Engineer
Alaska Volcano Observatory 
Geophysical Institute - UAF 
2156 Koyukuk Drive 
Fairbanks AK 99775-7320
On May 25, 2022, at 12:25 PM, bwoodsend <bwoo...@gmail.com> wrote:

For some reason, codesign is allergic to names with . in them in the Contents/MacOS/ subdirectory. Normally the hacky workaround is to move shapely to Contents/Resources then create a symlink (using ln -s) from Contents/MaOS/shapely to Contents/Resources/shapely. See also the same issue here.


--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/679f302d-74b0-4de8-a18f-3d486f101c78n%40googlegroups.com.

bwoodsend

unread,
May 29, 2022, 4:12:57 PM5/29/22
to PyInstaller

I’m afraid not. And I doubt there ever will specifically be something to move files around and replace them with symlinks in PyInstaller since the real fix would be for PyInstaller not to put libraries in the MacOS folder to begin with. Nobody is going to wire in a workaround when they know that they could be fixing it instead. That fix will be harder than it sounds however because it will require mucking around with embedded linker paths so that all the various components can still find each other. Unfortunately, PyInstaller doesn’t have any regular macOS developers so macOS specific stuff tends to fall by the wayside.

Reply all
Reply to author
Forward
0 new messages