[Python-Dev] [Distutils] FW: [issue2513] 64bit cross compilation on windows

Mark Hammond mhammond at skippinet.com.au
Thu Apr 3 00:50:10 CEST 2008

> I think this is fine; we don't really have a notion of compiling for a
> native platform, nor is the build machine's architecture factored into
> the equation.

Actually, I think it is slightly.  IIUC, the AMD64 build currently assumes
it can execute x86 executables in various places.  To fix this, the build
process for each of the platforms would be slightly different.  My proposal
would allow (eg) 'PCBuild\python.exe' or 'PCBuild\make_versioninfo.exe' to
specified in build processes, with the knowledge it will work, regardless of
what platform it is being run on.

For example, with my idea, you could write code such as:

  exe = os.path.join(os.getenv("PYTHON_HOME"), "PCBuild", "python.exe"))
  popen(exe, ...)

and expect it to work on all platforms.  If I understand correctly, I now
need to write something like:

  if "AMD64" in sys.platform:
    exe = os.path.join(os.getenv("PYTHON_HOME"), "PCBuild", "amd64",
  else if "32 bit" in sys.platform:
    exe = os.path.join(os.getenv("PYTHON_HOME"), "PCBuild", "python.exe"))
    # hrm - I obviously don’t know about new platforms yet...    
  popen(exe, ...)

In other words, I think there is real advantage to simple scripts knowing
that './python' or './PCBuild/python.exe' will always be executable (and
always give the "native" version if the platform does emulation)

But I accept I'm waving appendages in the wind, and without a concrete
use-case I will take Martin's advice and let it go.



More information about the Python-Dev mailing list