You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
uuid won't build when libuuid is installed in a non-standard place #87324
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2021-02-07.20:44:19.872>labels= ['build', '3.9', '3.10', '3.11']
title="uuid won't build when libuuid is installed in a non-standard place"updated_at=<Date2021-11-05.20:51:34.333>user='https://github.com/larryhastings'
I'm building Python for a mildly-embedded ARM system. The system is running Linux, but doesn't have a native toolchain installed. So I'm building in a Docker container using a native toolchain (virtualizing the CPU).
The toolchain I'm given has a bunch of stuff preinstalled, but not "util-linux", so it doesn't have /usr/include/uuid/uuid.h or /usr/include/uuid.h . I built and installed it myself in my PREFIX directory. But Python's build process has *two* bugs that prevented me from building the uuid module:
configure doesn't look in PREFIX for uuid/uuid.h or uuid.h. I assume it's only looking in /usr/include. This means it doesn't define any of the HAVE_UUID_* defines.
detect_uuid() in setup.py, which actually builds the module, *does* seem to check the prefix directory, but only for $PREFIX/uuid.h, not for $PREFIX/uuid/uuid.h.
I hacked both of these manually and was rewarded with the uuid module building and working fine on the embedded system. So I assert this is a bug in Python's build process, if a minor one.
I am porting this patch to OpenWrt.
And it seems to work as well.
I'd like to know how to proceed with this patch and submit it upstream.
I did not author this patch, so it may be tricky.
We may need to contact the original author?
Or would it be fine for me to open a PR and mention the original source/author?
I have created a PR that adds a check for libuuid to configure and then uses configure variables in setup.py. Could you please try the patch in your build system?
New changeset b71bc05 by Miss Islington (bot) in branch '3.10':
[3.10] bpo-43158: Use configure values for building _uuid extension (GH-29353) (GH-29362) b71bc05
New changeset 91a51c5 by Miss Islington (bot) in branch '3.9':
[3.9] bpo-43158: Use configure values for building _uuid extension (GH-29353) (GH-29363) 91a51c5
I'm seeing this issue again with Python 3.12. I have util-linux installed and can see the header, but its include directory is not added for <uuid.h> to work. Did this get reverted/removed in some way since the fix? (I've not tested 3.11, but 3.10 worked.)
Looking at the command line, it doesn't even try to add the include directory for <uuid/uuid.h> to work. I feel like something got dropped somewhere… Sorry, got the wrong command line due to the parallel build. It does have the include directory for <uuid/uuid.h> to work.
It looks like the configure logic is wrong in that uuid.pc makes <uuid/uuid.h> to work but Python's configure seems to think that finding the package lets it do <uuid.h>.
Activity
larryhastings commentedon Feb 7, 2021
I'm building Python for a mildly-embedded ARM system. The system is running Linux, but doesn't have a native toolchain installed. So I'm building in a Docker container using a native toolchain (virtualizing the CPU).
The toolchain I'm given has a bunch of stuff preinstalled, but not "util-linux", so it doesn't have /usr/include/uuid/uuid.h or /usr/include/uuid.h . I built and installed it myself in my PREFIX directory. But Python's build process has *two* bugs that prevented me from building the uuid module:
configure doesn't look in PREFIX for uuid/uuid.h or uuid.h. I assume it's only looking in /usr/include. This means it doesn't define any of the HAVE_UUID_* defines.
detect_uuid() in setup.py, which actually builds the module, *does* seem to check the prefix directory, but only for $PREFIX/uuid.h, not for $PREFIX/uuid/uuid.h.
I hacked both of these manually and was rewarded with the uuid module building and working fine on the embedded system. So I assert this is a bug in Python's build process, if a minor one.
commodo commentedon Nov 1, 2021
I've added Christian Heimes to this, mostly to help us get this further.
(i.e. to refer someone else here, that can help).
So, there is a fix for this in Buildroot's tree:
https://github.com/buildroot/buildroot/blob/76c7fed85f7a822663cf0c8828e7d282198d0803/package/python3/0030-Fix-cross-compiling-the-uuid-module.patch
I am porting this patch to OpenWrt.
And it seems to work as well.
I'd like to know how to proceed with this patch and submit it upstream.
I did not author this patch, so it may be tricky.
We may need to contact the original author?
Or would it be fine for me to open a PR and mention the original source/author?
tiran commentedon Nov 1, 2021
I have created a PR that adds a check for libuuid to configure and then uses configure variables in setup.py. Could you please try the patch in your build system?
1 remaining item
commodo commentedon Nov 1, 2021
I confirm that this works on OpenWrt :)
I actually started testing shortly after the PR was created.
Many thanks for the quick patch.
tiran commentedon Nov 2, 2021
New changeset 77a1f8d by Christian Heimes in branch 'main':
bpo-43158: Use configure values for building _uuid extension (GH-29353)
77a1f8d
tiran commentedon Nov 2, 2021
New changeset b71bc05 by Miss Islington (bot) in branch '3.10':
[3.10] bpo-43158: Use configure values for building _uuid extension (GH-29353) (GH-29362)
b71bc05
tiran commentedon Nov 2, 2021
New changeset 91a51c5 by Miss Islington (bot) in branch '3.9':
[3.9] bpo-43158: Use configure values for building _uuid extension (GH-29353) (GH-29363)
91a51c5
tiran commentedon Nov 2, 2021
The problem should be fixed now.
tiran commentedon Nov 5, 2021
New changeset 9b0f45c by Christian Heimes in branch 'main':
bpo-43158: Regenerate configure again (GH-29433)
9b0f45c
mathstuf commentedon Dec 5, 2024
I'm seeing this issue again with Python 3.12. I have
util-linuxinstalled and can see the header, but its include directory is not added for<uuid.h>to work. Did this get reverted/removed in some way since the fix? (I've not tested 3.11, but 3.10 worked.)See also this discussion in Homebrew about a similar issue: https://github.com/orgs/Homebrew/discussions/4899
mathstuf commentedon Dec 5, 2024
Looking at the command line, it doesn't even try to add the include directory forSorry, got the wrong command line due to the parallel build. It does have the include directory for<uuid/uuid.h>to work. I feel like something got dropped somewhere…<uuid/uuid.h>to work.mathstuf commentedon Dec 5, 2024
It looks like the configure logic is wrong in that
uuid.pcmakes<uuid/uuid.h>to work but Python's configure seems to think that finding the package lets it do<uuid.h>.mathstuf commentedon Dec 5, 2024
Bah…there's a patch we apply to make
fontconfighappy that breaks Python. I'll go remove that patch and fixfontconfiginstead…