Thrift
  1. Thrift
  2. THRIFT-1143

Build doesn't detect correct architecture type on 64bit osx

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 0.5
    • Fix Version/s: 0.8
    • Component/s: Build Process
    • Labels:
    • Environment:

      OSX Snow leopard 64 bit

    • Patch Info:
      Patch Available

      Description

      python setup.py install
      running install
      running build
      running build_py
      running build_ext
      building 'thrift.protocol.fastbinary' extension
      gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c src/protocol/fastbinary.c -o build/temp.macosx-10.6-universal-2.6/src/protocol/fastbinary.o
      /usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
      Installed assemblers are:
      /usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
      /usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
      src/protocol/fastbinary.c:1203: fatal error: error writing to -: Broken pipe
      compilation terminated.
      lipo: can't open input file: /var/folders/t7/t7jaJ7IcGnKFNCMY3G37PU+++TI/Tmp//ccP7p7J0.out (No such file or directory)
      error: command 'gcc-4.2' failed with exit status 1

      To fix:
      export ARCHFLAGS="-arch x86_64"

        Activity

        Hide
        JCF added a comment -

        Apples Xcode4 removes the assembler for PPC, yet most applications where not recompiled against this. Example would be Python

        /usr/bin/python: Mach-O universal binary with 3 architectures
        /usr/bin/python (for architecture x86_64): Mach-O 64-bit executable x86_64
        /usr/bin/python (for architecture i386): Mach-O executable i386
        /usr/bin/python (for architecture ppc7400): Mach-O executable ppc

        Python compiles C extensions with the same compiler flags that Python itself was compiled with. The next version of OS X (Lion) will not have Python built with PPC, which resolves this issue.

        To help avoid this problem in the future the following patch changes the default GOARCH from older amd64 type to x86_64 and modifies the python client makefile to pass GOARCH as an -arch flag to setup.py. Tested on os x and centos.

        Can someone with windows test this please

        Show
        JCF added a comment - Apples Xcode4 removes the assembler for PPC, yet most applications where not recompiled against this. Example would be Python /usr/bin/python: Mach-O universal binary with 3 architectures /usr/bin/python (for architecture x86_64): Mach-O 64-bit executable x86_64 /usr/bin/python (for architecture i386): Mach-O executable i386 /usr/bin/python (for architecture ppc7400): Mach-O executable ppc Python compiles C extensions with the same compiler flags that Python itself was compiled with. The next version of OS X (Lion) will not have Python built with PPC, which resolves this issue. To help avoid this problem in the future the following patch changes the default GOARCH from older amd64 type to x86_64 and modifies the python client makefile to pass GOARCH as an -arch flag to setup.py. Tested on os x and centos. Can someone with windows test this please
        Hide
        Cathy Daw added a comment -

        This issue still exists when installing from the thrift-0.6.0 and thrift-0.6.1 packages.

        The attached patch could not be applied on the 0.6 builds I had.
        The workaround I used was to go to thrift-0.6.1/lib/py and run:
        sudo ARCHFLAGS="-arch x86_64" python setup.py install

        My current environment is:
        MacOSX: 10.6.7
        XCode: 4.0.2
        Python: 2.6.1

        Show
        Cathy Daw added a comment - This issue still exists when installing from the thrift-0.6.0 and thrift-0.6.1 packages. The attached patch could not be applied on the 0.6 builds I had. The workaround I used was to go to thrift-0.6.1/lib/py and run: sudo ARCHFLAGS="-arch x86_64" python setup.py install My current environment is: MacOSX: 10.6.7 XCode: 4.0.2 Python: 2.6.1
        Hide
        Jake Farrell added a comment -

        Cathy this patch is for the current trunk, not 0.6.x branch. It applied successfully against r1099423. Can you please try this with the trunk and let me know if you have any issues

        Show
        Jake Farrell added a comment - Cathy this patch is for the current trunk, not 0.6.x branch. It applied successfully against r1099423. Can you please try this with the trunk and let me know if you have any issues
        Hide
        Jake Farrell added a comment -

        Still a known issue with OS X 10.6, distutils still doesnt have a good solution for this either http://bugs.python.org/issue11623 . ARCHFLAGS="-arch x86_64" flag for OS X users is still the best approach to fix when needed, I dont think attaching to GOARCH as initially patched against is the best approach to solving this.

        Show
        Jake Farrell added a comment - Still a known issue with OS X 10.6, distutils still doesnt have a good solution for this either http://bugs.python.org/issue11623 . ARCHFLAGS="-arch x86_64" flag for OS X users is still the best approach to fix when needed, I dont think attaching to GOARCH as initially patched against is the best approach to solving this.
        Hide
        Jake Farrell added a comment -

        As this is a os issue within OS X which has been resoled with lion having python built against the correct available binaries as shown below I am closing this issue. The work around for this is to include the ARCHGLAGS="-arch x86_64" flag when compiling.

        /usr/bin/python: Mach-O universal binary with 2 architectures
        /usr/bin/python (for architecture x86_64): Mach-O 64-bit executable x86_64
        /usr/bin/python (for architecture i386): Mach-O executable i386

        Show
        Jake Farrell added a comment - As this is a os issue within OS X which has been resoled with lion having python built against the correct available binaries as shown below I am closing this issue. The work around for this is to include the ARCHGLAGS="-arch x86_64" flag when compiling. /usr/bin/python: Mach-O universal binary with 2 architectures /usr/bin/python (for architecture x86_64): Mach-O 64-bit executable x86_64 /usr/bin/python (for architecture i386): Mach-O executable i386

          People

          • Assignee:
            Jake Farrell
            Reporter:
            Jonathan Evans
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development