#28703: Python 2.6 (Universal) does not honor 'arch -i386' command at runtime -----------------------------+---------------------------------------------- Reporter: tcwan@… | Owner: mcalhoun@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.2 Keywords: | Port: python26 -----------------------------+---------------------------------------------- Changes (by jmr@…): * owner: macports-tickets@… => mcalhoun@… * port: => python26 Old description:
I have built Python 2.6 and 2.7 with +universal. I need to execute 32-bit Python for a specific module.
tcmac$ file /opt/local/bin/python2.* /opt/local/bin/python2.6: Mach-O universal binary with 2 architectures /opt/local/bin/python2.6 (for architecture x86_64): Mach-O 64-bit executable x86_64 /opt/local/bin/python2.6 (for architecture i386): Mach-O executable i386 /opt/local/bin/python2.6-config: a /opt/local/Library/Frameworks/P script text executable /opt/local/bin/python2.7: Mach-O universal binary with 2 architectures /opt/local/bin/python2.7 (for architecture x86_64): Mach-O 64-bit executable x86_64 /opt/local/bin/python2.7 (for architecture i386): Mach-O executable i386 /opt/local/bin/python2.7-config: a /opt/local/Library/Frameworks/P script text executable
However, when using the arch command to specify the runtime architecture, only Python 2.7 honors this, it does not work with Python 2.6.
tcmac$ arch -i386 /opt/local/bin/python2.6 Python 2.6.6 (r266:84292, Mar 4 2011, 09:28:43) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import sys print sys.maxsize 9223372036854775807
tcmac$ arch -i386 /opt/local/bin/python2.7 Python 2.7.1 (r271:86832, Mar 1 2011, 09:22:53) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import sys print sys.maxsize 2147483647
New description: I have built Python 2.6 and 2.7 with +universal. I need to execute 32-bit Python for a specific module. {{{ tcmac$ file /opt/local/bin/python2.* /opt/local/bin/python2.6: Mach-O universal binary with 2 architectures /opt/local/bin/python2.6 (for architecture x86_64): Mach-O 64-bit executable x86_64 /opt/local/bin/python2.6 (for architecture i386): Mach-O executable i386 /opt/local/bin/python2.6-config: a /opt/local/Library/Frameworks/P script text executable /opt/local/bin/python2.7: Mach-O universal binary with 2 architectures /opt/local/bin/python2.7 (for architecture x86_64): Mach-O 64-bit executable x86_64 /opt/local/bin/python2.7 (for architecture i386): Mach-O executable i386 /opt/local/bin/python2.7-config: a /opt/local/Library/Frameworks/P script text executable }}} However, when using the arch command to specify the runtime architecture, only Python 2.7 honors this, it does not work with Python 2.6. {{{ tcmac$ arch -i386 /opt/local/bin/python2.6 Python 2.6.6 (r266:84292, Mar 4 2011, 09:28:43) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import sys print sys.maxsize 9223372036854775807
tcmac$ arch -i386 /opt/local/bin/python2.7 Python 2.7.1 (r271:86832, Mar 1 2011, 09:22:53) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import sys print sys.maxsize 2147483647
}}}
-- Comment: Please remember to preview and use WikiFormatting, fill in the Port field, and cc the maintainer. This isn't a problem specific to the port; the official binaries behave the same. So I doubt it's going to be fixed. Run python like this: `arch -i386 /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python` -- Ticket URL: <https://trac.macports.org/ticket/28703#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS