This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: uuid won't build when libuuid is installed in a non-standard place
Type: compile error Stage: commit review
Components: Build Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Alexandru Ardelean, christian.heimes, larry, miss-islington
Priority: low Keywords: patch

Created on 2021-02-07 20:44 by larry, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 29353 merged christian.heimes, 2021-11-01 11:53
PR 29362 merged miss-islington, 2021-11-02 11:25
PR 29363 merged miss-islington, 2021-11-02 11:25
PR 29433 merged christian.heimes, 2021-11-05 19:44
Messages (9)
msg386607 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2021-02-07 20:44
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.
msg405424 - (view) Author: Alexandru Ardelean (Alexandru Ardelean) * Date: 2021-11-01 10:12
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?
msg405433 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-11-01 12:00
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?
msg405435 - (view) Author: Alexandru Ardelean (Alexandru Ardelean) * Date: 2021-11-01 12:08
I confirm that this works on OpenWrt :)

I actually started testing shortly after the PR was created.

Many thanks for the quick patch.
msg405503 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-11-02 11:25
New changeset 77a1f8d94c29da7bda4bd43e5a9c2233573d46ee by Christian Heimes in branch 'main':
bpo-43158: Use configure values for building _uuid extension (GH-29353)
https://github.com/python/cpython/commit/77a1f8d94c29da7bda4bd43e5a9c2233573d46ee
msg405505 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-11-02 11:49
New changeset b71bc052454803aa8bd3e7edd2044e2d5e962243 by Miss Islington (bot) in branch '3.10':
[3.10] bpo-43158: Use configure values for building _uuid extension (GH-29353) (GH-29362)
https://github.com/python/cpython/commit/b71bc052454803aa8bd3e7edd2044e2d5e962243
msg405506 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-11-02 11:52
New changeset 91a51c5ffc3bd9da28a0000550530f6f2bcc25a2 by Miss Islington (bot) in branch '3.9':
[3.9] bpo-43158: Use configure values for building _uuid extension (GH-29353) (GH-29363)
https://github.com/python/cpython/commit/91a51c5ffc3bd9da28a0000550530f6f2bcc25a2
msg405507 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-11-02 11:53
The problem should be fixed now.
msg405829 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-11-05 20:51
New changeset 9b0f45c069863517a24239da301a1bf1697ac2e7 by Christian Heimes in branch 'main':
bpo-43158: Regenerate configure again (GH-29433)
https://github.com/python/cpython/commit/9b0f45c069863517a24239da301a1bf1697ac2e7
History
Date User Action Args
2022-04-11 14:59:41adminsetgithub: 87324
2021-11-05 20:51:34christian.heimessetmessages: + msg405829
2021-11-05 19:44:31christian.heimessetstatus: pending -> open
pull_requests: + pull_request27687
2021-11-02 11:53:11christian.heimessetstatus: open -> pending

messages: + msg405507
stage: patch review -> commit review
2021-11-02 11:52:46christian.heimessetmessages: + msg405506
2021-11-02 11:49:41christian.heimessetmessages: + msg405505
2021-11-02 11:25:28miss-islingtonsetpull_requests: + pull_request27623
2021-11-02 11:25:22miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request27622
2021-11-02 11:25:17christian.heimessetmessages: + msg405503
2021-11-01 12:08:45Alexandru Ardeleansetmessages: + msg405435
2021-11-01 12:00:28christian.heimessetmessages: + msg405433
versions: + Python 3.11, - Python 3.6, Python 3.7, Python 3.8
2021-11-01 11:53:26christian.heimessetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request27614
2021-11-01 10:12:29Alexandru Ardeleansetnosy: + christian.heimes, Alexandru Ardelean
messages: + msg405424
2021-02-07 20:44:19larrycreate