[New-bugs-announce] [issue32627] Header dependent _uuid build failure on Fedora 27

Nick Coghlan report at bugs.python.org
Mon Jan 22 20:54:03 EST 2018


New submission from Nick Coghlan <ncoghlan at gmail.com>:

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.

----------
messages: 310459
nosy: christian.heimes, ncoghlan, vstinner
priority: normal
severity: normal
stage: needs patch
status: open
title: Header dependent _uuid build failure on Fedora 27
type: compile error
versions: Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32627>
_______________________________________


More information about the New-bugs-announce mailing list