Author ncoghlan
Recipients christian.heimes, ncoghlan, vstinner
Date 2018-01-23.01:54:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1516672443.95.0.467229070634.issue32627@psf.upfronthosting.co.za>
In-reply-to
Content
I'm hitting a build failure relating to the new _uuid module on Fedora 27:

==============
building '_uuid' extension
gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I./Include -I. -I/usr/local/include -I/home/ncoghlan/devel/cpython/Include -I/home/ncoghlan/devel/cpython -c /home/ncoghlan/devel/cpython/Modules/_uuidmodule.c -o build/temp.linux-x86_64-3.7/home/ncoghlan/devel/cpython/Modules/_uuidmodule.o
In file included from /home/ncoghlan/devel/cpython/Modules/_uuidmodule.c:8:0:
/usr/include/uuid.h:94:24: error: conflicting types for ‘uuid_t’
 typedef struct uuid_st uuid_t;
                        ^~~~~~
In file included from /home/ncoghlan/devel/cpython/Modules/_uuidmodule.c:5:0:
/usr/include/uuid/uuid.h:44:23: note: previous declaration of ‘uuid_t’ was here
 typedef unsigned char uuid_t[16];
                       ^~~~~~
In file included from /home/ncoghlan/devel/cpython/Modules/_uuidmodule.c:8:0:
/usr/include/uuid.h:107:22: error: conflicting types for ‘uuid_compare’
 extern uuid_rc_t     uuid_compare  (const uuid_t  *_uuid, const uuid_t *_uuid2, int *_result);
                      ^~~~~~~~~~~~
In file included from /home/ncoghlan/devel/cpython/Modules/_uuidmodule.c:5:0:
/usr/include/uuid/uuid.h:73:12: note: previous declaration of ‘uuid_compare’ was here
 extern int uuid_compare(const uuid_t uu1, const uuid_t uu2);
            ^~~~~~~~~~~~
/home/ncoghlan/devel/cpython/Modules/_uuidmodule.c: In function ‘py_uuid_generate_time_safe’:
/home/ncoghlan/devel/cpython/Modules/_uuidmodule.c:15:12: error: storage size of ‘uuid’ isn’t known
     uuid_t uuid;
            ^~~~
/home/ncoghlan/devel/cpython/Modules/_uuidmodule.c:15:12: warning: unused variable ‘uuid’ [-Wunused-variable]
/home/ncoghlan/devel/cpython/Modules/_uuidmodule.c:29:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
==============

From my initial investigation, I think the issue may be related to my previous attempt to fix this in https://github.com/python/cpython/commit/53efbf3977a44e382397e7994a2524b4f8c9d053#diff-2eeaed663bd0d25b7e608891384b7298 and the fact that there are *two* "uuid.h" headers available in the Fedora repos:

* /usr/include/uuid.h (provided by uuid-devel)
* /usr/include/uuid/uuid.h (provided by libuuid-devel)

Right now, the build works if you have "libuuid-devel" installed, but do *not* have "uuid-devel" installed.

With both installed, neither installed, or only uuid-devel installed, the build will fail, but the exact errors reported will vary. (There's also a distinct set of compile errors you can get if you forget to rerun configure after installing the additional headers)

Reverting my previous commit (and replacing it with a comment saying we're specifically looking for "uuid/uuid.h", not "uuid.h") may be enough to handle the case where both are installed.
History
Date User Action Args
2018-01-23 01:54:04ncoghlansetrecipients: + ncoghlan, vstinner, christian.heimes
2018-01-23 01:54:03ncoghlansetmessageid: <1516672443.95.0.467229070634.issue32627@psf.upfronthosting.co.za>
2018-01-23 01:54:03ncoghlanlinkissue32627 messages
2018-01-23 01:54:00ncoghlancreate