From barry at barrys-emacs.org Sun Jan 2 08:02:58 2022 From: barry at barrys-emacs.org (Barry Scott) Date: Sun, 2 Jan 2022 13:02:58 +0000 Subject: [Pythonmac-SIG] py2app fails to build PyQt5 apps anymore In-Reply-To: <9766E8B1-45CF-4817-A0FB-DAF40D9FB08B@cwi.nl> References: <49073365-7124-4D85-BC75-987333561419@barrys-emacs.org> <9766E8B1-45CF-4817-A0FB-DAF40D9FB08B@cwi.nl> Message-ID: <3EA7B79E-DC99-493D-9B56-2D71785C97F8@barrys-emacs.org> > On 22 Dec 2021, at 23:36, jack.jansen at cwi.nl wrote: > > Hmm, my guess is that it fails when it fails when Qt tries to access the window manager (the `QtWidgets.QApplication( argv )` call). But why it would fail when built with pyinstaller and not with py2app I have absolutely no clue? > > Could it be that a new entitlement or something was added by Apple for Monterey, maybe for accessing the window manager, and py2app doesn?t know about this? Anyone (Ronald, probably) have any idea? I have been trying to check the entitlements that each version of the App has on the assumption that I could add any missing ones to the y2app version and see if that is indeed the issue. But the Apple suggested command: $ codesign --display --entitlements tmp.pyinstaller/dist/gui_test.app Usage: codesign -s identity [-fv*] [-o flags] [-r reqs] [-i ident] path ... # sign codesign -v [-v*] [-R=|-R ] path|[+]pid ... # verify codesign -d [options] path ... # display contents codesign -h pid ... # display hosting paths As you see just prints its usage. man codesign is no more helpful. Do you know what the for the --entitlements option is should be? There is talk of a entitlemts.plist but I do seem to have that file at all. Barry > > -- > Jack Jansen, >, http://www.cwi.nl/~jack > If I can't dance I don't want to be part of your revolution -- Emma Goldman > > > >> On 21 Dec 2021, at 12:46, Barry Scott > wrote: >> >> For a long time I have been happily building my App bundles using py2app. >> At some point that stopped working. I do not have a record of exactly >> when. Last time I saw everything work was Feb 2021. >> >> I have reduced the problem to a simple test program and scripts to >> build and run the test code to show the issue. >> >> As a comparison I have py2app and pyinstaller versions of the tests. >> The pyinstaller version works and the py2app version fails. >> >> The code is on github here: >> >> https://github.com/barry-scott/scm-workbench/tree/master/Source/Experiments >> >> Run ./build-py2app.sh to build and run the py2app version. >> Run ./build-pyinstaller.sh to build and runt he pyinstaller version. >> >> The scripts: >> 1. build a venv >> 2. run gui_test.py from the command line >> 3. build the app using py2app or pyinstaller >> 4. run the app. >> >> I am using macOS 12.1 on Intel MacBook Pro (15-inch, 2016). >> Python 3.10.1 from python.org. >> >> The gui_test.py code logs to ~/gui_test.log at key points. >> >> Here is the source: >> >> ---- >> #!/usr/bin/env python >> import sys >> import os >> >> log_filename = '%s/gui_test.log' % (os.environ['HOME'],) >> sys.stdout = open( log_filename, 'a' ) >> sys.stderr = sys.stdout >> print('---- gui_test.py ----', flush=True) >> >> from PyQt5 import QtCore, QtWidgets >> from PyQt5.QtWidgets import QMainWindow, QLabel, QGridLayout, QWidget >> from PyQt5.QtCore import QSize >> >> class HelloWindow(QMainWindow): >> def __init__( self ): >> super().__init__() >> >> if sys.maxsize > (2**31): >> size_int_t = 64 >> else: >> size_int_t = 32 >> >> py_ver = '%d.%d-%d' % (sys.version_info.major, sys.version_info.minor, size_int_t) >> >> self.setMinimumSize( QSize(350, 100) ) >> self.setWindowTitle( 'GUI test - python %s' % (py_ver,) ) >> >> self.setCentralWidget( QLabel( ' GUI test - python %s ' % (py_ver,), self ) ) >> >> def main( argv ): >> print('QtWidgets.QApplication()', flush=True) >> app = QtWidgets.QApplication( argv ) >> >> print('HelloWindow()', flush=True) >> main_win = HelloWindow() >> >> print('main_win.show()', flush=True) >> main_win.show() >> >> print('app.exec_()', flush=True) >> rc = app.exec_() >> >> print('rc', rc, flush=True) >> return rc >> >> if __name__ == "__main__": >> sys.exit( main( sys.argv ) ) >> ---- >> >> On a successful run the log shows: >> >> ---- gui_test.py ---- >> QtWidgets.QApplication() >> HelloWindow() >> main_win.show() >> app.exec_() >> rc 0 >> >> When it fails it shows: >> >> ---- gui_test.py ---- >> QtWidgets.QApplication() >> >> Here is the problem report that is generated: >> >> REGION TYPE SIZE COUNT (non-coalesced) >> =========== ======= ======= >> Activity Tracing 256K 1 >> Kernel Alloc Once 8K 1 >> MALLOC 192.1M 30 >> MALLOC guard page 16K 4 >> MALLOC_LARGE (reserved) 128K 1 reserved VM address space (unallocated) >> MALLOC_NANO (reserved) 384.0M 1 reserved VM address space (unallocated) >> STACK GUARD 56.0M 3 >> Stack 9232K 3 >> VM_ALLOCATE 6156K 9 >> __DATA 17.4M 265 >> __DATA_CONST 10.9M 152 >> __DATA_DIRTY 492K 86 >> __FONT_DATA 4K 1 >> __LINKEDIT 651.4M 26 >> __OBJC_RO 81.8M 1 >> __OBJC_RW 3136K 2 >> __TEXT 205.4M 280 >> __UNICODE 588K 1 >> dyld private memory 1024K 1 >> mapped file 28.3M 2 >> shared memory 592K 7 >> =========== ======= ======= >> TOTAL 1.6G 877 >> TOTAL, minus reserved VM space 1.2G 877 >> >> >> >> ----------- >> Full Report >> ----------- >> >> {"app_name":"gui_test","timestamp":"2021-12-21 11:43:08.00 +0000","app_version":"1.2.3","slice_uuid":"abecb05c-e91d-336e-81d6-4a467d071ee8","build_version":"1.2.3","platform":1,"bundleID":"gui_test","share_with_app_devs":0,"is_first_party":0,"bug_type":"309","os_version":"macOS 12.1 (21C52)","incident_id":"6A9D2853-2DEE-4C33-B374-1017075B2772","name":"gui_test"} >> { >> "uptime" : 110000, >> "procLaunch" : "2021-12-21 11:43:08.5661 +0000", >> "procRole" : "Background", >> "version" : 2, >> "userID" : 501, >> "deployVersion" : 210, >> "modelCode" : "MacBookPro13,3", >> "procStartAbsTime" : 113541505574837, >> "coalitionID" : 515116, >> "osVersion" : { >> "train" : "macOS 12.1", >> "build" : "21C52", >> "releaseType" : "User" >> }, >> "captureTime" : "2021-12-21 11:43:08.7600 +0000", >> "incident" : "6A9D2853-2DEE-4C33-B374-1017075B2772", >> "bug_type" : "309", >> "pid" : 17474, >> "procExitAbsTime" : 113541698791884, >> "cpuType" : "X86-64", >> "procName" : "gui_test", >> "procPath" : "\/Users\/USER\/*\/gui_test.app\/Contents\/MacOS\/gui_test", >> "bundleInfo" : {"CFBundleShortVersionString":"1.2.3","CFBundleVersion":"1.2.3","CFBundleIdentifier":"gui_test"}, >> "storeInfo" : {"deviceIdentifierForVendor":"58974244-6450-5437-A094-9481191631E1","thirdParty":true}, >> "parentProc" : "launchd", >> "parentPid" : 1, >> "coalitionName" : "gui_test", >> "crashReporterKey" : "0947E507-B37B-E5B7-D29C-312263801DC3", >> "wakeTime" : 4348, >> "bridgeVersion" : {"build":"14Y908","train":"3.0"}, >> "sleepWakeUUID" : "BEA2B543-B8F3-412A-9B1A-07DB3F35A685", >> "sip" : "enabled", >> "isCorpse" : 1, >> "exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGABRT"}, >> "asi" : {"libsystem_c.dylib":["abort() called"]}, >> "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0}, >> "faultingThread" : 0, >> "threads" : [{"triggered":true,"id":2520143,"threadState":{"r13":{"value":4432803416,"symbolLocation":0,"symbol":"QListData::shared_null"},"rax":{"value":0},"rflags":{"value":582},"cpu":{"value":0},"r14":{"value":6},"rsi":{"value":6},"r8":{"value":140704637244760,"symbolLocation":456,"symbol":"__sFX"},"cr2":{"value":4372226054},"rdx":{"value":0},"r10":{"value":0},"r9":{"value":0},"r15":{"value":22},"rbx":{"value":4570531328,"symbolLocation":0,"symbol":"_main_thread"},"trap":{"value":133},"err":{"value":33554760},"r11":{"value":582},"rip":{"value":140703537946898,"matchesCrashFrame":1},"rbp":{"value":140701977840384},"rsp":{"value":140701977840344},"r12":{"value":259},"rcx":{"value":140701977840344},"flavor":"x86_THREAD_STATE","rdi":{"value":259}},"queue":"com.apple.main-thread","frames":[{"imageOffset":28946,"symbol":"__pthread_kill","symbolLocation":10,"imageIndex":0},{"imageOffset":25108,"symbol":"pthread_kill","symbolLocation":263,"imageIndex":1},{"imageOffset":531728,"! >> symbol":" >> abort","symbolLocation":123,"imageIndex":2},{"imageOffset":99625,"symbol":"qt_message_fatal(QtMsgType, QMessageLogContext const&, QString const&)","symbolLocation":9,"imageIndex":3},{"imageOffset":105588,"symbol":"QMessageLogger::fatal(char const*, ...) const","symbolLocation":202,"imageIndex":3},{"imageOffset":230361,"symbol":"QGuiApplicationPrivate::createPlatformIntegration()","symbolLocation":7193,"imageIndex":4},{"imageOffset":230395,"symbol":"QGuiApplicationPrivate::createEventDispatcher()","symbolLocation":27,"imageIndex":4},{"imageOffset":2064815,"symbol":"QCoreApplicationPrivate::init()","symbolLocation":1599,"imageIndex":3},{"imageOffset":207705,"symbol":"QGuiApplicationPrivate::init()","symbolLocation":57,"imageIndex":4},{"imageOffset":43738,"symbol":"QApplicationPrivate::init()","symbolLocation":26,"imageIndex":5},{"imageOffset":1357272,"symbol":"init_type_QApplication(_sipSimpleWrapper*, _object*, _object*, _object**, _object**, _object**)","symbolLocation":168! >> ,"imageIn >> dex":6},{"imageOffset":26459,"symbol":"sipSimpleWrapper_init","symbolLocation":203,"imageIndex":7},{"imageOffset":1121781,"symbol":"type_call","symbolLocation":325,"imageIndex":8},{"imageOffset":552935,"symbol":"_PyObject_MakeTpCall","symbolLocation":135,"imageIndex":8},{"imageOffset":1868333,"symbol":"call_function","symbolLocation":365,"imageIndex":8},{"imageOffset":1833294,"symbol":"_PyEval_EvalFrameDefault","symbolLocation":28702,"imageIndex":8},{"imageOffset":1798114,"symbol":"_PyEval_Vector","symbolLocation":402,"imageIndex":8},{"imageOffset":1868143,"symbol":"call_function","symbolLocation":175,"imageIndex":8},{"imageOffset":1824309,"symbol":"_PyEval_EvalFrameDefault","symbolLocation":19717,"imageIndex":8},{"imageOffset":1798114,"symbol":"_PyEval_Vector","symbolLocation":402,"imageIndex":8},{"imageOffset":1774299,"symbol":"builtin_exec","symbolLocation":331,"imageIndex":8},{"imageOffset":973990,"symbol":"cfunction_vectorcall_FASTCALL","symbolLocation":86,"imageIndex"! >> :8},{"ima >> geOffset":1868143,"symbol":"call_function","symbolLocation":175,"imageIndex":8},{"imageOffset":1824309,"symbol":"_PyEval_EvalFrameDefault","symbolLocation":19717,"imageIndex":8},{"imageOffset":1798114,"symbol":"_PyEval_Vector","symbolLocation":402,"imageIndex":8},{"imageOffset":1868143,"symbol":"call_function","symbolLocation":175,"imageIndex":8},{"imageOffset":1824309,"symbol":"_PyEval_EvalFrameDefault","symbolLocation":19717,"imageIndex":8},{"imageOffset":1798114,"symbol":"_PyEval_Vector","symbolLocation":402,"imageIndex":8},{"imageOffset":2278253,"symbol":"pyrun_file","symbolLocation":333,"imageIndex":8},{"imageOffset":2276141,"symbol":"_PyRun_SimpleFileObject","symbolLocation":365,"imageIndex":8},{"imageOffset":2291149,"symbol":"PyRun_SimpleFileExFlags","symbolLocation":109,"imageIndex":8},{"imageOffset":20165,"symbol":"py2app_main","symbolLocation":5481,"imageIndex":9},{"imageOffset":13143,"symbol":"main","symbolLocation":257,"imageIndex":9},{"imageOffset":21758,"symbo! >> l":"start >> ","symbolLocation":462,"imageIndex":10}]},{"id":2520154,"frames":[{"imageOffset":8172,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":1}]},{"id":2520155,"frames":[{"imageOffset":8172,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":1}]}], >> "usedImages" : [ >> { >> "source" : "P", >> "arch" : "x86_64", >> "base" : 140703537917952, >> "size" : 225280, >> "uuid" : "5aa1e5be-b5b8-3a02-9885-a8c99e0ca378", >> "path" : "\/usr\/lib\/system\/libsystem_kernel.dylib", >> "name" : "libsystem_kernel.dylib" >> }, >> { >> "source" : "P", >> "arch" : "x86_64", >> "base" : 140703538143232, >> "size" : 49152, >> "uuid" : "6c7561b4-4b92-3f45-921e-abe669299844", >> "path" : "\/usr\/lib\/system\/libsystem_pthread.dylib", >> "name" : "libsystem_pthread.dylib" >> }, >> { >> "source" : "P", >> "arch" : "x86_64", >> "base" : 140703536902144, >> "size" : 561152, >> "uuid" : "e58814cc-dcb7-35a5-badc-e367ed3ac207", >> "path" : "\/usr\/lib\/system\/libsystem_c.dylib", >> "name" : "libsystem_c.dylib" >> }, >> { >> "source" : "P", >> "arch" : "x86_64", >> "base" : 4427026432, >> "size" : 5705728, >> "uuid" : "c723812a-f7a5-3001-98d5-e60e8daa6ffb", >> "path" : "\/Users\/USER\/*\/gui_test.app\/Contents\/Resources\/lib\/python3.10\/PyQt5\/Qt5\/lib\/QtCore.framework\/Versions\/5\/QtCore", >> "name" : "QtCore" >> }, >> { >> "source" : "P", >> "arch" : "x86_64", >> "base" : 4446490624, >> "size" : 5152768, >> "uuid" : "cbcec35a-ee54-354f-9c2b-188ac6b2790d", >> "path" : "\/Users\/USER\/*\/gui_test.app\/Contents\/Resources\/lib\/python3.10\/PyQt5\/Qt5\/lib\/QtGui.framework\/Versions\/5\/QtGui", >> "name" : "QtGui" >> }, >> { >> "source" : "P", >> "arch" : "x86_64", >> "base" : 4439920640, >> "size" : 4485120, >> "uuid" : "b432d666-dcab-320a-8496-78a67f554c0e", >> "path" : "\/Users\/USER\/*\/gui_test.app\/Contents\/Resources\/lib\/python3.10\/PyQt5\/Qt5\/lib\/QtWidgets.framework\/Versions\/5\/QtWidgets", >> "name" : "QtWidgets" >> }, >> { >> "source" : "P", >> "arch" : "x86_64", >> "base" : 4434120704, >> "size" : 2932736, >> "uuid" : "47b40141-df86-3d2f-98d5-ee16cb313cd6", >> "path" : "\/Users\/USER\/*\/gui_test.app\/Contents\/Resources\/lib\/python3.10\/PyQt5\/QtWidgets.abi3.so", >> "name" : "QtWidgets.abi3.so" >> }, >> { >> "source" : "P", >> "arch" : "x86_64", >> "base" : 4408209408, >> "size" : 98304, >> "uuid" : "62f78d75-6251-3b27-a4b3-a3247d07abe8", >> "path" : "\/Users\/USER\/*\/gui_test.app\/Contents\/Resources\/lib\/python3.10\/PyQt5\/sip.cpython-310-darwin.so", >> "name" : "sip.cpython-310-darwin.so" >> }, >> { >> "source" : "P", >> "arch" : "x86_64", >> "base" : 4411924480, >> "CFBundleShortVersionString" : "3.10.1, (c) 2001-2021 Python Software Foundation.", >> "CFBundleIdentifier" : "org.python.python", >> "size" : 3637248, >> "uuid" : "1071a8dd-3e3d-3958-95bf-ba33f1f82be5", >> "path" : "\/Users\/USER\/*\/gui_test.app\/Contents\/Frameworks\/Python.framework\/Versions\/3.10\/Python", >> "name" : "Python", >> "CFBundleVersion" : "3.10.1" >> }, >> { >> "source" : "P", >> "arch" : "x86_64", >> "base" : 4370935808, >> "CFBundleShortVersionString" : "1.2.3", >> "CFBundleIdentifier" : "gui_test", >> "size" : 32768, >> "uuid" : "abecb05c-e91d-336e-81d6-4a467d071ee8", >> "path" : "\/Users\/USER\/*\/gui_test.app\/Contents\/MacOS\/gui_test", >> "name" : "gui_test", >> "CFBundleVersion" : "1.2.3" >> }, >> { >> "source" : "P", >> "arch" : "x86_64", >> "base" : 4570005504, >> "size" : 442368, >> "uuid" : "cef5a27a-d50b-3020-af03-1734b19bc8c5", >> "path" : "\/usr\/lib\/dyld", >> "name" : "dyld" >> } >> ], >> "sharedCache" : { >> "base" : 140703534915584, >> "size" : 15216738304, >> "uuid" : "40432a03-88d3-305f-9c0c-e7549e71d927" >> }, >> "vmSummary" : "ReadOnly portion of Libraries: Total=856.8M resident=0K(0%) swapped_out_or_unallocated=856.8M(100%)\nWritable regions: Total=591.6M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=591.6M(100%)\n\n VIRTUAL REGION \nREGION TYPE SIZE COUNT (non-coalesced) \n=========== ======= ======= \nActivity Tracing 256K 1 \nKernel Alloc Once 8K 1 \nMALLOC 192.1M 30 \nMALLOC guard page 16K 4 \nMALLOC_LARGE (reserved) 128K 1 reserved VM address space (unallocated)\nMALLOC_NANO (reserved) 384.0M 1 reserved VM address space (unallocated)\nSTACK GUARD 56.0M 3 \nStack 9232K 3 \nVM_ALLOCATE 6156K 9 \n__DATA 17.4M ! >> 265 >> \n__DATA_CONST 10.9M 152 \n__DATA_DIRTY 492K 86 \n__FONT_DATA 4K 1 \n__LINKEDIT 651.4M 26 \n__OBJC_RO 81.8M 1 \n__OBJC_RW 3136K 2 \n__TEXT 205.4M 280 \n__UNICODE 588K 1 \ndyld private memory 1024K 1 \nmapped file 28.3M 2 \nshared memory 592K 7 \n=========== ======= ======= \nTOTAL 1.6G 877 \nTOTAL, minus reserved VM space 1.2G 877 \n", >> "legacyInfo" : { >> "threadTriggered" : { >> "queue" : "com.apple.main-thread" >> } >> }, >> "trialInfo" : { >> "rollouts" : [ >> { >> "rolloutId" : "5ffde50ce2aacd000d47a95f", >> "factorPackIds" : { >> >> }, >> "deploymentId" : 240000090 >> }, >> { >> "rolloutId" : "5fc94383418129005b4e9ae0", >> "factorPackIds" : { >> >> }, >> "deploymentId" : 240000185 >> }, >> { >> "rolloutId" : "602ad4dac86151000cf27e46", >> "factorPackIds" : { >> "SIRI_DICTATION_ASSETS" : "6193d03f2171a2330e561dfc" >> }, >> "deploymentId" : 240000290 >> }, >> { >> "rolloutId" : "60da5e84ab0ca017dace9abf", >> "factorPackIds" : { >> >> }, >> "deploymentId" : 240000008 >> }, >> { >> "rolloutId" : "607844aa04477260f58a8077", >> "factorPackIds" : { >> "SIRI_MORPHUN_ASSETS" : "6103050cbfe6dc472e1c982a" >> }, >> "deploymentId" : 240000066 >> }, >> { >> "rolloutId" : "601d9415f79519000ccd4b69", >> "factorPackIds" : { >> "SIRI_TEXT_TO_SPEECH" : "6194416f2171a2330e561f05" >> }, >> "deploymentId" : 240000355 >> } >> ], >> "experiments" : [ >> >> ] >> } >> } >> >> Model: MacBookPro13,3, BootROM 447.60.3.0.0, 4 processors, Quad-Core Intel Core i7, 2.6 GHz, 16 GB, SMC 2.38f12 >> Graphics: Intel HD Graphics 530, Intel HD Graphics 530, Built-In >> Graphics: Radeon Pro 450, AMD Radeon Pro 450, PCIe, 2 GB >> Display: DELL 2408WFP, 1920 x 1200 (WUXGA - Widescreen Ultra eXtended Graphics Array), Main, MirrorOff, Online >> Memory Module: BANK 0/DIMM0, 8 GB, LPDDR3, 2133 MHz, 0x802C, 0x4D5435324C31473332443450472D30393320 >> Memory Module: BANK 1/DIMM0, 8 GB, LPDDR3, 2133 MHz, 0x802C, 0x4D5435324C31473332443450472D30393320 >> AirPort: spairport_wireless_card_type_wifi (0x14E4, 0x15A), Broadcom BCM43xx 1.0 (7.77.111.1 AirPortDriverBrcmNIC-1710.3) >> Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports >> Network Service: USB 10/100/1000 LAN, Ethernet, en7 >> USB Device: Anker USB-C Hub Device >> USB Device: USB3.0 Card Reader >> USB Device: USB 10/100/1000 LAN >> USB Device: USB30Bus >> USB Device: Anker USB-C Hub Device >> USB Device: hub_device >> USB Device: USB Keyboard >> USB Device: hub_device >> USB Device: Microsoft USB Optical Mouse >> USB Device: Flash Card Reader >> USB Device: Anker >> USB Device: Apple T1 Controller >> Thunderbolt Bus: MacBook Pro, Apple Inc., 41.5 >> Thunderbolt Bus: MacBook Pro, Apple Inc., 41.5 >> >> >> Barry >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> https://mail.python.org/mailman/listinfo/pythonmac-sig >> unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jack.jansen at cwi.nl Sun Jan 2 16:08:46 2022 From: jack.jansen at cwi.nl (jack.jansen at cwi.nl) Date: Sun, 2 Jan 2022 22:08:46 +0100 Subject: [Pythonmac-SIG] py2app fails to build PyQt5 apps anymore In-Reply-To: <3EA7B79E-DC99-493D-9B56-2D71785C97F8@barrys-emacs.org> References: <49073365-7124-4D85-BC75-987333561419@barrys-emacs.org> <9766E8B1-45CF-4817-A0FB-DAF40D9FB08B@cwi.nl> <3EA7B79E-DC99-493D-9B56-2D71785C97F8@barrys-emacs.org> Message-ID: <3ED9732C-1978-45F1-8789-8A481B8805F8@cwi.nl> I think the man page for `code sign` is pretty clear (unlike the ?help, indeed:-). --entitlements path When signing, take the file at the given path and embed its contents in the signature as entitlement data. If the data at path does not already begin with a suitable binary ("blob") header, one is attached automatically. When displaying a signature, extract any entitlement data from the signature and write it to the path given in an abstract representation. If needed --xml or --der may be passed in to output the entitlements in a desired format, if you pass in both then DER will be printed. Use "-" as the path to write to standard output. If the signature has no entitlement data, nothing is written (this is not an error). So I read that as: if you use the ?entitlement option when displaying you supply a path here where the entitlement will be stored. And you can pass ?xml or ?der to specify how you want it to be stored. And it seems to work. `codesign --display --entitlement - --xml /Applications/Xcode.app` gives me: ``` Executable=/Applications/Xcode.app/Contents/MacOS/Xcode com.apple.developer.mapscom.apple.sysmond.clientcom.apple.PairingManager.Readcom.apple.dt.simulator.clientcom.apple.PairingManager.Writecom.apple.authkit.client.privatecom.apple.PairingManager.RemovePeercom.apple.private.OAHSoftwareUpdatecom.apple.private.feedback.draftingcom.apple.springboard.debugapplicationscom.apple.private.corespotlight.internalcom.apple.runningboard.assertions.chronodcom.apple.developer.aps-environmentproductioncom.apple.corespotlight.privateindex.unsandboxedcom.apple.private.syspolicy.execution-policy-bypasscom.apple.private.tcc.allow-promptingkTCCServiceAllcom.apple.private.coreservices.definesExtensionPointcom.apple.application-identifier59GAB85EFG.com.apple.dt.Xcodecom.apple.private.dt.xcode.set-responsible-process-for-ui-testingcom.apple.private.AuthorizationServicescom.apple.trust-settings.admincom.apple.private.MobileContainerManager.lookupappDatapluginDatacom.apple.private.tcc.allowkTCCServiceAppleEventskTCCServicePhotoskTCCServiceDeveloperTool ``` Which looks reasonable... -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman > On 2 Jan 2022, at 14:02, Barry Scott wrote: > > > >> On 22 Dec 2021, at 23:36, jack.jansen at cwi.nl wrote: >> >> Hmm, my guess is that it fails when it fails when Qt tries to access the window manager (the `QtWidgets.QApplication( argv )` call). But why it would fail when built with pyinstaller and not with py2app I have absolutely no clue? >> >> Could it be that a new entitlement or something was added by Apple for Monterey, maybe for accessing the window manager, and py2app doesn?t know about this? Anyone (Ronald, probably) have any idea? > > I have been trying to check the entitlements that each version of the App has > on the assumption that I could add any missing ones to the y2app version and > see if that is indeed the issue. > > But the Apple suggested command: > > $ codesign --display --entitlements tmp.pyinstaller/dist/gui_test.app > Usage: codesign -s identity [-fv*] [-o flags] [-r reqs] [-i ident] path ... # sign > codesign -v [-v*] [-R=|-R ] path|[+]pid ... # verify > codesign -d [options] path ... # display contents > codesign -h pid ... # display hosting paths > > As you see just prints its usage. man codesign is no more helpful. > > Do you know what the for the --entitlements option is should be? > > There is talk of a entitlemts.plist but I do seem to have that file at all. > > Barry > > >> >> -- >> Jack Jansen, >, http://www.cwi.nl/~jack >> If I can't dance I don't want to be part of your revolution -- Emma Goldman >> >> >> >>> On 21 Dec 2021, at 12:46, Barry Scott > wrote: >>> >>> For a long time I have been happily building my App bundles using py2app. >>> At some point that stopped working. I do not have a record of exactly >>> when. Last time I saw everything work was Feb 2021. >>> >>> I have reduced the problem to a simple test program and scripts to >>> build and run the test code to show the issue. >>> >>> As a comparison I have py2app and pyinstaller versions of the tests. >>> The pyinstaller version works and the py2app version fails. >>> >>> The code is on github here: >>> >>> https://github.com/barry-scott/scm-workbench/tree/master/Source/Experiments >>> >>> Run ./build-py2app.sh to build and run the py2app version. >>> Run ./build-pyinstaller.sh to build and runt he pyinstaller version. >>> >>> The scripts: >>> 1. build a venv >>> 2. run gui_test.py from the command line >>> 3. build the app using py2app or pyinstaller >>> 4. run the app. >>> >>> I am using macOS 12.1 on Intel MacBook Pro (15-inch, 2016). >>> Python 3.10.1 from python.org . >>> >>> The gui_test.py code logs to ~/gui_test.log at key points. >>> >>> Here is the source: >>> >>> ---- >>> #!/usr/bin/env python >>> import sys >>> import os >>> >>> log_filename = '%s/gui_test.log' % (os.environ['HOME'],) >>> sys.stdout = open( log_filename, 'a' ) >>> sys.stderr = sys.stdout >>> print('---- gui_test.py ----', flush=True) >>> >>> from PyQt5 import QtCore, QtWidgets >>> from PyQt5.QtWidgets import QMainWindow, QLabel, QGridLayout, QWidget >>> from PyQt5.QtCore import QSize >>> >>> class HelloWindow(QMainWindow): >>> def __init__( self ): >>> super().__init__() >>> >>> if sys.maxsize > (2**31): >>> size_int_t = 64 >>> else: >>> size_int_t = 32 >>> >>> py_ver = '%d.%d-%d' % (sys.version_info.major, sys.version_info.minor, size_int_t) >>> >>> self.setMinimumSize( QSize(350, 100) ) >>> self.setWindowTitle( 'GUI test - python %s' % (py_ver,) ) >>> >>> self.setCentralWidget( QLabel( ' GUI test - python %s ' % (py_ver,), self ) ) >>> >>> def main( argv ): >>> print('QtWidgets.QApplication()', flush=True) >>> app = QtWidgets.QApplication( argv ) >>> >>> print('HelloWindow()', flush=True) >>> main_win = HelloWindow() >>> >>> print('main_win.show()', flush=True) >>> main_win.show() >>> >>> print('app.exec_()', flush=True) >>> rc = app.exec_() >>> >>> print('rc', rc, flush=True) >>> return rc >>> >>> if __name__ == "__main__": >>> sys.exit( main( sys.argv ) ) >>> ---- >>> >>> On a successful run the log shows: >>> >>> ---- gui_test.py ---- >>> QtWidgets.QApplication() >>> HelloWindow() >>> main_win.show() >>> app.exec_() >>> rc 0 >>> >>> When it fails it shows: >>> >>> ---- gui_test.py ---- >>> QtWidgets.QApplication() >>> >>> Here is the problem report that is generated: >>> >>> REGION TYPE SIZE COUNT (non-coalesced) >>> =========== ======= ======= >>> Activity Tracing 256K 1 >>> Kernel Alloc Once 8K 1 >>> MALLOC 192.1M 30 >>> MALLOC guard page 16K 4 >>> MALLOC_LARGE (reserved) 128K 1 reserved VM address space (unallocated) >>> MALLOC_NANO (reserved) 384.0M 1 reserved VM address space (unallocated) >>> STACK GUARD 56.0M 3 >>> Stack 9232K 3 >>> VM_ALLOCATE 6156K 9 >>> __DATA 17.4M 265 >>> __DATA_CONST 10.9M 152 >>> __DATA_DIRTY 492K 86 >>> __FONT_DATA 4K 1 >>> __LINKEDIT 651.4M 26 >>> __OBJC_RO 81.8M 1 >>> __OBJC_RW 3136K 2 >>> __TEXT 205.4M 280 >>> __UNICODE 588K 1 >>> dyld private memory 1024K 1 >>> mapped file 28.3M 2 >>> shared memory 592K 7 >>> =========== ======= ======= >>> TOTAL 1.6G 877 >>> TOTAL, minus reserved VM space 1.2G 877 >>> >>> >>> >>> ----------- >>> Full Report >>> ----------- >>> >>> {"app_name":"gui_test","timestamp":"2021-12-21 11:43:08.00 +0000","app_version":"1.2.3","slice_uuid":"abecb05c-e91d-336e-81d6-4a467d071ee8","build_version":"1.2.3","platform":1,"bundleID":"gui_test","share_with_app_devs":0,"is_first_party":0,"bug_type":"309","os_version":"macOS 12.1 (21C52)","incident_id":"6A9D2853-2DEE-4C33-B374-1017075B2772","name":"gui_test"} >>> { >>> "uptime" : 110000, >>> "procLaunch" : "2021-12-21 11:43:08.5661 +0000", >>> "procRole" : "Background", >>> "version" : 2, >>> "userID" : 501, >>> "deployVersion" : 210, >>> "modelCode" : "MacBookPro13,3", >>> "procStartAbsTime" : 113541505574837, >>> "coalitionID" : 515116, >>> "osVersion" : { >>> "train" : "macOS 12.1", >>> "build" : "21C52", >>> "releaseType" : "User" >>> }, >>> "captureTime" : "2021-12-21 11:43:08.7600 +0000", >>> "incident" : "6A9D2853-2DEE-4C33-B374-1017075B2772", >>> "bug_type" : "309", >>> "pid" : 17474, >>> "procExitAbsTime" : 113541698791884, >>> "cpuType" : "X86-64", >>> "procName" : "gui_test", >>> "procPath" : "\/Users\/USER\/*\/gui_test.app\/Contents\/MacOS\/gui_test", >>> "bundleInfo" : {"CFBundleShortVersionString":"1.2.3","CFBundleVersion":"1.2.3","CFBundleIdentifier":"gui_test"}, >>> "storeInfo" : {"deviceIdentifierForVendor":"58974244-6450-5437-A094-9481191631E1","thirdParty":true}, >>> "parentProc" : "launchd", >>> "parentPid" : 1, >>> "coalitionName" : "gui_test", >>> "crashReporterKey" : "0947E507-B37B-E5B7-D29C-312263801DC3", >>> "wakeTime" : 4348, >>> "bridgeVersion" : {"build":"14Y908","train":"3.0"}, >>> "sleepWakeUUID" : "BEA2B543-B8F3-412A-9B1A-07DB3F35A685", >>> "sip" : "enabled", >>> "isCorpse" : 1, >>> "exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGABRT"}, >>> "asi" : {"libsystem_c.dylib":["abort() called"]}, >>> "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0}, >>> "faultingThread" : 0, >>> "threads" : [{"triggered":true,"id":2520143,"threadState":{"r13":{"value":4432803416,"symbolLocation":0,"symbol":"QListData::shared_null"},"rax":{"value":0},"rflags":{"value":582},"cpu":{"value":0},"r14":{"value":6},"rsi":{"value":6},"r8":{"value":140704637244760,"symbolLocation":456,"symbol":"__sFX"},"cr2":{"value":4372226054},"rdx":{"value":0},"r10":{"value":0},"r9":{"value":0},"r15":{"value":22},"rbx":{"value":4570531328,"symbolLocation":0,"symbol":"_main_thread"},"trap":{"value":133},"err":{"value":33554760},"r11":{"value":582},"rip":{"value":140703537946898,"matchesCrashFrame":1},"rbp":{"value":140701977840384},"rsp":{"value":140701977840344},"r12":{"value":259},"rcx":{"value":140701977840344},"flavor":"x86_THREAD_STATE","rdi":{"value":259}},"queue":"com.apple.main-thread","frames":[{"imageOffset":28946,"symbol":"__pthread_kill","symbolLocation":10,"imageIndex":0},{"imageOffset":25108,"symbol":"pthread_kill","symbolLocation":263,"imageIndex":1},{"imageOffset":531728,"! >>> symbol":" >>> abort","symbolLocation":123,"imageIndex":2},{"imageOffset":99625,"symbol":"qt_message_fatal(QtMsgType, QMessageLogContext const&, QString const&)","symbolLocation":9,"imageIndex":3},{"imageOffset":105588,"symbol":"QMessageLogger::fatal(char const*, ...) const","symbolLocation":202,"imageIndex":3},{"imageOffset":230361,"symbol":"QGuiApplicationPrivate::createPlatformIntegration()","symbolLocation":7193,"imageIndex":4},{"imageOffset":230395,"symbol":"QGuiApplicationPrivate::createEventDispatcher()","symbolLocation":27,"imageIndex":4},{"imageOffset":2064815,"symbol":"QCoreApplicationPrivate::init()","symbolLocation":1599,"imageIndex":3},{"imageOffset":207705,"symbol":"QGuiApplicationPrivate::init()","symbolLocation":57,"imageIndex":4},{"imageOffset":43738,"symbol":"QApplicationPrivate::init()","symbolLocation":26,"imageIndex":5},{"imageOffset":1357272,"symbol":"init_type_QApplication(_sipSimpleWrapper*, _object*, _object*, _object**, _object**, _object**)","symbolLocation":168! >>> ,"imageIn >>> dex":6},{"imageOffset":26459,"symbol":"sipSimpleWrapper_init","symbolLocation":203,"imageIndex":7},{"imageOffset":1121781,"symbol":"type_call","symbolLocation":325,"imageIndex":8},{"imageOffset":552935,"symbol":"_PyObject_MakeTpCall","symbolLocation":135,"imageIndex":8},{"imageOffset":1868333,"symbol":"call_function","symbolLocation":365,"imageIndex":8},{"imageOffset":1833294,"symbol":"_PyEval_EvalFrameDefault","symbolLocation":28702,"imageIndex":8},{"imageOffset":1798114,"symbol":"_PyEval_Vector","symbolLocation":402,"imageIndex":8},{"imageOffset":1868143,"symbol":"call_function","symbolLocation":175,"imageIndex":8},{"imageOffset":1824309,"symbol":"_PyEval_EvalFrameDefault","symbolLocation":19717,"imageIndex":8},{"imageOffset":1798114,"symbol":"_PyEval_Vector","symbolLocation":402,"imageIndex":8},{"imageOffset":1774299,"symbol":"builtin_exec","symbolLocation":331,"imageIndex":8},{"imageOffset":973990,"symbol":"cfunction_vectorcall_FASTCALL","symbolLocation":86,"imageIndex"! >>> :8},{"ima >>> geOffset":1868143,"symbol":"call_function","symbolLocation":175,"imageIndex":8},{"imageOffset":1824309,"symbol":"_PyEval_EvalFrameDefault","symbolLocation":19717,"imageIndex":8},{"imageOffset":1798114,"symbol":"_PyEval_Vector","symbolLocation":402,"imageIndex":8},{"imageOffset":1868143,"symbol":"call_function","symbolLocation":175,"imageIndex":8},{"imageOffset":1824309,"symbol":"_PyEval_EvalFrameDefault","symbolLocation":19717,"imageIndex":8},{"imageOffset":1798114,"symbol":"_PyEval_Vector","symbolLocation":402,"imageIndex":8},{"imageOffset":2278253,"symbol":"pyrun_file","symbolLocation":333,"imageIndex":8},{"imageOffset":2276141,"symbol":"_PyRun_SimpleFileObject","symbolLocation":365,"imageIndex":8},{"imageOffset":2291149,"symbol":"PyRun_SimpleFileExFlags","symbolLocation":109,"imageIndex":8},{"imageOffset":20165,"symbol":"py2app_main","symbolLocation":5481,"imageIndex":9},{"imageOffset":13143,"symbol":"main","symbolLocation":257,"imageIndex":9},{"imageOffset":21758,"symbo! >>> l":"start >>> ","symbolLocation":462,"imageIndex":10}]},{"id":2520154,"frames":[{"imageOffset":8172,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":1}]},{"id":2520155,"frames":[{"imageOffset":8172,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":1}]}], >>> "usedImages" : [ >>> { >>> "source" : "P", >>> "arch" : "x86_64", >>> "base" : 140703537917952, >>> "size" : 225280, >>> "uuid" : "5aa1e5be-b5b8-3a02-9885-a8c99e0ca378", >>> "path" : "\/usr\/lib\/system\/libsystem_kernel.dylib", >>> "name" : "libsystem_kernel.dylib" >>> }, >>> { >>> "source" : "P", >>> "arch" : "x86_64", >>> "base" : 140703538143232, >>> "size" : 49152, >>> "uuid" : "6c7561b4-4b92-3f45-921e-abe669299844", >>> "path" : "\/usr\/lib\/system\/libsystem_pthread.dylib", >>> "name" : "libsystem_pthread.dylib" >>> }, >>> { >>> "source" : "P", >>> "arch" : "x86_64", >>> "base" : 140703536902144, >>> "size" : 561152, >>> "uuid" : "e58814cc-dcb7-35a5-badc-e367ed3ac207", >>> "path" : "\/usr\/lib\/system\/libsystem_c.dylib", >>> "name" : "libsystem_c.dylib" >>> }, >>> { >>> "source" : "P", >>> "arch" : "x86_64", >>> "base" : 4427026432, >>> "size" : 5705728, >>> "uuid" : "c723812a-f7a5-3001-98d5-e60e8daa6ffb", >>> "path" : "\/Users\/USER\/*\/gui_test.app\/Contents\/Resources\/lib\/python3.10\/PyQt5\/Qt5\/lib\/QtCore.framework\/Versions\/5\/QtCore", >>> "name" : "QtCore" >>> }, >>> { >>> "source" : "P", >>> "arch" : "x86_64", >>> "base" : 4446490624, >>> "size" : 5152768, >>> "uuid" : "cbcec35a-ee54-354f-9c2b-188ac6b2790d", >>> "path" : "\/Users\/USER\/*\/gui_test.app\/Contents\/Resources\/lib\/python3.10\/PyQt5\/Qt5\/lib\/QtGui.framework\/Versions\/5\/QtGui", >>> "name" : "QtGui" >>> }, >>> { >>> "source" : "P", >>> "arch" : "x86_64", >>> "base" : 4439920640, >>> "size" : 4485120, >>> "uuid" : "b432d666-dcab-320a-8496-78a67f554c0e", >>> "path" : "\/Users\/USER\/*\/gui_test.app\/Contents\/Resources\/lib\/python3.10\/PyQt5\/Qt5\/lib\/QtWidgets.framework\/Versions\/5\/QtWidgets", >>> "name" : "QtWidgets" >>> }, >>> { >>> "source" : "P", >>> "arch" : "x86_64", >>> "base" : 4434120704, >>> "size" : 2932736, >>> "uuid" : "47b40141-df86-3d2f-98d5-ee16cb313cd6", >>> "path" : "\/Users\/USER\/*\/gui_test.app\/Contents\/Resources\/lib\/python3.10\/PyQt5\/QtWidgets.abi3.so", >>> "name" : "QtWidgets.abi3.so" >>> }, >>> { >>> "source" : "P", >>> "arch" : "x86_64", >>> "base" : 4408209408, >>> "size" : 98304, >>> "uuid" : "62f78d75-6251-3b27-a4b3-a3247d07abe8", >>> "path" : "\/Users\/USER\/*\/gui_test.app\/Contents\/Resources\/lib\/python3.10\/PyQt5\/sip.cpython-310-darwin.so", >>> "name" : "sip.cpython-310-darwin.so" >>> }, >>> { >>> "source" : "P", >>> "arch" : "x86_64", >>> "base" : 4411924480, >>> "CFBundleShortVersionString" : "3.10.1, (c) 2001-2021 Python Software Foundation.", >>> "CFBundleIdentifier" : "org.python.python", >>> "size" : 3637248, >>> "uuid" : "1071a8dd-3e3d-3958-95bf-ba33f1f82be5", >>> "path" : "\/Users\/USER\/*\/gui_test.app\/Contents\/Frameworks\/Python.framework\/Versions\/3.10\/Python", >>> "name" : "Python", >>> "CFBundleVersion" : "3.10.1" >>> }, >>> { >>> "source" : "P", >>> "arch" : "x86_64", >>> "base" : 4370935808, >>> "CFBundleShortVersionString" : "1.2.3", >>> "CFBundleIdentifier" : "gui_test", >>> "size" : 32768, >>> "uuid" : "abecb05c-e91d-336e-81d6-4a467d071ee8", >>> "path" : "\/Users\/USER\/*\/gui_test.app\/Contents\/MacOS\/gui_test", >>> "name" : "gui_test", >>> "CFBundleVersion" : "1.2.3" >>> }, >>> { >>> "source" : "P", >>> "arch" : "x86_64", >>> "base" : 4570005504, >>> "size" : 442368, >>> "uuid" : "cef5a27a-d50b-3020-af03-1734b19bc8c5", >>> "path" : "\/usr\/lib\/dyld", >>> "name" : "dyld" >>> } >>> ], >>> "sharedCache" : { >>> "base" : 140703534915584, >>> "size" : 15216738304, >>> "uuid" : "40432a03-88d3-305f-9c0c-e7549e71d927" >>> }, >>> "vmSummary" : "ReadOnly portion of Libraries: Total=856.8M resident=0K(0%) swapped_out_or_unallocated=856.8M(100%)\nWritable regions: Total=591.6M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=591.6M(100%)\n\n VIRTUAL REGION \nREGION TYPE SIZE COUNT (non-coalesced) \n=========== ======= ======= \nActivity Tracing 256K 1 \nKernel Alloc Once 8K 1 \nMALLOC 192.1M 30 \nMALLOC guard page 16K 4 \nMALLOC_LARGE (reserved) 128K 1 reserved VM address space (unallocated)\nMALLOC_NANO (reserved) 384.0M 1 reserved VM address space (unallocated)\nSTACK GUARD 56.0M 3 \nStack 9232K 3 \nVM_ALLOCATE 6156K 9 \n__DATA 17.4M ! >>> 265 >>> \n__DATA_CONST 10.9M 152 \n__DATA_DIRTY 492K 86 \n__FONT_DATA 4K 1 \n__LINKEDIT 651.4M 26 \n__OBJC_RO 81.8M 1 \n__OBJC_RW 3136K 2 \n__TEXT 205.4M 280 \n__UNICODE 588K 1 \ndyld private memory 1024K 1 \nmapped file 28.3M 2 \nshared memory 592K 7 \n=========== ======= ======= \nTOTAL 1.6G 877 \nTOTAL, minus reserved VM space 1.2G 877 \n", >>> "legacyInfo" : { >>> "threadTriggered" : { >>> "queue" : "com.apple.main-thread" >>> } >>> }, >>> "trialInfo" : { >>> "rollouts" : [ >>> { >>> "rolloutId" : "5ffde50ce2aacd000d47a95f", >>> "factorPackIds" : { >>> >>> }, >>> "deploymentId" : 240000090 >>> }, >>> { >>> "rolloutId" : "5fc94383418129005b4e9ae0", >>> "factorPackIds" : { >>> >>> }, >>> "deploymentId" : 240000185 >>> }, >>> { >>> "rolloutId" : "602ad4dac86151000cf27e46", >>> "factorPackIds" : { >>> "SIRI_DICTATION_ASSETS" : "6193d03f2171a2330e561dfc" >>> }, >>> "deploymentId" : 240000290 >>> }, >>> { >>> "rolloutId" : "60da5e84ab0ca017dace9abf", >>> "factorPackIds" : { >>> >>> }, >>> "deploymentId" : 240000008 >>> }, >>> { >>> "rolloutId" : "607844aa04477260f58a8077", >>> "factorPackIds" : { >>> "SIRI_MORPHUN_ASSETS" : "6103050cbfe6dc472e1c982a" >>> }, >>> "deploymentId" : 240000066 >>> }, >>> { >>> "rolloutId" : "601d9415f79519000ccd4b69", >>> "factorPackIds" : { >>> "SIRI_TEXT_TO_SPEECH" : "6194416f2171a2330e561f05" >>> }, >>> "deploymentId" : 240000355 >>> } >>> ], >>> "experiments" : [ >>> >>> ] >>> } >>> } >>> >>> Model: MacBookPro13,3, BootROM 447.60.3.0.0, 4 processors, Quad-Core Intel Core i7, 2.6 GHz, 16 GB, SMC 2.38f12 >>> Graphics: Intel HD Graphics 530, Intel HD Graphics 530, Built-In >>> Graphics: Radeon Pro 450, AMD Radeon Pro 450, PCIe, 2 GB >>> Display: DELL 2408WFP, 1920 x 1200 (WUXGA - Widescreen Ultra eXtended Graphics Array), Main, MirrorOff, Online >>> Memory Module: BANK 0/DIMM0, 8 GB, LPDDR3, 2133 MHz, 0x802C, 0x4D5435324C31473332443450472D30393320 >>> Memory Module: BANK 1/DIMM0, 8 GB, LPDDR3, 2133 MHz, 0x802C, 0x4D5435324C31473332443450472D30393320 >>> AirPort: spairport_wireless_card_type_wifi (0x14E4, 0x15A), Broadcom BCM43xx 1.0 (7.77.111.1 AirPortDriverBrcmNIC-1710.3) >>> Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports >>> Network Service: USB 10/100/1000 LAN, Ethernet, en7 >>> USB Device: Anker USB-C Hub Device >>> USB Device: USB3.0 Card Reader >>> USB Device: USB 10/100/1000 LAN >>> USB Device: USB30Bus >>> USB Device: Anker USB-C Hub Device >>> USB Device: hub_device >>> USB Device: USB Keyboard >>> USB Device: hub_device >>> USB Device: Microsoft USB Optical Mouse >>> USB Device: Flash Card Reader >>> USB Device: Anker >>> USB Device: Apple T1 Controller >>> Thunderbolt Bus: MacBook Pro, Apple Inc., 41.5 >>> Thunderbolt Bus: MacBook Pro, Apple Inc., 41.5 >>> >>> >>> Barry >>> >>> _______________________________________________ >>> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >>> https://mail.python.org/mailman/listinfo/pythonmac-sig >>> unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From barry at barrys-emacs.org Sun Jan 2 16:23:43 2022 From: barry at barrys-emacs.org (Barry Scott) Date: Sun, 2 Jan 2022 21:23:43 +0000 Subject: [Pythonmac-SIG] py2app fails to build PyQt5 apps anymore In-Reply-To: <3EA7B79E-DC99-493D-9B56-2D71785C97F8@barrys-emacs.org> References: <49073365-7124-4D85-BC75-987333561419@barrys-emacs.org> <9766E8B1-45CF-4817-A0FB-DAF40D9FB08B@cwi.nl> <3EA7B79E-DC99-493D-9B56-2D71785C97F8@barrys-emacs.org> Message-ID: > On 2 Jan 2022, at 13:02, Barry Scott wrote: > > > >> On 22 Dec 2021, at 23:36, jack.jansen at cwi.nl wrote: >> >> Hmm, my guess is that it fails when it fails when Qt tries to access the window manager (the `QtWidgets.QApplication( argv )` call). But why it would fail when built with pyinstaller and not with py2app I have absolutely no clue? >> >> Could it be that a new entitlement or something was added by Apple for Monterey, maybe for accessing the window manager, and py2app doesn?t know about this? Anyone (Ronald, probably) have any idea? > > I have been trying to check the entitlements that each version of the App has > on the assumption that I could add any missing ones to the y2app version and > see if that is indeed the issue. > > But the Apple suggested command: > > $ codesign --display --entitlements tmp.pyinstaller/dist/gui_test.app > Usage: codesign -s identity [-fv*] [-o flags] [-r reqs] [-i ident] path ... # sign > codesign -v [-v*] [-R=|-R ] path|[+]pid ... # verify > codesign -d [options] path ... # display contents > codesign -h pid ... # display hosting paths > > As you see just prints its usage. man codesign is no more helpful. > > Do you know what the for the --entitlements option is should be? It turns out there is a required "-" needed. $ codesign --display --entitlements - tmp.pyinstaller/dist/gui_test.app There are no entitlements on either py2app or pyinstaller .app bundles. Barry > > There is talk of a entitlemts.plist but I do seem to have that file at all. > > Barry > > >> >> -- >> Jack Jansen, >, http://www.cwi.nl/~jack >> If I can't dance I don't want to be part of your revolution -- Emma Goldman >> >> >> >>> On 21 Dec 2021, at 12:46, Barry Scott > wrote: >>> >>> For a long time I have been happily building my App bundles using py2app. >>> At some point that stopped working. I do not have a record of exactly >>> when. Last time I saw everything work was Feb 2021. >>> >>> I have reduced the problem to a simple test program and scripts to >>> build and run the test code to show the issue. >>> >>> As a comparison I have py2app and pyinstaller versions of the tests. >>> The pyinstaller version works and the py2app version fails. >>> >>> The code is on github here: >>> >>> https://github.com/barry-scott/scm-workbench/tree/master/Source/Experiments >>> >>> Run ./build-py2app.sh to build and run the py2app version. >>> Run ./build-pyinstaller.sh to build and runt he pyinstaller version. >>> >>> The scripts: >>> 1. build a venv >>> 2. run gui_test.py from the command line >>> 3. build the app using py2app or pyinstaller >>> 4. run the app. >>> >>> I am using macOS 12.1 on Intel MacBook Pro (15-inch, 2016). >>> Python 3.10.1 from python.org . >>> >>> The gui_test.py code logs to ~/gui_test.log at key points. >>> >>> Here is the source: >>> >>> ---- >>> #!/usr/bin/env python >>> import sys >>> import os >>> >>> log_filename = '%s/gui_test.log' % (os.environ['HOME'],) >>> sys.stdout = open( log_filename, 'a' ) >>> sys.stderr = sys.stdout >>> print('---- gui_test.py ----', flush=True) >>> >>> from PyQt5 import QtCore, QtWidgets >>> from PyQt5.QtWidgets import QMainWindow, QLabel, QGridLayout, QWidget >>> from PyQt5.QtCore import QSize >>> >>> class HelloWindow(QMainWindow): >>> def __init__( self ): >>> super().__init__() >>> >>> if sys.maxsize > (2**31): >>> size_int_t = 64 >>> else: >>> size_int_t = 32 >>> >>> py_ver = '%d.%d-%d' % (sys.version_info.major, sys.version_info.minor, size_int_t) >>> >>> self.setMinimumSize( QSize(350, 100) ) >>> self.setWindowTitle( 'GUI test - python %s' % (py_ver,) ) >>> >>> self.setCentralWidget( QLabel( ' GUI test - python %s ' % (py_ver,), self ) ) >>> >>> def main( argv ): >>> print('QtWidgets.QApplication()', flush=True) >>> app = QtWidgets.QApplication( argv ) >>> >>> print('HelloWindow()', flush=True) >>> main_win = HelloWindow() >>> >>> print('main_win.show()', flush=True) >>> main_win.show() >>> >>> print('app.exec_()', flush=True) >>> rc = app.exec_() >>> >>> print('rc', rc, flush=True) >>> return rc >>> >>> if __name__ == "__main__": >>> sys.exit( main( sys.argv ) ) >>> ---- >>> >>> On a successful run the log shows: >>> >>> ---- gui_test.py ---- >>> QtWidgets.QApplication() >>> HelloWindow() >>> main_win.show() >>> app.exec_() >>> rc 0 >>> >>> When it fails it shows: >>> >>> ---- gui_test.py ---- >>> QtWidgets.QApplication() >>> >>> Here is the problem report that is generated: >>> >>> REGION TYPE SIZE COUNT (non-coalesced) >>> =========== ======= ======= >>> Activity Tracing 256K 1 >>> Kernel Alloc Once 8K 1 >>> MALLOC 192.1M 30 >>> MALLOC guard page 16K 4 >>> MALLOC_LARGE (reserved) 128K 1 reserved VM address space (unallocated) >>> MALLOC_NANO (reserved) 384.0M 1 reserved VM address space (unallocated) >>> STACK GUARD 56.0M 3 >>> Stack 9232K 3 >>> VM_ALLOCATE 6156K 9 >>> __DATA 17.4M 265 >>> __DATA_CONST 10.9M 152 >>> __DATA_DIRTY 492K 86 >>> __FONT_DATA 4K 1 >>> __LINKEDIT 651.4M 26 >>> __OBJC_RO 81.8M 1 >>> __OBJC_RW 3136K 2 >>> __TEXT 205.4M 280 >>> __UNICODE 588K 1 >>> dyld private memory 1024K 1 >>> mapped file 28.3M 2 >>> shared memory 592K 7 >>> =========== ======= ======= >>> TOTAL 1.6G 877 >>> TOTAL, minus reserved VM space 1.2G 877 >>> >>> >>> >>> ----------- >>> Full Report >>> ----------- >>> >>> {"app_name":"gui_test","timestamp":"2021-12-21 11:43:08.00 +0000","app_version":"1.2.3","slice_uuid":"abecb05c-e91d-336e-81d6-4a467d071ee8","build_version":"1.2.3","platform":1,"bundleID":"gui_test","share_with_app_devs":0,"is_first_party":0,"bug_type":"309","os_version":"macOS 12.1 (21C52)","incident_id":"6A9D2853-2DEE-4C33-B374-1017075B2772","name":"gui_test"} >>> { >>> "uptime" : 110000, >>> "procLaunch" : "2021-12-21 11:43:08.5661 +0000", >>> "procRole" : "Background", >>> "version" : 2, >>> "userID" : 501, >>> "deployVersion" : 210, >>> "modelCode" : "MacBookPro13,3", >>> "procStartAbsTime" : 113541505574837, >>> "coalitionID" : 515116, >>> "osVersion" : { >>> "train" : "macOS 12.1", >>> "build" : "21C52", >>> "releaseType" : "User" >>> }, >>> "captureTime" : "2021-12-21 11:43:08.7600 +0000", >>> "incident" : "6A9D2853-2DEE-4C33-B374-1017075B2772", >>> "bug_type" : "309", >>> "pid" : 17474, >>> "procExitAbsTime" : 113541698791884, >>> "cpuType" : "X86-64", >>> "procName" : "gui_test", >>> "procPath" : "\/Users\/USER\/*\/gui_test.app\/Contents\/MacOS\/gui_test", >>> "bundleInfo" : {"CFBundleShortVersionString":"1.2.3","CFBundleVersion":"1.2.3","CFBundleIdentifier":"gui_test"}, >>> "storeInfo" : {"deviceIdentifierForVendor":"58974244-6450-5437-A094-9481191631E1","thirdParty":true}, >>> "parentProc" : "launchd", >>> "parentPid" : 1, >>> "coalitionName" : "gui_test", >>> "crashReporterKey" : "0947E507-B37B-E5B7-D29C-312263801DC3", >>> "wakeTime" : 4348, >>> "bridgeVersion" : {"build":"14Y908","train":"3.0"}, >>> "sleepWakeUUID" : "BEA2B543-B8F3-412A-9B1A-07DB3F35A685", >>> "sip" : "enabled", >>> "isCorpse" : 1, >>> "exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGABRT"}, >>> "asi" : {"libsystem_c.dylib":["abort() called"]}, >>> "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0}, >>> "faultingThread" : 0, >>> "threads" : [{"triggered":true,"id":2520143,"threadState":{"r13":{"value":4432803416,"symbolLocation":0,"symbol":"QListData::shared_null"},"rax":{"value":0},"rflags":{"value":582},"cpu":{"value":0},"r14":{"value":6},"rsi":{"value":6},"r8":{"value":140704637244760,"symbolLocation":456,"symbol":"__sFX"},"cr2":{"value":4372226054},"rdx":{"value":0},"r10":{"value":0},"r9":{"value":0},"r15":{"value":22},"rbx":{"value":4570531328,"symbolLocation":0,"symbol":"_main_thread"},"trap":{"value":133},"err":{"value":33554760},"r11":{"value":582},"rip":{"value":140703537946898,"matchesCrashFrame":1},"rbp":{"value":140701977840384},"rsp":{"value":140701977840344},"r12":{"value":259},"rcx":{"value":140701977840344},"flavor":"x86_THREAD_STATE","rdi":{"value":259}},"queue":"com.apple.main-thread","frames":[{"imageOffset":28946,"symbol":"__pthread_kill","symbolLocation":10,"imageIndex":0},{"imageOffset":25108,"symbol":"pthread_kill","symbolLocation":263,"imageIndex":1},{"imageOffset":531728,"! >>> symbol":" >>> abort","symbolLocation":123,"imageIndex":2},{"imageOffset":99625,"symbol":"qt_message_fatal(QtMsgType, QMessageLogContext const&, QString const&)","symbolLocation":9,"imageIndex":3},{"imageOffset":105588,"symbol":"QMessageLogger::fatal(char const*, ...) const","symbolLocation":202,"imageIndex":3},{"imageOffset":230361,"symbol":"QGuiApplicationPrivate::createPlatformIntegration()","symbolLocation":7193,"imageIndex":4},{"imageOffset":230395,"symbol":"QGuiApplicationPrivate::createEventDispatcher()","symbolLocation":27,"imageIndex":4},{"imageOffset":2064815,"symbol":"QCoreApplicationPrivate::init()","symbolLocation":1599,"imageIndex":3},{"imageOffset":207705,"symbol":"QGuiApplicationPrivate::init()","symbolLocation":57,"imageIndex":4},{"imageOffset":43738,"symbol":"QApplicationPrivate::init()","symbolLocation":26,"imageIndex":5},{"imageOffset":1357272,"symbol":"init_type_QApplication(_sipSimpleWrapper*, _object*, _object*, _object**, _object**, _object**)","symbolLocation":168! >>> ,"imageIn >>> dex":6},{"imageOffset":26459,"symbol":"sipSimpleWrapper_init","symbolLocation":203,"imageIndex":7},{"imageOffset":1121781,"symbol":"type_call","symbolLocation":325,"imageIndex":8},{"imageOffset":552935,"symbol":"_PyObject_MakeTpCall","symbolLocation":135,"imageIndex":8},{"imageOffset":1868333,"symbol":"call_function","symbolLocation":365,"imageIndex":8},{"imageOffset":1833294,"symbol":"_PyEval_EvalFrameDefault","symbolLocation":28702,"imageIndex":8},{"imageOffset":1798114,"symbol":"_PyEval_Vector","symbolLocation":402,"imageIndex":8},{"imageOffset":1868143,"symbol":"call_function","symbolLocation":175,"imageIndex":8},{"imageOffset":1824309,"symbol":"_PyEval_EvalFrameDefault","symbolLocation":19717,"imageIndex":8},{"imageOffset":1798114,"symbol":"_PyEval_Vector","symbolLocation":402,"imageIndex":8},{"imageOffset":1774299,"symbol":"builtin_exec","symbolLocation":331,"imageIndex":8},{"imageOffset":973990,"symbol":"cfunction_vectorcall_FASTCALL","symbolLocation":86,"imageIndex"! >>> :8},{"ima >>> geOffset":1868143,"symbol":"call_function","symbolLocation":175,"imageIndex":8},{"imageOffset":1824309,"symbol":"_PyEval_EvalFrameDefault","symbolLocation":19717,"imageIndex":8},{"imageOffset":1798114,"symbol":"_PyEval_Vector","symbolLocation":402,"imageIndex":8},{"imageOffset":1868143,"symbol":"call_function","symbolLocation":175,"imageIndex":8},{"imageOffset":1824309,"symbol":"_PyEval_EvalFrameDefault","symbolLocation":19717,"imageIndex":8},{"imageOffset":1798114,"symbol":"_PyEval_Vector","symbolLocation":402,"imageIndex":8},{"imageOffset":2278253,"symbol":"pyrun_file","symbolLocation":333,"imageIndex":8},{"imageOffset":2276141,"symbol":"_PyRun_SimpleFileObject","symbolLocation":365,"imageIndex":8},{"imageOffset":2291149,"symbol":"PyRun_SimpleFileExFlags","symbolLocation":109,"imageIndex":8},{"imageOffset":20165,"symbol":"py2app_main","symbolLocation":5481,"imageIndex":9},{"imageOffset":13143,"symbol":"main","symbolLocation":257,"imageIndex":9},{"imageOffset":21758,"symbo! >>> l":"start >>> ","symbolLocation":462,"imageIndex":10}]},{"id":2520154,"frames":[{"imageOffset":8172,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":1}]},{"id":2520155,"frames":[{"imageOffset":8172,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":1}]}], >>> "usedImages" : [ >>> { >>> "source" : "P", >>> "arch" : "x86_64", >>> "base" : 140703537917952, >>> "size" : 225280, >>> "uuid" : "5aa1e5be-b5b8-3a02-9885-a8c99e0ca378", >>> "path" : "\/usr\/lib\/system\/libsystem_kernel.dylib", >>> "name" : "libsystem_kernel.dylib" >>> }, >>> { >>> "source" : "P", >>> "arch" : "x86_64", >>> "base" : 140703538143232, >>> "size" : 49152, >>> "uuid" : "6c7561b4-4b92-3f45-921e-abe669299844", >>> "path" : "\/usr\/lib\/system\/libsystem_pthread.dylib", >>> "name" : "libsystem_pthread.dylib" >>> }, >>> { >>> "source" : "P", >>> "arch" : "x86_64", >>> "base" : 140703536902144, >>> "size" : 561152, >>> "uuid" : "e58814cc-dcb7-35a5-badc-e367ed3ac207", >>> "path" : "\/usr\/lib\/system\/libsystem_c.dylib", >>> "name" : "libsystem_c.dylib" >>> }, >>> { >>> "source" : "P", >>> "arch" : "x86_64", >>> "base" : 4427026432, >>> "size" : 5705728, >>> "uuid" : "c723812a-f7a5-3001-98d5-e60e8daa6ffb", >>> "path" : "\/Users\/USER\/*\/gui_test.app\/Contents\/Resources\/lib\/python3.10\/PyQt5\/Qt5\/lib\/QtCore.framework\/Versions\/5\/QtCore", >>> "name" : "QtCore" >>> }, >>> { >>> "source" : "P", >>> "arch" : "x86_64", >>> "base" : 4446490624, >>> "size" : 5152768, >>> "uuid" : "cbcec35a-ee54-354f-9c2b-188ac6b2790d", >>> "path" : "\/Users\/USER\/*\/gui_test.app\/Contents\/Resources\/lib\/python3.10\/PyQt5\/Qt5\/lib\/QtGui.framework\/Versions\/5\/QtGui", >>> "name" : "QtGui" >>> }, >>> { >>> "source" : "P", >>> "arch" : "x86_64", >>> "base" : 4439920640, >>> "size" : 4485120, >>> "uuid" : "b432d666-dcab-320a-8496-78a67f554c0e", >>> "path" : "\/Users\/USER\/*\/gui_test.app\/Contents\/Resources\/lib\/python3.10\/PyQt5\/Qt5\/lib\/QtWidgets.framework\/Versions\/5\/QtWidgets", >>> "name" : "QtWidgets" >>> }, >>> { >>> "source" : "P", >>> "arch" : "x86_64", >>> "base" : 4434120704, >>> "size" : 2932736, >>> "uuid" : "47b40141-df86-3d2f-98d5-ee16cb313cd6", >>> "path" : "\/Users\/USER\/*\/gui_test.app\/Contents\/Resources\/lib\/python3.10\/PyQt5\/QtWidgets.abi3.so", >>> "name" : "QtWidgets.abi3.so" >>> }, >>> { >>> "source" : "P", >>> "arch" : "x86_64", >>> "base" : 4408209408, >>> "size" : 98304, >>> "uuid" : "62f78d75-6251-3b27-a4b3-a3247d07abe8", >>> "path" : "\/Users\/USER\/*\/gui_test.app\/Contents\/Resources\/lib\/python3.10\/PyQt5\/sip.cpython-310-darwin.so", >>> "name" : "sip.cpython-310-darwin.so" >>> }, >>> { >>> "source" : "P", >>> "arch" : "x86_64", >>> "base" : 4411924480, >>> "CFBundleShortVersionString" : "3.10.1, (c) 2001-2021 Python Software Foundation.", >>> "CFBundleIdentifier" : "org.python.python", >>> "size" : 3637248, >>> "uuid" : "1071a8dd-3e3d-3958-95bf-ba33f1f82be5", >>> "path" : "\/Users\/USER\/*\/gui_test.app\/Contents\/Frameworks\/Python.framework\/Versions\/3.10\/Python", >>> "name" : "Python", >>> "CFBundleVersion" : "3.10.1" >>> }, >>> { >>> "source" : "P", >>> "arch" : "x86_64", >>> "base" : 4370935808, >>> "CFBundleShortVersionString" : "1.2.3", >>> "CFBundleIdentifier" : "gui_test", >>> "size" : 32768, >>> "uuid" : "abecb05c-e91d-336e-81d6-4a467d071ee8", >>> "path" : "\/Users\/USER\/*\/gui_test.app\/Contents\/MacOS\/gui_test", >>> "name" : "gui_test", >>> "CFBundleVersion" : "1.2.3" >>> }, >>> { >>> "source" : "P", >>> "arch" : "x86_64", >>> "base" : 4570005504, >>> "size" : 442368, >>> "uuid" : "cef5a27a-d50b-3020-af03-1734b19bc8c5", >>> "path" : "\/usr\/lib\/dyld", >>> "name" : "dyld" >>> } >>> ], >>> "sharedCache" : { >>> "base" : 140703534915584, >>> "size" : 15216738304, >>> "uuid" : "40432a03-88d3-305f-9c0c-e7549e71d927" >>> }, >>> "vmSummary" : "ReadOnly portion of Libraries: Total=856.8M resident=0K(0%) swapped_out_or_unallocated=856.8M(100%)\nWritable regions: Total=591.6M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=591.6M(100%)\n\n VIRTUAL REGION \nREGION TYPE SIZE COUNT (non-coalesced) \n=========== ======= ======= \nActivity Tracing 256K 1 \nKernel Alloc Once 8K 1 \nMALLOC 192.1M 30 \nMALLOC guard page 16K 4 \nMALLOC_LARGE (reserved) 128K 1 reserved VM address space (unallocated)\nMALLOC_NANO (reserved) 384.0M 1 reserved VM address space (unallocated)\nSTACK GUARD 56.0M 3 \nStack 9232K 3 \nVM_ALLOCATE 6156K 9 \n__DATA 17.4M ! >>> 265 >>> \n__DATA_CONST 10.9M 152 \n__DATA_DIRTY 492K 86 \n__FONT_DATA 4K 1 \n__LINKEDIT 651.4M 26 \n__OBJC_RO 81.8M 1 \n__OBJC_RW 3136K 2 \n__TEXT 205.4M 280 \n__UNICODE 588K 1 \ndyld private memory 1024K 1 \nmapped file 28.3M 2 \nshared memory 592K 7 \n=========== ======= ======= \nTOTAL 1.6G 877 \nTOTAL, minus reserved VM space 1.2G 877 \n", >>> "legacyInfo" : { >>> "threadTriggered" : { >>> "queue" : "com.apple.main-thread" >>> } >>> }, >>> "trialInfo" : { >>> "rollouts" : [ >>> { >>> "rolloutId" : "5ffde50ce2aacd000d47a95f", >>> "factorPackIds" : { >>> >>> }, >>> "deploymentId" : 240000090 >>> }, >>> { >>> "rolloutId" : "5fc94383418129005b4e9ae0", >>> "factorPackIds" : { >>> >>> }, >>> "deploymentId" : 240000185 >>> }, >>> { >>> "rolloutId" : "602ad4dac86151000cf27e46", >>> "factorPackIds" : { >>> "SIRI_DICTATION_ASSETS" : "6193d03f2171a2330e561dfc" >>> }, >>> "deploymentId" : 240000290 >>> }, >>> { >>> "rolloutId" : "60da5e84ab0ca017dace9abf", >>> "factorPackIds" : { >>> >>> }, >>> "deploymentId" : 240000008 >>> }, >>> { >>> "rolloutId" : "607844aa04477260f58a8077", >>> "factorPackIds" : { >>> "SIRI_MORPHUN_ASSETS" : "6103050cbfe6dc472e1c982a" >>> }, >>> "deploymentId" : 240000066 >>> }, >>> { >>> "rolloutId" : "601d9415f79519000ccd4b69", >>> "factorPackIds" : { >>> "SIRI_TEXT_TO_SPEECH" : "6194416f2171a2330e561f05" >>> }, >>> "deploymentId" : 240000355 >>> } >>> ], >>> "experiments" : [ >>> >>> ] >>> } >>> } >>> >>> Model: MacBookPro13,3, BootROM 447.60.3.0.0, 4 processors, Quad-Core Intel Core i7, 2.6 GHz, 16 GB, SMC 2.38f12 >>> Graphics: Intel HD Graphics 530, Intel HD Graphics 530, Built-In >>> Graphics: Radeon Pro 450, AMD Radeon Pro 450, PCIe, 2 GB >>> Display: DELL 2408WFP, 1920 x 1200 (WUXGA - Widescreen Ultra eXtended Graphics Array), Main, MirrorOff, Online >>> Memory Module: BANK 0/DIMM0, 8 GB, LPDDR3, 2133 MHz, 0x802C, 0x4D5435324C31473332443450472D30393320 >>> Memory Module: BANK 1/DIMM0, 8 GB, LPDDR3, 2133 MHz, 0x802C, 0x4D5435324C31473332443450472D30393320 >>> AirPort: spairport_wireless_card_type_wifi (0x14E4, 0x15A), Broadcom BCM43xx 1.0 (7.77.111.1 AirPortDriverBrcmNIC-1710.3) >>> Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports >>> Network Service: USB 10/100/1000 LAN, Ethernet, en7 >>> USB Device: Anker USB-C Hub Device >>> USB Device: USB3.0 Card Reader >>> USB Device: USB 10/100/1000 LAN >>> USB Device: USB30Bus >>> USB Device: Anker USB-C Hub Device >>> USB Device: hub_device >>> USB Device: USB Keyboard >>> USB Device: hub_device >>> USB Device: Microsoft USB Optical Mouse >>> USB Device: Flash Card Reader >>> USB Device: Anker >>> USB Device: Apple T1 Controller >>> Thunderbolt Bus: MacBook Pro, Apple Inc., 41.5 >>> Thunderbolt Bus: MacBook Pro, Apple Inc., 41.5 >>> >>> >>> Barry >>> >>> _______________________________________________ >>> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >>> https://mail.python.org/mailman/listinfo/pythonmac-sig >>> unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG >> > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > https://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris.barker at noaa.gov Thu Jan 6 13:57:27 2022 From: chris.barker at noaa.gov (Chris Barker) Date: Thu, 6 Jan 2022 10:57:27 -0800 Subject: [Pythonmac-SIG] Error with mimetype on OS-X 11 (Big Sur) In-Reply-To: References: Message-ID: OK, I've gotten a bit farther into debugging this. Turns out it's not about that particular error, it's probably about the fact that modules couldn't be loaded at start up due to security checks in the new OS. We've signed the app but that's not fixing it :-( Starting the app at the command line at least gets me output, and I see a lot of errors like this: File "PyInstaller-3.4-py3.6.egg/PyInstaller/loader/pyiboot01_bootstrap.py", line 149, in __init__ File "ctypes/__init__.py", line 348, in __init__ OSError: dlopen(OpenGL, 10): no suitable image found. Did find: file system relative paths not allowed in hardened programs I am really confused as to how they could disallow relative paths -- how else could you bundle a library? though maybe it's a lib outside the bundle that's using relative paths ? More digging needed, but if anyone has any ideas, I'm all ears. Also: - Has anyone gotten a PyInstaller App to work on OS-X 11 ? - Even better, one that uses OpenGL? Thanks, -CHB On Thu, Dec 16, 2021 at 11:21 AM Chris Barker wrote: > I've just got a new mac with OS-X 11.6 (still Intel). > > But when I try to run a PyInstaller built application, I get this error: > > No document available for {'mime': 'application/x-maproom-project-zip', > 'loader': 0x7f9669ce6e10>, 'uri': 'template://default_project.maproom'} > > And the app won't start. > > This has worked just fine on numerous previous OS-X versions. > > I have the source code, but the developer that built it is no longer with > us, so it'll take b e a bit to get up to speed, and I don't even know where > to start! Is this a PyInstaller issue? or a code issue, or ??? > > Hints: > > The application is called MapRoom (maproom) it works with "projects" that > are essentially a zip file with all the info required in it. > > I think, on startup, it loads a empty default project, presumably > "default_project.maproom" > > So I think that's where the app startup code is barfing, not having the > mime type registered properly. But where / how am I supposed to do that? > > or maybe it's not a mime type registration issue, but simply that the > template can't be found -- so a path issue in the App bundle?? > > Anyway, I'll be digging into this deeper in the source code, but if anyone > has seen anything like this, any hints would be appreciated! > > Thanks, > > -CHB > > > > > > > > > > -- > > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > Chris.Barker at noaa.gov > -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov -------------- next part -------------- An HTML attachment was scrubbed... URL: From jack.jansen at cwi.nl Fri Jan 7 18:39:41 2022 From: jack.jansen at cwi.nl (jack.jansen at cwi.nl) Date: Sat, 8 Jan 2022 00:39:41 +0100 Subject: [Pythonmac-SIG] Error with mimetype on OS-X 11 (Big Sur) In-Reply-To: References: Message-ID: <49E73D3A-8887-4994-B4A7-674967893CE7@cwi.nl> I googled the "file system relative paths not allowed in hardened programs? and the results made me remember a similar issue I have seen recently. I was loading a dylib through ctypes, and suddenly this stopped working. The problem eventually turned out to be that another dylib (a dependency of the dylib I was loading) had its quarantine flag set. That was never a problem before, but suddenly (last summer?) it has started to be a problem. The solution turned out to be to run `xattr -d com.apple.quarantine blablabla.dylib` on the problem library. Not sure whether this is your problem or not, but it?s worth a shot. If (big if) this is a dynamic loader problem you?re in for a hard time: it used to be possible to debug these by setting the various DYLD_ environment variables to ?look over the shoulder? of the dynamic loader to see what it is doing, but nowadays these environment variables are always cleared automatically (unless you have the com.apple.security.cs.allow-dyld-environment-variables entitlement, so if there?s a third party app somewhere in the chain that?s a no-no). -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman > On 6 Jan 2022, at 19:57, Chris Barker via Pythonmac-SIG wrote: > > OK, > > I've gotten a bit farther into debugging this. > > Turns out it's not about that particular error, it's probably about the fact that modules couldn't be loaded at start up due to security checks in the new OS. > > We've signed the app but that's not fixing it :-( > > Starting the app at the command line at least gets me output, and I see a lot of errors like this: > > File "PyInstaller-3.4-py3.6.egg/PyInstaller/loader/pyiboot01_bootstrap.py", line 149, in __init__ > File "ctypes/__init__.py", line 348, in __init__ > OSError: dlopen(OpenGL, 10): no suitable image found. Did find: > file system relative paths not allowed in hardened programs > > I am really confused as to how they could disallow relative paths -- how else could you bundle a library? > > though maybe it's a lib outside the bundle that's using relative paths ? > > More digging needed, but if anyone has any ideas, I'm all ears. > > Also: > > - Has anyone gotten a PyInstaller App to work on OS-X 11 ? > > - Even better, one that uses OpenGL? > > Thanks, > > -CHB > > > > On Thu, Dec 16, 2021 at 11:21 AM Chris Barker wrote: > I've just got a new mac with OS-X 11.6 (still Intel). > > But when I try to run a PyInstaller built application, I get this error: > > No document available for {'mime': 'application/x-maproom-project-zip', 'loader': , 'uri': 'template://default_project.maproom'} > > And the app won't start. > > This has worked just fine on numerous previous OS-X versions. > > I have the source code, but the developer that built it is no longer with us, so it'll take b e a bit to get up to speed, and I don't even know where to start! Is this a PyInstaller issue? or a code issue, or ??? > > Hints: > > The application is called MapRoom (maproom) it works with "projects" that are essentially a zip file with all the info required in it. > > I think, on startup, it loads a empty default project, presumably "default_project.maproom" > > So I think that's where the app startup code is barfing, not having the mime type registered properly. But where / how am I supposed to do that? > > or maybe it's not a mime type registration issue, but simply that the template can't be found -- so a path issue in the App bundle?? > > Anyway, I'll be digging into this deeper in the source code, but if anyone has seen anything like this, any hints would be appreciated! > > Thanks, > > -CHB > > > > > > > > > > -- > > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > Chris.Barker at noaa.gov > > > -- > > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > Chris.Barker at noaa.gov > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > https://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG From pythonchb at gmail.com Fri Jan 7 19:30:38 2022 From: pythonchb at gmail.com (Christopher Barker) Date: Fri, 7 Jan 2022 16:30:38 -0800 Subject: [Pythonmac-SIG] Error with mimetype on OS-X 11 (Big Sur) In-Reply-To: <49E73D3A-8887-4994-B4A7-674967893CE7@cwi.nl> References: <49E73D3A-8887-4994-B4A7-674967893CE7@cwi.nl> Message-ID: Thanks Jack, this sounds like a promising lead. In this case, it seems to be PyOpenGL, ultimately loading a system dynlib. But the broken bit may be within my control. I?ll report back if I figure it out. -CHB On Fri, Jan 7, 2022 at 3:40 PM wrote: > I googled the "file system relative paths not allowed in hardened > programs? and the results made me remember a similar issue I have seen > recently. > > I was loading a dylib through ctypes, and suddenly this stopped working. > The problem eventually turned out to be that another dylib (a dependency of > the dylib I was loading) had its quarantine flag set. That was never a > problem before, but suddenly (last summer?) it has started to be a problem. > > The solution turned out to be to run `xattr -d com.apple.quarantine > blablabla.dylib` on the problem library. > > Not sure whether this is your problem or not, but it?s worth a shot. If > (big if) this is a dynamic loader problem you?re in for a hard time: it > used to be possible to debug these by setting the various DYLD_ environment > variables to ?look over the shoulder? of the dynamic loader to see what it > is doing, but nowadays these environment variables are always cleared > automatically (unless you have the > com.apple.security.cs.allow-dyld-environment-variables entitlement, so if > there?s a third party app somewhere in the chain that?s a no-no). > -- > Jack Jansen, , http://www.cwi.nl/~jack > If I can't dance I don't want to be part of your revolution -- Emma Goldman > > > > > On 6 Jan 2022, at 19:57, Chris Barker via Pythonmac-SIG < > pythonmac-sig at python.org> wrote: > > > > OK, > > > > I've gotten a bit farther into debugging this. > > > > Turns out it's not about that particular error, it's probably about the > fact that modules couldn't be loaded at start up due to security checks in > the new OS. > > > > We've signed the app but that's not fixing it :-( > > > > Starting the app at the command line at least gets me output, and I see > a lot of errors like this: > > > > File > "PyInstaller-3.4-py3.6.egg/PyInstaller/loader/pyiboot01_bootstrap.py", line > 149, in __init__ > > File "ctypes/__init__.py", line 348, in __init__ > > OSError: dlopen(OpenGL, 10): no suitable image found. Did find: > > file system relative paths not allowed in hardened programs > > > > I am really confused as to how they could disallow relative paths -- how > else could you bundle a library? > > > > though maybe it's a lib outside the bundle that's using relative paths ? > > > > More digging needed, but if anyone has any ideas, I'm all ears. > > > > Also: > > > > - Has anyone gotten a PyInstaller App to work on OS-X 11 ? > > > > - Even better, one that uses OpenGL? > > > > Thanks, > > > > -CHB > > > > > > > > On Thu, Dec 16, 2021 at 11:21 AM Chris Barker > wrote: > > I've just got a new mac with OS-X 11.6 (still Intel). > > > > But when I try to run a PyInstaller built application, I get this error: > > > > No document available for {'mime': 'application/x-maproom-project-zip', > 'loader': 0x7f9669ce6e10>, 'uri': 'template://default_project.maproom'} > > > > And the app won't start. > > > > This has worked just fine on numerous previous OS-X versions. > > > > I have the source code, but the developer that built it is no longer > with us, so it'll take b e a bit to get up to speed, and I don't even know > where to start! Is this a PyInstaller issue? or a code issue, or ??? > > > > Hints: > > > > The application is called MapRoom (maproom) it works with "projects" > that are essentially a zip file with all the info required in it. > > > > I think, on startup, it loads a empty default project, presumably > "default_project.maproom" > > > > So I think that's where the app startup code is barfing, not having the > mime type registered properly. But where / how am I supposed to do that? > > > > or maybe it's not a mime type registration issue, but simply that the > template can't be found -- so a path issue in the App bundle?? > > > > Anyway, I'll be digging into this deeper in the source code, but if > anyone has seen anything like this, any hints would be appreciated! > > > > Thanks, > > > > -CHB > > > > > > > > > > > > > > > > > > > > -- > > > > Christopher Barker, Ph.D. > > Oceanographer > > > > Emergency Response Division > > NOAA/NOS/OR&R (206) 526-6959 voice > > 7600 Sand Point Way NE (206) 526-6329 fax > > Seattle, WA 98115 (206) 526-6317 main reception > > > > Chris.Barker at noaa.gov > > > > > > -- > > > > Christopher Barker, Ph.D. > > Oceanographer > > > > Emergency Response Division > > NOAA/NOS/OR&R (206) 526-6959 voice > > 7600 Sand Point Way NE (206) 526-6329 fax > > Seattle, WA 98115 (206) 526-6317 main reception > > > > Chris.Barker at noaa.gov > > _______________________________________________ > > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > > https://mail.python.org/mailman/listinfo/pythonmac-sig > > unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > https://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG > -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython -------------- next part -------------- An HTML attachment was scrubbed... URL: From bherman.live at gmail.com Wed Jan 12 11:29:45 2022 From: bherman.live at gmail.com (Brian Herman) Date: Wed, 12 Jan 2022 10:29:45 -0600 Subject: [Pythonmac-SIG] Need M1 Mac to Test Message-ID: Do you guys need an M1 mac to test out the latest python? I have an extra macbook air m1 I would be willing to give people access to it so they can test the latest python and compile things or I could do it manually. My brother said you guys didn't have one yet. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at python.org Wed Jan 12 15:52:34 2022 From: nad at python.org (Ned Deily) Date: Wed, 12 Jan 2022 15:52:34 -0500 Subject: [Pythonmac-SIG] Need M1 Mac to Test In-Reply-To: References: Message-ID: <5D1E979C-7AB8-480C-99D1-8DB06B76BB67@python.org> On Jan 12, 2022, at 15:35, Brian Herman wrote: > Do you guys need an M1 mac to test out the latest python? > I have an extra macbook air m1 I would be willing to give people access to it so they can test the latest python and compile things or I could do it manually. > My brother said you guys didn't have one yet. Thank you for the generous offer. We do already have access to various M1 Macs for Python testing including this one already in our buildbot fleet: https://buildbot.python.org/all/#/workers/44 Perhaps some other Python-related project could use access. -- Ned Deily nad at python.org -- [] -------------- next part -------------- An HTML attachment was scrubbed... URL: From jack.jansen at cwi.nl Wed Jan 12 15:53:15 2022 From: jack.jansen at cwi.nl (jack.jansen at cwi.nl) Date: Wed, 12 Jan 2022 21:53:15 +0100 Subject: [Pythonmac-SIG] Need M1 Mac to Test In-Reply-To: References: Message-ID: <836A0ED8-259D-4A32-BE70-C2D0157CF447@cwi.nl> Python runs just fine natively on M1 Macs. The python.org installer will install a Universal2 binary (a single binary containing both the i386 and arm architectures). If you install through brew you get the architecture your brew has been configured for. But there _is_ a problem with native arm Python, and that is that not all extension packages (think: from pypi) have M1 versions available yet. This is especially true for packages that depend on external libraries (which may not have been ported to M1 yet). The way I handle this on my (M1) development machine is that I have both versions of brew installed, which is easy because arm-brew installs into /opt/homebrew by default and intel-brew installs into /usr/local. If I open a Terminal window it has /opt/homebrew/bin before /usr/local/bin in my $PATH, and the background is white. If I open an iTerm window it runs in Rosetta intel emulation mode, it has /usr/local/bin before /opt/homebrew/bin, and the background is a creamy old-fashioned looking off-white color. As long as I do builds in the window of the correct color, and the correct tools I need for building have been installed in the correct directory everything works fine.The white windows will use python3 for arm, the cream windows will use python3 for intel. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman > On 12 Jan 2022, at 17:29, Brian Herman wrote: > > Do you guys need an M1 mac to test out the latest python? > I have an extra macbook air m1 I would be willing to give people access to it so they can test the latest python and compile things or I could do it manually. > My brother said you guys didn't have one yet. > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > https://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at python.org Wed Jan 12 16:54:40 2022 From: nad at python.org (Ned Deily) Date: Wed, 12 Jan 2022 16:54:40 -0500 Subject: [Pythonmac-SIG] Need M1 Mac to Test In-Reply-To: <836A0ED8-259D-4A32-BE70-C2D0157CF447@cwi.nl> References: <836A0ED8-259D-4A32-BE70-C2D0157CF447@cwi.nl> Message-ID: <423E5CA5-87B5-4418-BD87-CB4F295D8F44@python.org> On Jan 12, 2022, at 15:53, jack.jansen at cwi.nl wrote: > Python runs just fine natively on M1 Macs. The python.org installer will install a Universal2 binary (a single binary containing both the i386 and arm architectures). > > If you install through brew you get the architecture your brew has been configured for. > > But there _is_ a problem with native arm Python, and that is that not all extension packages (think: from pypi) have M1 versions available yet. This is especially true for packages that depend on external libraries (which may not have been ported to M1 yet). > > The way I handle this on my (M1) development machine is that I have both versions of brew installed, which is easy because arm-brew installs into /opt/homebrew by default and intel-brew installs into /usr/local. > > If I open a Terminal window it has /opt/homebrew/bin before /usr/local/bin in my $PATH, and the background is white. > > If I open an iTerm window it runs in Rosetta intel emulation mode, it has /usr/local/bin before /opt/homebrew/bin, and the background is a creamy old-fashioned looking off-white color. > > As long as I do builds in the window of the correct color, and the correct tools I need for building have been installed in the correct directory everything works fine.The white windows will use python3 for arm, the cream windows will use python3 for intel. That is one good solution. For those using a universal2 (M1 arm64 and Intel-64 x86_64) build like those from the python.org installers or built from scratch with --with-universal-archs=universal2, ./configure --enable-universalsdk --with-universal-archs=universal2 --prefix=[...] or --enable-framework=[...] ... make -j2 && make install note that a separate python3{x}-intel64 Intel-only executable is installed along with the dual architecture python3{x} executable. In theory it is possible to select which architecture a multi-arch executable is to run under when there is more than one option by using the "arch" command, like here to force running in Intel emulation mode under Rosetta2 on an M1 Mac: arch -x86_64 /path/to/python3{x} But there is a big gotcha with that: if anything running under that non-default arch Python spins off another Python in a subprocess by using the value of sys.executable to find the running interpreter binary, the "arch -x86_64" is effectively lost and the interpreter in the subprocess will run in the default architecture. This happens, for instance, when running Python's own test suite: the top-level Python process running regrtest will be running in Intel emulation but tests running in subprocesses will still be running in the default arm64 arch, possibly giving errors or silently producing misleading results. Running the tests using python3{}-intel64 avoids that problem. Also note that, as of today, we still don't officially support cross-building of single arch Pythons on macOS, that is, building an Intel-only Python on an M1 or vice-versa. If you need such a beast, what should work is building a universal2 version on either type of Mac and then using "lipo" on the executables and libraries as needed to produce a single arch set of files. Of course, that assumes that any third-party libraries needed for the build of Python have to also have been built with both archs. -- Ned Deily nad at python.org -- [] From jack.jansen at cwi.nl Wed Jan 12 17:47:24 2022 From: jack.jansen at cwi.nl (jack.jansen at cwi.nl) Date: Wed, 12 Jan 2022 23:47:24 +0100 Subject: [Pythonmac-SIG] Need M1 Mac to Test In-Reply-To: <423E5CA5-87B5-4418-BD87-CB4F295D8F44@python.org> References: <836A0ED8-259D-4A32-BE70-C2D0157CF447@cwi.nl> <423E5CA5-87B5-4418-BD87-CB4F295D8F44@python.org> Message-ID: > On 12 Jan 2022, at 22:54, Ned Deily wrote: > In theory it is possible to select which architecture a multi-arch executable is to run under when there is more than one option by using the "arch" command, like here to force running in Intel emulation mode under Rosetta2 on an M1 Mac: > > arch -x86_64 /path/to/python3{x} > > But there is a big gotcha with that: if anything running under that non-default arch Python spins off another Python in a subprocess by using the value of sys.executable to find the running interpreter binary, the "arch -x86_64" is effectively lost and the interpreter in the subprocess will run in the default architecture. This happens, for instance, when running Python's own test suite: the top-level Python process running regrtest will be running in Intel emulation but tests running in subprocesses will still be running in the default arm64 arch, possibly giving errors or silently producing misleading results. Running the tests using python3{}-intel64 avoids that problem. Yeah, that?s why I?m staying away from universal builds for now. Often I have a situation where I run cmake which runs make which runs python to create a venv and then somebody higher up will use that venv to create something using ?python" that something else will then use to build something against. The chances of this working with ?arch -x86_64? are slim, if that:-) Looking at the timeline of the PowerPC->Intel transition I think most of the problem will be solved in another year, because pretty much everything will be available for arm natively. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman -------------- next part -------------- An HTML attachment was scrubbed... URL: From bherman.live at gmail.com Wed Jan 12 17:56:30 2022 From: bherman.live at gmail.com (Brian Herman) Date: Wed, 12 Jan 2022 16:56:30 -0600 Subject: [Pythonmac-SIG] Need M1 Mac to Test In-Reply-To: References: <836A0ED8-259D-4A32-BE70-C2D0157CF447@cwi.nl> <423E5CA5-87B5-4418-BD87-CB4F295D8F44@python.org> Message-ID: I wish i was doing python development during the PowerPC->Intel transition. I was in high school and into macs but not python at the time. On Wed, Jan 12, 2022 at 4:48 PM wrote: > > On 12 Jan 2022, at 22:54, Ned Deily wrote: > > In theory it is possible to select which architecture a multi-arch > executable is to run under when there is more than one option by using the > "arch" command, like here to force running in Intel emulation mode under > Rosetta2 on an M1 Mac: > > arch -x86_64 /path/to/python3{x} > > But there is a big gotcha with that: if anything running under that > non-default arch Python spins off another Python in a subprocess by using > the value of sys.executable to find the running interpreter binary, the > "arch -x86_64" is effectively lost and the interpreter in the subprocess > will run in the default architecture. This happens, for instance, when > running Python's own test suite: the top-level Python process running > regrtest will be running in Intel emulation but tests running in > subprocesses will still be running in the default arm64 arch, possibly > giving errors or silently producing misleading results. Running the tests > using python3{}-intel64 avoids that problem. > > > Yeah, that?s why I?m staying away from universal builds for now. Often I > have a situation where I run cmake which runs make which runs python to > create a venv and then somebody higher up will use that venv to create > something using ?python" that something else will then use to build > something against. The chances of this working with ?arch -x86_64? are > slim, if that:-) > > Looking at the timeline of the PowerPC->Intel transition I think most of > the problem will be solved in another year, because pretty much everything > will be available for arm natively. > > -- > > Jack Jansen, , http://www.cwi.nl/~jack > > If I can't dance I don't want to be part of your revolution -- Emma Goldman > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > https://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jack.jansen at cwi.nl Wed Jan 12 19:36:58 2022 From: jack.jansen at cwi.nl (jack.jansen at cwi.nl) Date: Thu, 13 Jan 2022 01:36:58 +0100 Subject: [Pythonmac-SIG] Need M1 Mac to Test In-Reply-To: References: <836A0ED8-259D-4A32-BE70-C2D0157CF447@cwi.nl> <423E5CA5-87B5-4418-BD87-CB4F295D8F44@python.org> Message-ID: No worries, you can do Python development during the Intel->Arm transition. And then in umpteen years during the Arm->RiscV transition, and after that: who knows?. (And you probably weren?t born for the 68000->PowerPC transition) :-) -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman > On 12 Jan 2022, at 23:56, Brian Herman wrote: > > I wish i was doing python development during the PowerPC->Intel transition. > I was in high school and into macs but not python at the time. > > > On Wed, Jan 12, 2022 at 4:48 PM > wrote: > >> On 12 Jan 2022, at 22:54, Ned Deily > wrote: >> In theory it is possible to select which architecture a multi-arch executable is to run under when there is more than one option by using the "arch" command, like here to force running in Intel emulation mode under Rosetta2 on an M1 Mac: >> >> arch -x86_64 /path/to/python3{x} >> >> But there is a big gotcha with that: if anything running under that non-default arch Python spins off another Python in a subprocess by using the value of sys.executable to find the running interpreter binary, the "arch -x86_64" is effectively lost and the interpreter in the subprocess will run in the default architecture. This happens, for instance, when running Python's own test suite: the top-level Python process running regrtest will be running in Intel emulation but tests running in subprocesses will still be running in the default arm64 arch, possibly giving errors or silently producing misleading results. Running the tests using python3{}-intel64 avoids that problem. > > Yeah, that?s why I?m staying away from universal builds for now. Often I have a situation where I run cmake which runs make which runs python to create a venv and then somebody higher up will use that venv to create something using ?python" that something else will then use to build something against. The chances of this working with ?arch -x86_64? are slim, if that:-) > > Looking at the timeline of the PowerPC->Intel transition I think most of the problem will be solved in another year, because pretty much everything will be available for arm natively. > > -- > Jack Jansen, >, http://www.cwi.nl/~jack > If I can't dance I don't want to be part of your revolution -- Emma Goldman > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > https://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > https://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- An HTML attachment was scrubbed... URL: From bherman.live at gmail.com Wed Jan 12 20:14:22 2022 From: bherman.live at gmail.com (Brian Herman) Date: Wed, 12 Jan 2022 19:14:22 -0600 Subject: [Pythonmac-SIG] Need M1 Mac to Test In-Reply-To: References: <836A0ED8-259D-4A32-BE70-C2D0157CF447@cwi.nl> <423E5CA5-87B5-4418-BD87-CB4F295D8F44@python.org> Message-ID: I lived through that era. My dad would let me play with a Mac SE. I would play with LC II at school and Apple II. I have an Apple IIe. On Wed, Jan 12, 2022 at 6:37 PM wrote: > No worries, you can do Python development during the Intel->Arm > transition. And then in umpteen years during the Arm->RiscV transition, and > after that: who knows?. > > (And you probably weren?t born for the 68000->PowerPC transition) > > :-) > > -- > > Jack Jansen, , http://www.cwi.nl/~jack > > If I can't dance I don't want to be part of your revolution -- Emma Goldman > > > > On 12 Jan 2022, at 23:56, Brian Herman wrote: > > I wish i was doing python development during the PowerPC->Intel transition. > I was in high school and into macs but not python at the time. > > > On Wed, Jan 12, 2022 at 4:48 PM wrote: > >> >> On 12 Jan 2022, at 22:54, Ned Deily wrote: >> >> In theory it is possible to select which architecture a multi-arch >> executable is to run under when there is more than one option by using the >> "arch" command, like here to force running in Intel emulation mode under >> Rosetta2 on an M1 Mac: >> >> arch -x86_64 /path/to/python3{x} >> >> But there is a big gotcha with that: if anything running under that >> non-default arch Python spins off another Python in a subprocess by using >> the value of sys.executable to find the running interpreter binary, the >> "arch -x86_64" is effectively lost and the interpreter in the subprocess >> will run in the default architecture. This happens, for instance, when >> running Python's own test suite: the top-level Python process running >> regrtest will be running in Intel emulation but tests running in >> subprocesses will still be running in the default arm64 arch, possibly >> giving errors or silently producing misleading results. Running the tests >> using python3{}-intel64 avoids that problem. >> >> >> Yeah, that?s why I?m staying away from universal builds for now. Often I >> have a situation where I run cmake which runs make which runs python to >> create a venv and then somebody higher up will use that venv to create >> something using ?python" that something else will then use to build >> something against. The chances of this working with ?arch -x86_64? are >> slim, if that:-) >> >> Looking at the timeline of the PowerPC->Intel transition I think most of >> the problem will be solved in another year, because pretty much everything >> will be available for arm natively. >> >> -- >> Jack Jansen, , http://www.cwi.nl/~jack >> If I can't dance I don't want to be part of your revolution -- Emma >> Goldman >> >> >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> https://mail.python.org/mailman/listinfo/pythonmac-sig >> unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG >> > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > https://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From galaxybrainhuman at gmail.com Wed Jan 12 15:55:21 2022 From: galaxybrainhuman at gmail.com (Galaxy Brain Human) Date: Wed, 12 Jan 2022 14:55:21 -0600 Subject: [Pythonmac-SIG] Need M1 Mac to Test In-Reply-To: <836A0ED8-259D-4A32-BE70-C2D0157CF447@cwi.nl> References: <836A0ED8-259D-4A32-BE70-C2D0157CF447@cwi.nl> Message-ID: Awesome, thanks for the information! I tried getting JAX to install from pip and was having a hard time. I wanted to get gpt-j to use the python that was accelerated with the neural engine from apple. On Wed, Jan 12, 2022 at 2:53 PM wrote: > Python runs just fine natively on M1 Macs. The python.org installer will > install a Universal2 binary (a single binary containing both the i386 and > arm architectures). > > If you install through brew you get the architecture your brew has been > configured for. > > But there _is_ a problem with native arm Python, and that is that not all > extension packages (think: from pypi) have M1 versions available yet. This > is especially true for packages that depend on external libraries (which > may not have been ported to M1 yet). > > The way I handle this on my (M1) development machine is that I have both > versions of brew installed, which is easy because arm-brew installs into > /opt/homebrew by default and intel-brew installs into /usr/local. > > If I open a Terminal window it has /opt/homebrew/bin before /usr/local/bin > in my $PATH, and the background is white. > > If I open an iTerm window it runs in Rosetta intel emulation mode, it has > /usr/local/bin before /opt/homebrew/bin, and the background is a creamy > old-fashioned looking off-white color. > > As long as I do builds in the window of the correct color, and the correct > tools I need for building have been installed in the correct directory > everything works fine.The white windows will use python3 for arm, the cream > windows will use python3 for intel. > > -- > > Jack Jansen, , http://www.cwi.nl/~jack > > If I can't dance I don't want to be part of your revolution -- Emma Goldman > > > > On 12 Jan 2022, at 17:29, Brian Herman wrote: > > Do you guys need an M1 mac to test out the latest python? > I have an extra macbook air m1 I would be willing to give people access to > it so they can test the latest python and compile things or I could do it > manually. > My brother said you guys didn't have one yet. > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > https://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: