Re: Error with mimetype on OS-X 11 (Big Sur)
Christopher Barker <[email protected]> Fri, 7 Jan 2022 16:30:38 -0800
| Newsgroups | gmane.comp.python.apple |
|---|---|
| Message-ID | <CALn7ch_NywKm1=SWZboUv=r9wX37Z7hahPOHZ4qNE-dLVr1jKg@mail.gmail.com> |
--===============6086865541758633195== Content-Type: multipart/alternative; boundary="00000000000017534d05d50737c8" --00000000000017534d05d50737c8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=E2=80=99ll report back if I figure it out. -CHB On Fri, Jan 7, 2022 at 3:40 PM <[email protected]> wrote: > I googled the "file system relative paths not allowed in hardened > programs=E2=80=9D 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 proble= m. > > 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=E2=80=99s worth a sh= ot. If > (big if) this is a dynamic loader problem you=E2=80=99re in for a hard ti= me: it > used to be possible to debug these by setting the various DYLD_ environme= nt > variables to =E2=80=9Clook over the shoulder=E2=80=9D of the dynamic load= er 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=E2=80=99s a third party app somewhere in the chain that=E2=80=99s a= no-no). > -- > Jack Jansen, <[email protected]>, http://www.cwi.nl/~jack > If I can't dance I don't want to be part of your revolution -- Emma Goldm= an > > > > > On 6 Jan 2022, at 19:57, Chris Barker via Pythonmac-SIG < > [email protected]> 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 i= n > 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", li= ne > 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 -- ho= w > 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 <[email protected]> > 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': <maproom.loaders.project.ZipProjectLoader object at > 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 kno= w > 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 > > > > [email protected] > > > > > > -- > > > > 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 > > > > [email protected] > > _______________________________________________ > > Pythonmac-SIG maillist - [email protected] > > https://mail.python.org/mailman/listinfo/pythonmac-sig > > unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG > > _______________________________________________ > Pythonmac-SIG maillist - [email protected] > https://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG > --=20 Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython --00000000000017534d05d50737c8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto">Thanks Jack, this sounds like a promising lead.</div><div= dir=3D"auto"><br></div><div dir=3D"auto">In this case, it seems to be PyOp= enGL, ultimately loading a system dynlib. But the broken bit may be within = my control.</div><div dir=3D"auto"><br></div><div dir=3D"auto">I=E2=80=99ll= report back if I figure it out.</div><div dir=3D"auto"><br></div><div dir= =3D"auto">-CHB</div><div><br><div class=3D"gmail_quote"><div dir=3D"ltr" cl= ass=3D"gmail_attr">On Fri, Jan 7, 2022 at 3:40 PM <<a href=3D"mailto:jac= [email protected]">[email protected]</a>> wrote:<br></div><blockquote cla= ss=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pa= dding-left:1ex">I googled the "file system relative paths not allowed = in hardened programs=E2=80=9D and the results made me remember a similar is= sue I have seen recently.<br> <br> I was loading a dylib through ctypes, and suddenly this stopped working. Th= e problem eventually turned out to be that another dylib (a dependency of t= he dylib I was loading) had its quarantine flag set. That was never a probl= em before, but suddenly (last summer?) it has started to be a problem.<br> <br> The solution turned out to be to run `xattr -d com.apple.quarantine blablab= la.dylib` on the problem library.<br> <br> Not sure whether this is your problem or not, but it=E2=80=99s worth a shot= . If (big if) this is a dynamic loader problem you=E2=80=99re in for a hard= time: it used to be possible to debug these by setting the various DYLD_ e= nvironment variables to =E2=80=9Clook over the shoulder=E2=80=9D of the dyn= amic loader to see what it is doing, but nowadays these environment variabl= es are always cleared automatically (unless you have the com.apple.security= .cs.allow-dyld-environment-variables entitlement, so if there=E2=80=99s a t= hird party app somewhere in the chain that=E2=80=99s a no-no).<br> --<br> Jack Jansen, <<a href=3D"mailto:[email protected]" target=3D"_blank">Ja= [email protected]</a>>, <a href=3D"http://www.cwi.nl/~jack" rel=3D"norefe= rrer" target=3D"_blank">http://www.cwi.nl/~jack</a><br> If I can't dance I don't want to be part of your revolution -- Emma= Goldman<br> <br> <br> <br> > On 6 Jan 2022, at 19:57, Chris Barker via Pythonmac-SIG <<a href=3D= "mailto:[email protected]" target=3D"_blank">[email protected]= g</a>> wrote:<br> > <br> > OK,<br> > <br> > I've gotten a bit farther into debugging this.<br> > <br> > 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 secur= ity checks in the new OS.<br> > <br> > We've signed the app but that's not fixing it :-( <br> > <br> > Starting the app at the command line at least gets me output, and I se= e a lot of errors like this:<br> > <br> >=C2=A0 =C2=A0File "PyInstaller-3.4-py3.6.egg/PyInstaller/loader/py= iboot01_bootstrap.py", line 149, in __init__<br> >=C2=A0 =C2=A0File "ctypes/__init__.py", line 348, in __init__= <br> > OSError: dlopen(OpenGL, 10): no suitable image found.=C2=A0 Did find:<= br> >=C2=A0 =C2=A0 =C2=A0file system relative paths not allowed in hardened = programs<br> > <br> > I am really confused as to how they could disallow relative paths -- h= ow else could you bundle a library?<br> > <br> > though maybe it's a lib outside the bundle that's using relati= ve paths ?<br> > <br> > More digging needed, but if anyone has any ideas, I'm all ears.<br= > > <br> > Also:<br> > <br> > - Has anyone gotten a PyInstaller App to work on OS-X 11 ?<br> > <br> > - Even better, one that uses OpenGL?<br> > <br> > Thanks,<br> > <br> > -CHB<br> > <br> > <br> > <br> > On Thu, Dec 16, 2021 at 11:21 AM Chris Barker <<a href=3D"mailto:ch= [email protected]" target=3D"_blank">[email protected]</a>> wrote:= <br> > I've just got a new mac with OS-X 11.6 (still Intel).<br> > <br> > But when I try to run a PyInstaller built application, I get this erro= r:<br> > <br> > No document available for {'mime': 'application/x-maproom-= project-zip', 'loader': <maproom.loaders.project.ZipProjectL= oader object at 0x7f9669ce6e10>, 'uri': 'template://default_= project.maproom'}<br> > <br> > And the app won't start.<br> > <br> > This has worked just fine on numerous previous OS-X versions.<br> > <br> > I have the source code, but the developer that built it is no longer w= ith us, so it'll take b e a bit to get up to speed, and I don't eve= n know where to start! Is this a PyInstaller issue? or a code issue, or ???= <br> > <br> > Hints:<br> > <br> > The application is called MapRoom (maproom) it works with "projec= ts" that are essentially a zip file with all the info required in it.<= br> > <br> > I think, on startup, it loads a empty default project, presumably &quo= t;default_project.maproom"<br> > <br> > So I think that's where the app startup code is barfing, not havin= g the mime type registered properly. But where / how am I supposed to do th= at?<br> > <br> > 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??<br> > <br> > Anyway, I'll be digging into this deeper in the source code, but i= f anyone has seen anything like this, any hints would be appreciated!<br> > <br> > Thanks,<br> > <br> > -CHB<br> > <br> > <br> > <br> > <br> > <br> > <br> > <br> >=C2=A0 <br> > <br> > -- <br> > <br> > Christopher Barker, Ph.D.<br> > Oceanographer<br> > <br> > Emergency Response Division<br> > NOAA/NOS/OR&R=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (206) 526-6= 959=C2=A0 =C2=A0voice<br> > 7600 Sand Point Way NE=C2=A0 =C2=A0(206) 526-6329=C2=A0 =C2=A0fax<br> > Seattle, WA=C2=A0 98115=C2=A0 =C2=A0 =C2=A0 =C2=A0(206) 526-6317=C2=A0= =C2=A0main reception<br> > <br> > <a href=3D"mailto:[email protected]" target=3D"_blank">Chris.Barke= [email protected]</a><br> > <br> > <br> > -- <br> > <br> > Christopher Barker, Ph.D.<br> > Oceanographer<br> > <br> > Emergency Response Division<br> > NOAA/NOS/OR&R=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (206) 526-6= 959=C2=A0 =C2=A0voice<br> > 7600 Sand Point Way NE=C2=A0 =C2=A0(206) 526-6329=C2=A0 =C2=A0fax<br> > Seattle, WA=C2=A0 98115=C2=A0 =C2=A0 =C2=A0 =C2=A0(206) 526-6317=C2=A0= =C2=A0main reception<br> > <br> > <a href=3D"mailto:[email protected]" target=3D"_blank">Chris.Barke= [email protected]</a><br> > _______________________________________________<br> > Pythonmac-SIG maillist=C2=A0 -=C2=A0 <a href=3D"mailto:Pythonmac-SIG@p= ython.org" target=3D"_blank">[email protected]</a><br> > <a href=3D"https://mail.python.org/mailman/listinfo/pythonmac-sig" rel= =3D"noreferrer" target=3D"_blank">https://mail.python.org/mailman/listinfo/= pythonmac-sig</a><br> > unsubscribe: <a href=3D"https://mail.python.org/mailman/options/Python= mac-SIG" rel=3D"noreferrer" target=3D"_blank">https://mail.python.org/mailm= an/options/Pythonmac-SIG</a><br> <br> _______________________________________________<br> Pythonmac-SIG maillist=C2=A0 -=C2=A0 <a href=3D"mailto:Pythonmac-SIG@python= .org" target=3D"_blank">[email protected]</a><br> <a href=3D"https://mail.python.org/mailman/listinfo/pythonmac-sig" rel=3D"n= oreferrer" target=3D"_blank">https://mail.python.org/mailman/listinfo/pytho= nmac-sig</a><br> unsubscribe: <a href=3D"https://mail.python.org/mailman/options/Pythonmac-S= IG" rel=3D"noreferrer" target=3D"_blank">https://mail.python.org/mailman/op= tions/Pythonmac-SIG</a><br> </blockquote></div></div>-- <br><div dir=3D"ltr" class=3D"gmail_signature" = data-smartmail=3D"gmail_signature"><div dir=3D"ltr">Christopher Barker, PhD= (Chris)<br><br> Python Language Consulting<br>=C2=A0 - Teaching<br>=C2=A0 = - Scientific Software Development<br>=C2=A0 - Desktop GUI and Web Developme= nt<br>=C2=A0 - wxPython, numpy, scipy, Cython<br></div></div> --00000000000017534d05d50737c8-- --===============6086865541758633195== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Pythonmac-SIG maillist - [email protected] https://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG --===============6086865541758633195==--