Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uuid won't build when libuuid is installed in a non-standard place #87324

Closed
larryhastings opened this issue Feb 7, 2021 · 9 comments
Closed
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes build The build process and cross-build

Comments

@larryhastings
Copy link
Contributor

BPO 43158
Nosy @larryhastings, @tiran, @commodo, @miss-islington
PRs
  • bpo-43158: Use configure values for building _uuid extension (GH-29353) #29353
  • [3.10] bpo-43158: Use configure values for building _uuid extension (GH-29353) (GH-29362) #29362
  • [3.9] bpo-43158: Use configure values for building _uuid extension (GH-29353) (GH-29363) #29363
  • bpo-43158: Regenerate configure again (GH-29433) #29433
  • 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 = None
    closed_at = None
    created_at = <Date 2021-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 = <Date 2021-11-05.20:51:34.333>
    user = 'https://github.com/larryhastings'

    bugs.python.org fields:

    activity = <Date 2021-11-05.20:51:34.333>
    actor = 'christian.heimes'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Build']
    creation = <Date 2021-02-07.20:44:19.872>
    creator = 'larry'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 43158
    keywords = ['patch']
    message_count = 9.0
    messages = ['386607', '405424', '405433', '405435', '405503', '405505', '405506', '405507', '405829']
    nosy_count = 4.0
    nosy_names = ['larry', 'christian.heimes', 'Alexandru Ardelean', 'miss-islington']
    pr_nums = ['29353', '29362', '29363', '29433']
    priority = 'low'
    resolution = None
    stage = 'commit review'
    status = 'open'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue43158'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    @larryhastings
    Copy link
    Contributor Author

    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.

    @larryhastings larryhastings added 3.7 (EOL) end of life 3.8 only security fixes 3.10 only security fixes 3.9 only security fixes build The build process and cross-build labels Feb 7, 2021
    @commodo
    Copy link
    Mannequin

    commodo mannequin commented 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
    Copy link
    Member

    tiran commented 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?

    @tiran tiran added 3.11 only security fixes and removed 3.7 (EOL) end of life 3.8 only security fixes labels Nov 1, 2021
    @commodo
    Copy link
    Mannequin

    commodo mannequin commented 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
    Copy link
    Member

    tiran commented 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
    Copy link
    Member

    tiran commented 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
    Copy link
    Member

    tiran commented 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
    Copy link
    Member

    tiran commented Nov 2, 2021

    The problem should be fixed now.

    @tiran
    Copy link
    Member

    tiran commented Nov 5, 2021

    New changeset 9b0f45c by Christian Heimes in branch 'main':
    bpo-43158: Regenerate configure again (GH-29433)
    9b0f45c

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes 3.10 only security fixes 3.11 only security fixes build The build process and cross-build
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants