Re: Need M1 Mac to Test
[email protected] Wed, 12 Jan 2022 23:47:24 +0100
| Newsgroups | gmane.comp.python.apple |
|---|---|
| Message-ID | <[email protected]> |
--===============7636460828839224540== Content-Type: multipart/alternative; boundary="Apple-Mail=_D746A48C-F3C2-42B5-895E-E4191355428A" --Apple-Mail=_D746A48C-F3C2-42B5-895E-E4191355428A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > 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 = the "arch" command, like here to force running in Intel emulation mode = under Rosetta2 on an M1 Mac: >=20 > arch -x86_64 /path/to/python3{x} >=20 > 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 = 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 =E2=80=9Cpython" that something else = will then use to build 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 = everything 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 = Goldman --Apple-Mail=_D746A48C-F3C2-42B5-895E-E4191355428A Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; = charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><div = class=3D""><br class=3D""></div><blockquote type=3D"cite" class=3D"">On = 12 Jan 2022, at 22:54, Ned Deily <<a href=3D"mailto:[email protected]" = class=3D"">[email protected]</a>> wrote:</blockquote><blockquote = type=3D"cite" class=3D""> 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:<br class=3D""><br = class=3D"">arch -x86_64 /path/to/python3{x}<br class=3D""><br = class=3D"">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.<br class=3D""></blockquote><div class=3D""><br = class=3D""></div>Yeah, that=E2=80=99s why I=E2=80=99m 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 =E2=80=9Cpython" = that something else will then use to build something against. The = chances of this working with =E2=80=9Carch -x86_64=E2=80=9D are slim, if = that:-)<div class=3D""><br class=3D""></div><div class=3D"">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.<br class=3D""><div class=3D""><br = class=3D""></div><div class=3D""> <span class=3D"Apple-style-span" style=3D"border-collapse: separate; = font-variant-ligatures: normal; font-variant-east-asian: normal; = font-variant-position: normal; line-height: normal; border-spacing: 0px; = -webkit-text-decorations-in-effect: none;"><div class=3D""><p = style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; = margin-left: 0px; " class=3D""><font face=3D"Helvetica" size=3D"3" = style=3D"font: normal normal normal 12px/normal Helvetica; " = class=3D"">--</font></p><p style=3D"margin-top: 0px; margin-right: 0px; = margin-bottom: 0px; margin-left: 0px; " class=3D""><font = face=3D"Helvetica" size=3D"3" style=3D"font: normal normal normal = 12px/normal Helvetica; " class=3D"">Jack Jansen, <<a = href=3D"mailto:[email protected]" class=3D"">[email protected]</a>>, = <a href=3D"http://www.cwi.nl/~jack" = class=3D"">http://www.cwi.nl/~jack</a></font></p><p style=3D"margin-top: = 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " = class=3D""><font face=3D"Helvetica" size=3D"3" style=3D"font: normal = normal normal 12px/normal Helvetica; " class=3D"">If I can't dance I = don't want to be part of your revolution -- Emma Goldman</font></p><br = class=3D"Apple-interchange-newline"></div></span><br = class=3D"Apple-interchange-newline"> </div> <div><br class=3D""></div></div></body></html>= --Apple-Mail=_D746A48C-F3C2-42B5-895E-E4191355428A-- --===============7636460828839224540== 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 --===============7636460828839224540==--