From 9ae7284f362dbd6c40dc2115d8af907f4e1fece3 Mon Sep 17 00:00:00 2001 From: Daniel McClanahan <1305167+cosmicexplorer@users.noreply.github.com> Date: Wed, 21 Mar 2018 15:03:38 -0700 Subject: [PATCH] add some more comments to explain what i'm thinking --- .../python/subsystems/python_dist_build_environment.py | 6 ++++++ .../python/tasks/build_local_python_distributions.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/python/pants/backend/python/subsystems/python_dist_build_environment.py b/src/python/pants/backend/python/subsystems/python_dist_build_environment.py index d4c126b4e4ce..0e8cdd4338da 100644 --- a/src/python/pants/backend/python/subsystems/python_dist_build_environment.py +++ b/src/python/pants/backend/python/subsystems/python_dist_build_environment.py @@ -25,6 +25,12 @@ def _native_toolchain(self): def modify_environment(self, env): env = self._native_toolchain.modify_environment(env) + # If we're going to be wrapping setup.py-based projects, we really should be + # doing it through a subclass of a distutils UnixCCompiler (in Lib/distutils + # in the CPython source) instead of hoping setup.py knows what to do. The + # default UnixCCompiler from distutils will build a 32/64-bit "fat binary" + # unless you use their undocumented ARCHFLAGS env var, and there may be more + # dragons later on. env['CC'] = 'gcc' env['CXX'] = 'g++' env['ARCHFLAGS'] = '-arch x86_64' diff --git a/src/python/pants/backend/python/tasks/build_local_python_distributions.py b/src/python/pants/backend/python/tasks/build_local_python_distributions.py index e4dd4a352d60..af7a3f78b0ce 100644 --- a/src/python/pants/backend/python/tasks/build_local_python_distributions.py +++ b/src/python/pants/backend/python/tasks/build_local_python_distributions.py @@ -53,7 +53,7 @@ def subsystem_dependencies(cls): # TODO: seriously consider subclassing UnixCCompiler as well as the build_ext # command from distutils to control the compiler and linker invocations - # transparently instead of guessing what distutils does by default. + # transparently instead of hoping distutils does the right thing. @memoized_property def _python_dist_build_environment(self): return PythonDistBuildEnvironment.scoped_instance(self)