Re: Need M1 Mac to Test
Brian Herman <[email protected]> Wed, 12 Jan 2022 16:56:30 -0600
| Newsgroups | gmane.comp.python.apple |
|---|---|
| Message-ID | <CAN0LK4Mz=6uzhRkoXZW2NMPc5vbohZLzgGZnBYfFy4RNtjEnKw@mail.gmail.com> |
--===============0652310777281647128== Content-Type: multipart/alternative; boundary="000000000000a8536905d56a7b81" --000000000000a8536905d56a7b81 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 <[email protected]> wrote: > > On 12 Jan 2022, at 22:54, Ned Deily <[email protected]> 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 th= e > "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=E2=80=99s why I=E2=80=99m staying away from universal builds f= or 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 =E2=80=9Cpython" that something else will then use to bui= ld > something against. The chances of this working with =E2=80=9Carch -x86_64= =E2=80=9D 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 everythin= g > will be available for arm natively. > > -- > > 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 > > > > _______________________________________________ > Pythonmac-SIG maillist - [email protected] > https://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG > --000000000000a8536905d56a7b81 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">I wish i was doing python development during the PowerPC-&= gt;Intel transition.<div>I was in high school and into macs but not python = at the time.</div><div><br></div></div><br><div class=3D"gmail_quote"><div = dir=3D"ltr" class=3D"gmail_attr">On Wed, Jan 12, 2022 at 4:48 PM <<a hre= f=3D"mailto:[email protected]">[email protected]</a>> wrote:<br></div>= <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-= left:1px solid rgb(204,204,204);padding-left:1ex"><div style=3D"overflow-wr= ap: break-word;"><div><br></div><blockquote type=3D"cite">On 12 Jan 2022, a= t 22:54, Ned Deily <<a href=3D"mailto:[email protected]" target=3D"_blank">= [email protected]</a>> wrote:</blockquote><blockquote type=3D"cite">=C2=A0I= n theory it is possible to select which architecture a multi-arch executabl= e is to run under when there is more than one option by using the "arc= h" command, like here to force running in Intel emulation mode under R= osetta2 on an M1 Mac:<br><br>arch -x86_64 /path/to/python3{x}<br><br>But th= ere is a big gotcha with that: if anything running under that non-default a= rch Python spins off another Python in a subprocess by using the value of s= ys.executable to find the running interpreter binary, the "arch -x86_6= 4" is effectively lost and the interpreter in the subprocess will run = in the default architecture. This happens, for instance, when running Pytho= n'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 pr= oducing misleading results. Running the tests using python3{}-intel64 avoid= s that problem.<br></blockquote><div><br></div>Yeah, that=E2=80=99s why I= =E2=80=99m staying away from universal builds for now. Often I have a situa= tion where I run cmake which runs make which runs python to create a venv a= nd then somebody higher up will use that venv to create something using =E2= =80=9Cpython" that something else will then use to build something aga= inst. The chances of this working with =E2=80=9Carch -x86_64=E2=80=9D are s= lim, if that:-)<div><br></div><div>Looking at the timeline of the PowerPC-&= gt;Intel transition I think most of the problem will be solved in another y= ear, because pretty much everything will be available for arm natively.<br>= <div><br></div><div> <span style=3D"border-collapse:separate;font-variant-ligatures:normal;font-= variant-east-asian:normal;line-height:normal;border-spacing:0px"><div><p st= yle=3D"margin:0px"><font face=3D"Helvetica" size=3D"3" style=3D"font:12px H= elvetica">--</font></p><p style=3D"margin:0px"><font face=3D"Helvetica" siz= e=3D"3" style=3D"font:12px Helvetica">Jack Jansen, <<a href=3D"mailto:Ja= [email protected]" target=3D"_blank">[email protected]</a>>, <a href=3D"= http://www.cwi.nl/~jack" target=3D"_blank">http://www.cwi.nl/~jack</a></fon= t></p><p style=3D"margin:0px"><font face=3D"Helvetica" size=3D"3" style=3D"= font:12px Helvetica">If I can't dance I don't want to be part of yo= ur revolution -- Emma Goldman</font></p><br></div></span><br> </div> <div><br></div></div></div>_______________________________________________<= 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> --000000000000a8536905d56a7b81-- --===============0652310777281647128== 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 --===============0652310777281647128==--