Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure due to GOOD/BAD compiler definition conflicts #3238

Open
ThePrez opened this issue Nov 18, 2019 · 1 comment · May be fixed by #3241
Open

Build failure due to GOOD/BAD compiler definition conflicts #3238

ThePrez opened this issue Nov 18, 2019 · 1 comment · May be fixed by #3241

Comments

@ThePrez
Copy link

@ThePrez ThePrez commented Nov 18, 2019

Trying to install uvloop on the IBM i platform (working with @NielsLiisberg), but it fails with the following

gcc -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -fPIC -I/QOpenSys/pkgs/include/python3.6m -Ivendor/libuv/include -c uvloop/loop.c -o build/temp.os400-powerpc64-3.6/uvloop/loop.o -O2
uvloop/loop.c: In function '__Pyx_setup_reduce':
uvloop/loop.c:166860:74: error: expected identifier or '*' before numeric constant
     if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
                                                                          ^
uvloop/loop.c:166865:108: error: expected identifier or '*' before '(' token
     object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
                                                                                                            ^
uvloop/loop.c:166869:105: error: expected identifier or '*' before '(' token
     reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
                                                                                                         ^
uvloop/loop.c:166872:103: error: expected identifier or '*' before '(' token
         object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
                                                                                                       ^
uvloop/loop.c:166876:100: error: expected identifier or '*' before '(' token
         reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
                                                                                                    ^
uvloop/loop.c:166878:125: error: expected identifier or '*' before '(' token
             reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
                                                                                                                             ^
uvloop/loop.c:166879:131: error: expected identifier or '*' before '(' token
             ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
                                                                                                                                   ^
uvloop/loop.c:166880:123: error: expected identifier or '*' before '(' token
             ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
                                                                                                                           ^
uvloop/loop.c:166884:135: error: expected identifier or '*' before '(' token
                 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
                                                                                                                                       ^
uvloop/loop.c:166885:139: error: expected identifier or '*' before '(' token
                 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
                                                                                                                                           ^
uvloop/loop.c:166886:129: error: expected identifier or '*' before '(' token
                 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
                                                                                                                                 ^
uvloop/loop.c:166891:9: error: expected identifier or '*' before numeric constant
     goto GOOD;
         ^
uvloop/loop.c:166892:3: error: expected ';' before ':' token
 BAD:
   ^
uvloop/loop.c:166896:4: error: expected ';' before ':' token
 GOOD:
    ^

As it turns out, in this compilation environment, GOOD and BAD are already defined (probably in sys/params.h, included from other places).
If I simply change the label names to lowercase, all is good. This seems to be coming from Utility/ExtensionTypes.c

The solution is simply to use lowercase labels as in some other parts, I believe. If no objection, we can send a PR for it.

@robertwb

This comment has been minimized.

Copy link
Contributor

@robertwb robertwb commented Nov 19, 2019

Good catch. Rather than just using lowercase (which could also conflict with some other library), could use add a __PYX_ prefix?

@ThePrez ThePrez linked a pull request that will close this issue Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.