Issue with method _darwin_compiler_fixup in distutils/unixcompiler.py
Hello all, When compiling MySQL-python module on Mac OSX Mavericks, I executed the command "python setup.py build" and got an error when compiling the C extension. In the output from build command, I see that it has tried running the C compiler with the following command: / A p p l i c a t i o n s / X c o d e . a p p / C o n t e n t s / D e v e l o p e r / T o o l c h a i n s / X c o d e D e f a u l t . x c t o o l c h a i n / u s r / b i n / c l a n g - f n o - s t r i c t - a l i a s i n g - f n o - c o m m o n - d y n a m i c - a r c h x 8 6 _ 6 4 - a r c h i 3 8 6 - g - O s - p i p e - f n o - c o m m o n - f n o - s t r i c t - a l i a s i n g - f w r a p v - m n o - f u s e d - m a d d - D E N A B L E _ D T R A C E - D M A C O S X - D N D E B U G - W a l l - W s t r i c t - p r o t o t y p e s - W s h o r t e n - 6 4 - t o - 3 2 - D N D E B U G - g - f w r a p v - O s - W a l l - W s t r i c t - p r o t o t y p e s - D E N A B L E _ D T R A C E - a r c h x 8 6 _ 6 4 - a r c h i 3 8 6 - p i p e -Dversion_info=(1,2,4,'beta',4) -D__version__=1.2.4b4 -I/usr/local/Cellar/mysql/5.6.13/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.9-intel-2.7/_mysql.o -Os -g -fno-strict-aliasing This command is obviously malformed. I tracked down the root cause to be the following line of code in _darwin_compiler_fixup method in distutils/unixcompiler.py function: compiler_so = list(compiler_so) Reading the code, this function expects the input parameter 'compiler_so' to be a list, but the actual input in my case was a string. Therefore instead of splitting the words of this sentence, it created a list with each character in the sentence. Changing to the following fixes the problem: compiler_so = compiler_so.split() This seems like a legit bug to me. Any thoughts? Thanks, Sanath
In article <CABU+LKPqL-s34X6FZ7SGjaQ3mpLcg-x9mn=Ya37Sa75rSret9Q@mail.gmail.com>, Sanath Kumar <dayanandasaraswati@gmail.com> wrote:
When compiling MySQL-python module on Mac OSX Mavericks, I executed the command "python setup.py build" and got an error when compiling the C extension. In the output from build command, I see that it has tried running the C compiler with the following command:
/ A p p l i c a t i o n s / X c o d e . a p p / C o n t e n t s / D e v e l o p e r / T o o l c h a i n s / X c o d e D e f a u l t . x c t o o l c h a i n / u s r / b i n / c l a n g - f n o - s t r i c t - a l i a s i n g - f n o - c o m m o n - d y n a m i c - a r c h x 8 6 _ 6 4 - a r c h i 3 8 6 - g - O s - p i p e - f n o - c o m m o n - f n o - s [...]
This appears to be an instance of Issue18071 which was fixed in Python 2.7.6. A workaround is to ensure you have installed the Xcode Command Line Tools; on OS X 10.9, run "xcodebuild --install". http://bugs.python.org/issue18071 -- Ned Deily, nad@acm.org
participants (2)
-
Ned Deily
-
Sanath Kumar