[New-bugs-announce] [issue34366] _uuid module fails to compile on FreeBSD when libuuid is installed

Michał Górny report at bugs.python.org
Thu Aug 9 02:48:30 EDT 2018

New submission from Michał Górny <mgorny at gentoo.org>:

The _uuid extension fails to build on my Gentoo/FreeBSD system:

building '_uuid' extension
x86_64-gentoo-freebsd11.1-gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -pipe -march=native -fwrapv -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I./Include -I. -I/var/tmp/portage/dev-lang/python-3.7.0/work/Python-3.7.0/Include -I/var/tmp/portage/dev-lang/python-3.7.0/work/Python-3.7.0 -c /var/tmp/portage/dev-lang/python-3.7.0/work/Python-3.7.0/Modules/_uuidmodule.c -o build/temp.freebsd-11.1-RELEASE-amd64-3.7/var/tmp/portage/dev-lang/python-3.7.0/work/Python-3.7.0/Modules/_uuidmodule.o
In file included from /usr/include/uuid.h:34:0,
                 from /var/tmp/portage/dev-lang/python-3.7.0/work/Python-3.7.0/Modules/_uuidmodule.c:8:
/usr/include/sys/uuid.h:77:21: error: conflicting types for 'uuid_t'
 typedef struct uuid uuid_t;
In file included from /var/tmp/portage/dev-lang/python-3.7.0/work/Python-3.7.0/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];

Apparently the cause is that it includes headers belonging to the system uuid library and libuuid (from util-linux) simultaneously.  The whole module seems to be written with the assumption that the two different implementations will not be present simultaneously.  However, some software supports libuuid only, so we're forced to have both.

Attaching the complete build log.  I will submit a PR soonish.

components: Extension Modules
files: dev-lang:python-3.7.0:20180809-062928.log
messages: 323317
nosy: mgorny
priority: normal
severity: normal
status: open
title: _uuid module fails to compile on FreeBSD when libuuid is installed
type: compile error
versions: Python 3.7, Python 3.8
Added file: https://bugs.python.org/file47735/dev-lang:python-3.7.0:20180809-062928.log

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list