Creating an app with cx_Freeze. Signing with developer id certificate and enabling hardened runtime. The app crashes with MemoryError in ctypes module. Tried setting com.apple.security.cs.allow-unsigned-executable-memory entitlement. Still the app crashes
Traceback
File "/Users/acano/jenkins/workspace/configurator-build-mac/configurator/ve.build/lib/python3.7/site-packages/cx_Freeze/initscripts/__startup__.py", line 40, in run
module.run()
File "/Users/acano/jenkins/workspace/configurator-build-mac/configurator/ve.build/lib/python3.7/site-packages/cx_Freeze/initscripts/Console.py", line 23, in run
exec(code, {'__name__': '__main__'})
File "server.py", line 3, in <module>
File "/Users/acano/jenkins/workspace/configurator-build-mac/configurator/ve.build/lib/python3.7/site-packages/cherrypy/__init__.py", line 76, in <module>
from . import _cprequest, _cpserver, _cptree, _cplogging, _cpconfig
File "/Users/acano/jenkins/workspace/configurator-build-mac/configurator/ve.build/lib/python3.7/site-packages/cherrypy/_cpserver.py", line 6, in <module>
from cherrypy.process.servers import ServerAdapter
File "/Users/acano/jenkins/workspace/configurator-build-mac/configurator/ve.build/lib/python3.7/site-packages/cherrypy/process/__init__.py", line 13, in <module>
from .wspbus import bus
File "/Users/acano/jenkins/workspace/configurator-build-mac/configurator/ve.build/lib/python3.7/site-packages/cherrypy/process/wspbus.py", line 66, in <module>
import ctypes
File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/__init__.py", line 551, in <module>
_reset_cache()
File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/__init__.py", line 273, in _reset_cache
CFUNCTYPE(c_int)(lambda: None)
MemoryError
Entitlements Plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
</dict>
</plist>
Output of Codesign
Executable=/Users/acano/jenkins/workspace/configurator-build-mac/configurator/InstallAssistant-2.8.app/Contents/MacOS/server
Identifier=InstallAssistant-2.8
Format=app bundle with Mach-O thin (x86_64)
CodeDirectory v=20500 size=416 flags=0x10000(runtime) hashes=4+5 location=embedded
VersionPlatform=1
VersionMin=658944
VersionSDK=658944
Hash type=sha256 size=32
CandidateCDHash sha256=60ca1d19981afee79d1860c78df9a707d152c5a1
Hash choices=sha256
Page size=4096
CDHash=60ca1d19981afee79d1860c78df9a707d152c5a1
Signature size=4639
Authority=Developer ID Application: Cisco (DE8Y96K9QP)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
Signed Time=25 Feb 2020 at 09:10:31
Info.plist entries=5
TeamIdentifier=DE8Y96K9QP
Runtime Version=10.14.0
Sealed Resources version=2 rules=13 files=5091
Internal requirements count=1 size=180
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
</dict>
</plist>