Issues

Issue #41 resolved

install.py always ends up with error

Kentzo
created an issue

When you try to install PyObjC via python install.py, it always fails first time with the following errors (clang):

Modules/_CoreFoundation_inlines.m:7:8: error: unknown type name 'PyObjC_function_map'
static PyObjC_function_map function_map[] = {
       ^
Modules/_CoreFoundation_inlines.m:8:29: error: use of undeclared identifier 'PyObjC_Function_Pointer'
        {"CFByteOrderGetCurrent", (PyObjC_Function_Pointer)&CFByteOrderGetCurrent },
                                   ^
Modules/_CoreFoundation_inlines.m:9:36: error: use of undeclared identifier 'PyObjC_Function_Pointer'
        {"CFConvertDoubleHostToSwapped", (PyObjC_Function_Pointer)&CFConvertDoubleHostToSwapped },
                                          ^
Modules/_CoreFoundation_inlines.m:10:36: error: use of undeclared identifier 'PyObjC_Function_Pointer'
        {"CFConvertDoubleSwappedToHost", (PyObjC_Function_Pointer)&CFConvertDoubleSwappedToHost },
                                          ^
Modules/_CoreFoundation_inlines.m:11:37: error: use of undeclared identifier 'PyObjC_Function_Pointer'
        {"CFConvertFloat32HostToSwapped", (PyObjC_Function_Pointer)&CFConvertFloat32HostToSwapped },
                                           ^
Modules/_CoreFoundation_inlines.m:12:37: error: use of undeclared identifier 'PyObjC_Function_Pointer'
        {"CFConvertFloat32SwappedToHost", (PyObjC_Function_Pointer)&CFConvertFloat32SwappedToHost },
                                           ^
Modules/_CoreFoundation_inlines.m:13:37: error: use of undeclared identifier 'PyObjC_Function_Pointer'
        {"CFConvertFloat64HostToSwapped", (PyObjC_Function_Pointer)&CFConvertFloat64HostToSwapped },
                                           ^
Modules/_CoreFoundation_inlines.m:14:37: error: use of undeclared identifier 'PyObjC_Function_Pointer'
        {"CFConvertFloat64SwappedToHost", (PyObjC_Function_Pointer)&CFConvertFloat64SwappedToHost },
                                           ^
Modules/_CoreFoundation_inlines.m:15:35: error: use of undeclared identifier 'PyObjC_Function_Pointer'
        {"CFConvertFloatHostToSwapped", (PyObjC_Function_Pointer)&CFConvertFloatHostToSwapped },
                                         ^
Modules/_CoreFoundation_inlines.m:16:35: error: use of undeclared identifier 'PyObjC_Function_Pointer'
        {"CFConvertFloatSwappedToHost", (PyObjC_Function_Pointer)&CFConvertFloatSwappedToHost },
                                         ^
Modules/_CoreFoundation_inlines.m:17:19: error: use of undeclared identifier 'PyObjC_Function_Pointer'
        {"CFRangeMake", (PyObjC_Function_Pointer)&CFRangeMake },
                         ^
Modules/_CoreFoundation_inlines.m:18:44: error: use of undeclared identifier 'PyObjC_Function_Pointer'
        {"CFStringGetCharacterFromInlineBuffer", (PyObjC_Function_Pointer)&CFStringGetCharacterFromInlineBuffer },
                                                  ^
Modules/_CoreFoundation_inlines.m:19:32: error: use of undeclared identifier 'PyObjC_Function_Pointer'
        {"CFStringInitInlineBuffer", (PyObjC_Function_Pointer)&CFStringInitInlineBuffer },
                                      ^
Modules/_CoreFoundation_inlines.m:20:19: error: use of undeclared identifier 'PyObjC_Function_Pointer'
        {"CFSwapInt16", (PyObjC_Function_Pointer)&CFSwapInt16 },
                         ^
Modules/_CoreFoundation_inlines.m:21:28: error: use of undeclared identifier 'PyObjC_Function_Pointer'
        {"CFSwapInt16BigToHost", (PyObjC_Function_Pointer)&CFSwapInt16BigToHost },
                                  ^
Modules/_CoreFoundation_inlines.m:22:28: error: use of undeclared identifier 'PyObjC_Function_Pointer'
        {"CFSwapInt16HostToBig", (PyObjC_Function_Pointer)&CFSwapInt16HostToBig },
                                  ^
Modules/_CoreFoundation_inlines.m:23:31: error: use of undeclared identifier 'PyObjC_Function_Pointer'
        {"CFSwapInt16HostToLittle", (PyObjC_Function_Pointer)&CFSwapInt16HostToLittle },
                                     ^
Modules/_CoreFoundation_inlines.m:24:31: error: use of undeclared identifier 'PyObjC_Function_Pointer'
        {"CFSwapInt16LittleToHost", (PyObjC_Function_Pointer)&CFSwapInt16LittleToHost },
                                     ^
Modules/_CoreFoundation_inlines.m:25:19: error: use of undeclared identifier 'PyObjC_Function_Pointer'
        {"CFSwapInt32", (PyObjC_Function_Pointer)&CFSwapInt32 },

However the second build is successful.

Comments (21)

  1. Ronald Oussoren repo owner

    Is distribute or setuptools already present in site-packages when you run into this?

    I just tried reproducing this in a cleanish 2.7 install with distribute in it and that worked without problems. I'm now rerunning the install with an empty site-packages directory.

  2. Ronald Oussoren repo owner

    Could you check if changeset 778d1ba904e8 (tip of the 2.5 branch) still has this problem?

    I removed some old code that shouldn't have been used anyway, but maybe it did get used and causes the problem. You might now also get a message about missing include files in the egg-info file, which would indicate that pyobjc-core didn't get installed properly.

    I still don't understand why there is a compiler error though.

  3. Ronald Oussoren repo owner

    I've finally managed to reproduce this on my main machine by using a fresh clone of the pyobjc repository. Just cleaning up the build/dist directories of an existing clone wasn't good enough.

    The first install for pyobjc-framework-Cocoa now says:

    ... running build_ext Use '/usr/bin/clang' instead of 'clang' as the compiler pyobjc-core egg-info does not include header files Installing 'pyobjc-framework-Cocoa' failed (status 1)

    And indeed, there are no header files in the installed copy of pyobjc-core.

    With a second installation round the header files are installed by pyobjc-core and installation proceeds normally.

    Now that I can easily reproduce the problem it should be a lot easier to fix it.

  4. Ronald Oussoren repo owner

    A lot easier way to reproduce the root cause of this issue:

    • Go to a checkout of pyobjc-core
    • Remove Lib/pyobjc_core.egg-info
    • Run "python setup.py bdist_egg"
    • Check if there are ".h" files in the dist/pyobjc-core....egg file (if there aren't this bug is still present)
  5. bob_tengah

    i'm having this problem as well

    % clang --version
    Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
    Target: x86_64-apple-darwin12.4.0
    Thread model: posix
    % python --version
    Python 2.7.2
    % pip --version 
    pip 1.3.1 from /Users/rbp/Projects/tengahdb/default/lib/python2.7/site-packages (python 2.7)
    
  6. bob_tengah

    an extract:

                        if (PyObjCFFI_FreeByRef(Py_SIZE(signature), byref, byref_attr) < 0) {
                            ~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~
        Modules/objc/pyobjc-compat.h:153:56: note: expanded from macro 'Py_SIZE'
        #define Py_SIZE(ob)             (((PyVarObject*)(ob))->ob_size)
                                         ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
        Modules/objc/block_support.m:316:41: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                        PyObjCFFI_FreeByRef(Py_SIZE(signature)+PyTuple_Size(args), byref, byref_attr);
                        ~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
        Modules/objc/block_support.m:318:23: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
                        PyObjCFFI_FreeByRef(Py_SIZE(signature), byref, byref_attr);
                        ~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~
        Modules/objc/pyobjc-compat.h:153:56: note: expanded from macro 'Py_SIZE'
        #define Py_SIZE(ob)             (((PyVarObject*)(ob))->ob_size)
                                         ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
    
  7. rbpasker

    I am having this problem as well

    (default)rbps-MacBook-Air:test rbp$ clang --version 
    Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
    Target: x86_64-apple-darwin12.4.1
    Thread model: posix
    (default)rbps-MacBook-Air:test rbp$ python --version
    Python 2.7.2
    (default)rbps-MacBook-Air:test rbp$ pip --version 
    pip 1.4 from /Users/rbp/Projects/test/default/lib/python2.7/site-packages (python 2.7)
    (default)rbps-MacBook-Air:test rbp$ which python 
    /Users/rbp/Projects/test/default/bin/python
    (default)rbps-MacBook-Air:test rbp$ 
    
  8. rbpasker

    Here's an extract from my system

        clang: warning: argument unused during compilation: '-mno-fused-madd'
        Modules/objc/selector.m:553:13: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
                        argslen = PyTuple_Size(args);
                                ~ ^~~~~~~~~~~~~~~~~~
        1 warning generated.
        clang: warning: argument unused during compilation: '-mno-fused-madd'
        clang: warning: argument unused during compilation: '-mno-fused-madd'
        Modules/objc/struct-wrapper.m:748:9: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
                        len = PyList_GET_SIZE(keys);
                            ~ ^~~~~~~~~~~~~~~~~~~~~
        /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/listobject.h:63:32: note: expanded from macro 'PyList_GET_SIZE'
        #define PyList_GET_SIZE(op)    Py_SIZE(op)
                                       ^~~~~~~~~~~
        Modules/objc/pyobjc-compat.h:153:56: note: expanded from macro 'Py_SIZE'
        #define Py_SIZE(ob)             (((PyVarObject*)(ob))->ob_size)
                                         ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
        1 warning generated.
        clang: warning: argument unused during compilation: '-mno-fused-madd'
        clang: warning: argument unused during compilation: '-mno-fused-madd'
        clang: warning: argument unused during compilation: '-mno-fused-madd'
        clang: warning: argument unused during compilation: '-mno-fused-madd'
        ld: warning: could not create compact unwind for _ffi_call_unix64: does not use RBP or RSP based frame
        clang: warning: argument unused during compilation: '-mno-fused-madd'
    
  9. Ronald Oussoren repo owner

    All message after the re-open mention build warnings not errors. Furthermore this affects 2.5, and enough has changed in 3.0 that this likely doesn't affect that version.

  10. Log in to comment