Re: Universal build launches as Intel on M1

Aivar Annamaa <[email protected]> Tue, 29 Mar 2022 09:05:59 +0300
Newsgroups gmane.comp.python.apple
Message-ID <CAEbkakeztJuc9vX9DANHb1i1w==JGKQiBfSAhUn9j9OKZcShhw@mail.gmail.com>
--===============2959556089569865526==
Content-Type: multipart/alternative; boundary="000000000000bcfb8005db5539e2"

--000000000000bcfb8005db5539e2
Content-Type: text/plain; charset="UTF-8"

Jack and Ned, thanks a lot!

I had forgotten about Distribution.plist. Will try the suggested value in
the next beta.

Best regards,
Aivar

On Tue, Mar 29, 2022 at 12:45 AM Ned Deily <[email protected]> wrote:

> On 28 Mar 2022, at 10:08, Aivar Annamaa <[email protected]> wrote:
> > I have an app bundle, with embedded python.org's universal build of
> Python 3.10.2 framework and a Tkinter-based GUI (
> https://github.com/thonny/thonny/releases/tag/v4.0.0b1)
> >
> > I've used IDLE's approach in the Info.plist, and the launcher script.
> Functionally all is working fine, but a M1 user reported, that when opened
> from Finder, the app is launched in "Intel" mode. When the launcher is
> invoked in Terminal (/Applications/Thonny.app/Contents/MacOS/thonny), the
> app gets run in AMD64 mode. I don't have a M1 myself, so I haven't
> reproduced it myself.
> >
> > The same user now said that latest IDLE (3.10.4) runs in AMD64 mode even
> when launched from Finder.
> >
> > Any ideas what to check or try in order to make my app run in native
> mode?
> >
> > My launcher script template is here:
> https://github.com/thonny/thonny/blob/master/packaging/mac/Thonny.app.initial_template/Contents/MacOS/thonny
> (shebang becomes gets set to
> .../Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/Resources/Python.app/Contents/MacOS/Python
> by the postinstall script)
> >
> > Info.plist template is here:
> https://github.com/thonny/thonny/blob/master/packaging/mac/Thonny.app.initial_template/Contents/Info.plist
>
>
> It looks the problem is in your Distribution.plist; change the
> hostArchitectures to "arm64,x86_64".  Otherwise, the macOS installer
> assumes your app can only run as an Intel binary.
>
>
> https://github.com/thonny/thonny/blob/a9d12ba961eac875dc4a77ac1fb226baf5c3acc9/packaging/mac/Distribution.plist#L9
>
> --
>   Ned Deily
>   [email protected] -- []
>
>

--000000000000bcfb8005db5539e2
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Jack and Ned, thanks a lot!<div><br></div><div>I had forgo=
tten about Distribution.plist. Will try the suggested value in the next bet=
a.</div><div><br></div><div>Best regards,<br>Aivar</div></div><br><div clas=
s=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Tue, Mar 29, 202=
2 at 12:45 AM Ned Deily &lt;<a href=3D"mailto:[email protected]" target=3D"_bl=
ank">[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quot=
e" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204)=
;padding-left:1ex">On 28 Mar 2022, at 10:08, Aivar Annamaa &lt;<a href=3D"m=
ailto:[email protected]" target=3D"_blank">[email protected]</a=
>&gt; wrote:<br>
&gt; I have an app bundle, with embedded <a href=3D"http://python.org" rel=
=3D"noreferrer" target=3D"_blank">python.org</a>&#39;s universal build of P=
ython 3.10.2 framework and a Tkinter-based GUI (<a href=3D"https://github.c=
om/thonny/thonny/releases/tag/v4.0.0b1" rel=3D"noreferrer" target=3D"_blank=
">https://github.com/thonny/thonny/releases/tag/v4.0.0b1</a>)<br>
&gt; <br>
&gt; I&#39;ve used IDLE&#39;s approach in the Info.plist, and the launcher =
script. Functionally all is working fine, but a M1 user reported, that when=
 opened from Finder, the app is launched in &quot;Intel&quot; mode. When th=
e launcher is invoked in Terminal (/Applications/Thonny.app/Contents/MacOS/=
thonny), the app gets run in AMD64 mode. I don&#39;t have a M1 myself, so I=
 haven&#39;t reproduced it myself.<br>
&gt; <br>
&gt; The same user now said that latest IDLE (3.10.4) runs in AMD64 mode ev=
en when launched from Finder.<br>
&gt; <br>
&gt; Any ideas what to check or try in order to make my app run in native m=
ode?<br>
&gt; <br>
&gt; My launcher script template is here: <a href=3D"https://github.com/tho=
nny/thonny/blob/master/packaging/mac/Thonny.app.initial_template/Contents/M=
acOS/thonny" rel=3D"noreferrer" target=3D"_blank">https://github.com/thonny=
/thonny/blob/master/packaging/mac/Thonny.app.initial_template/Contents/MacO=
S/thonny</a> (shebang becomes gets set to .../Thonny.app/Contents/Framework=
s/Python.framework/Versions/3.10/Resources/Python.app/Contents/MacOS/Python=
 by the postinstall script)<br>
&gt; <br>
&gt; Info.plist template is here: <a href=3D"https://github.com/thonny/thon=
ny/blob/master/packaging/mac/Thonny.app.initial_template/Contents/Info.plis=
t" rel=3D"noreferrer" target=3D"_blank">https://github.com/thonny/thonny/bl=
ob/master/packaging/mac/Thonny.app.initial_template/Contents/Info.plist</a>=
<br>
<br>
<br>
It looks the problem is in your Distribution.plist; change the hostArchitec=
tures to &quot;arm64,x86_64&quot;.=C2=A0 Otherwise, the macOS installer ass=
umes your app can only run as an Intel binary.<br>
<br>
<a href=3D"https://github.com/thonny/thonny/blob/a9d12ba961eac875dc4a77ac1f=
b226baf5c3acc9/packaging/mac/Distribution.plist#L9" rel=3D"noreferrer" targ=
et=3D"_blank">https://github.com/thonny/thonny/blob/a9d12ba961eac875dc4a77a=
c1fb226baf5c3acc9/packaging/mac/Distribution.plist#L9</a><br>
<br>
--<br>
=C2=A0 Ned Deily<br>
=C2=A0 <a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]</=
a> -- []<br>
<br>
</blockquote></div>

--000000000000bcfb8005db5539e2--

--===============2959556089569865526==
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

--===============2959556089569865526==--