Skip to content

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

Closed

Description

@larryhastings
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']

    Activity

    1. larryhastings commented on Feb 7, 2021

      @larryhastings
      ContributorAuthor

      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.

    2. commodo commented on Nov 1, 2021

      commodomannequin
      Mannequin

      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?

    3. tiran commented on Nov 1, 2021

      @tiran
      Member

      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?

    4. added
      3.11only security fixes
      and removed on Nov 1, 2021
    5. 1 remaining item

    6. added
      3.11only security fixes
      and removed on Nov 1, 2021
    7. commodo commented on Nov 1, 2021

      commodomannequin
      Mannequin

      I confirm that this works on OpenWrt :)

      I actually started testing shortly after the PR was created.

      Many thanks for the quick patch.

    8. tiran commented on Nov 2, 2021

      @tiran
      Member

      New changeset 77a1f8d by Christian Heimes in branch 'main':
      bpo-43158: Use configure values for building _uuid extension (GH-29353)
      77a1f8d

    9. tiran commented on Nov 2, 2021

      @tiran
      Member

      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

    10. tiran commented on Nov 2, 2021

      @tiran
      Member

      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

    11. tiran commented on Nov 2, 2021

      @tiran
      Member

      The problem should be fixed now.

    12. tiran commented on Nov 5, 2021

      @tiran
      Member

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

    13. transferred this issue fromon Apr 10, 2022
    14. mathstuf commented on Dec 5, 2024

      @mathstuf

      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.)

      See also this discussion in Homebrew about a similar issue: https://github.com/orgs/Homebrew/discussions/4899

    15. mathstuf commented on Dec 5, 2024

      @mathstuf

      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.

    16. mathstuf commented on Dec 5, 2024

      @mathstuf

      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>.

    17. mathstuf commented on Dec 5, 2024

      @mathstuf

      Bah…there's a patch we apply to make fontconfig happy that breaks Python. I'll go remove that patch and fix fontconfig instead…

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.10 (EOL)end of life3.11only security fixes3.9 (EOL)end of lifebuildThe build process and cross-build

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions