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

Rework uuid module: lazy initialization and add a new C extension #55272

Closed
KeithDart mannequin opened this issue Jan 29, 2011 · 67 comments
Closed

Rework uuid module: lazy initialization and add a new C extension #55272

KeithDart mannequin opened this issue Jan 29, 2011 · 67 comments
Labels
3.7 (EOL) end of life easy performance Performance or resource usage stdlib Python modules in the Lib dir

Comments

@KeithDart
Copy link
Mannequin

KeithDart mannequin commented Jan 29, 2011

BPO 11063
Nosy @ncoghlan, @orsenthil, @pitrou, @vstinner, @tiran, @ned-deily, @merwok, @bitdancer, @methane, @skrah, @ambv, @berkerpeksag, @hynek, @vadmium, @serhiy-storchaka, @aixtools
PRs
  • bpo-11063: Create _uuid1 submodule #3795
  • bpo-11063, bpo-20519: avoid ctypes and improve import time for uuid #3796
  • bpo-5885: fix slow uuid initialization #3684
  • bpo-11063: Fix _uuid module on macOS #3855
  • bpo-11063: Add a configure check for uuid_generate_time_safe #4287
  • bpo-11063: Use more reliable way to detect if it exists #4343
  • bpo-11063: Handle uuid.h being in default include path #4565
  • Files
  • issue11063.patch: Fix issue Rework uuid module: lazy initialization and add a new C extension #55272
  • issue11063_2.patch
  • 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 = <Date 2017-11-08.20:10:08.173>
    created_at = <Date 2011-01-29.17:10:59.772>
    labels = ['easy', '3.7', 'library', 'performance']
    title = 'Rework uuid module: lazy initialization and add a new C extension'
    updated_at = <Date 2017-11-26.03:04:48.497>
    user = 'https://bugs.python.org/KeithDart'

    bugs.python.org fields:

    activity = <Date 2017-11-26.03:04:48.497>
    actor = 'ncoghlan'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-11-08.20:10:08.173>
    closer = 'berker.peksag'
    components = ['Library (Lib)']
    creation = <Date 2011-01-29.17:10:59.772>
    creator = 'Keith.Dart'
    dependencies = []
    files = ['20685', '29220']
    hgrepos = []
    issue_num = 11063
    keywords = ['patch', 'easy']
    message_count = 67.0
    messages = ['127442', '127989', '127998', '128001', '128008', '128010', '128012', '128013', '128015', '128016', '128017', '128018', '128019', '128020', '128021', '178293', '178297', '182778', '182873', '182875', '264151', '264998', '265109', '265122', '265126', '265449', '303202', '303205', '303208', '303209', '303210', '303211', '303212', '303213', '303214', '303215', '303218', '303220', '303228', '303230', '303231', '303234', '303238', '303281', '303284', '303288', '303365', '303406', '303525', '303531', '303532', '303533', '303534', '303539', '303540', '303552', '303555', '305587', '305589', '305635', '305897', '305900', '305904', '305909', '305911', '306984', '306985']
    nosy_count = 23.0
    nosy_names = ['ncoghlan', 'orsenthil', 'kdart', 'pitrou', 'vstinner', 'christian.heimes', 'ned.deily', 'eric.araujo', 'Arfrever', 'r.david.murray', 'methane', 'skrah', 'nvetoshkin', 'lukasz.langa', 'knny-myer', 'nailor', 'Keith.Dart', 'berker.peksag', 'hynek', 'martin.panter', 'serhiy.storchaka', 'Michael.Felt', 'aixtools@gmail.com']
    pr_nums = ['3795', '3796', '3684', '3855', '4287', '4343', '4565']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'resource usage'
    url = 'https://bugs.python.org/issue11063'
    versions = ['Python 3.7']

    @KeithDart
    Copy link
    Mannequin Author

    KeithDart mannequin commented Jan 29, 2011

    When the uuid.py module is simply imported it has the side effect of forking a subprocess (/sbin/ldconfig) and doing a lot of stuff find a uuid implementation by ctypes. This is undesirable in many contexts. It would be better to perform those tasks on demand, when the first UUID is actually requested. In general, imports should avoid unnecessary system call side effects. This also makes testing easier.

    @KeithDart KeithDart mannequin added stdlib Python modules in the Lib dir performance Performance or resource usage labels Jan 29, 2011
    @pitrou pitrou added the easy label Jan 29, 2011
    @nvetoshkin
    Copy link
    Mannequin

    nvetoshkin mannequin commented Feb 5, 2011

    I think launching external tools like ifconfig and ipconfig can be avoided pretty easily. There are many recipes around the net how to use native API's.
    About ctypes' horrible logic during find_library call - don't know yet.

    @knny-myer
    Copy link
    Mannequin

    knny-myer mannequin commented Feb 5, 2011

    With the attached patch the "heavy work" will be done on request, when calling uuid1() or uuid4() not on import.

    I am working off from the py3k svn branch. Is it necessary to submit a separate patch for py2 branch?

    @orsenthil
    Copy link
    Member

    Kenny, I don't see a problem with uuid is *imported*, it just creates a couple of STANDARD UUID class objects for use later. And this seems to just set the number and validates it. I don't see any subprocess calls performed. Perhaps you were referring to scenarios of using uuid1/uuid5 methods in mac and suggesting improvements to it by your patch?

    @bitdancer
    Copy link
    Member

    If you do 'python -c "import uuid" under strace, _posixsubprocess is definitely loaded, and a pipe2 call is made.

    Take a look at the code starting at (py3k trunk) line 418 (try:). That's where the weird stuff happens, which is what the patch is addressing.

    Ken: thanks for working on this.

    @pitrou
    Copy link
    Member

    pitrou commented Feb 5, 2011

    Thanks for posting a patch! I have two comments:

    • Have you run test_uuid? When I run it, it seems to go into an infinite loop somewhere and I need to kill the process.
    • uuid should work even when ctypes is not available, so you can't just put an import statement at the top-level without a fallback

    @nvetoshkin
    Copy link
    Mannequin

    nvetoshkin mannequin commented Feb 5, 2011

    uuid should work even when ctypes is not available
    A bit of offtopic: why can't we assume that ctypes is available?

    @pitrou
    Copy link
    Member

    pitrou commented Feb 5, 2011

    A bit of offtopic: why can't we assume that ctypes is available?

    Because ctypes (or, actually, the libffi it relies on) needs specific low-level code for each platform it runs on, and not all platforms have such code.

    Another reason is that ctypes is dangerous and some administrators might prefer to disable it (especially on shared hosting ala Google App Engine).

    @knny-myer
    Copy link
    Mannequin

    knny-myer mannequin commented Feb 5, 2011

    Thanks for pointing that out! I guess that is the reason you did the import
    in a try block.

    @nvetoshkin
    Copy link
    Mannequin

    nvetoshkin mannequin commented Feb 5, 2011

    Maybe I understood and ctypes ImportError simply must be handled and fallbacked to something else. But there are only 3 ways of getting MAC address:

    1. using popen
    2. using ctypes and native calls
    3. using C API and performing native calls in extension

    And ctypes seems to be the best choice: it's portable across Python VMs (better that 3) and faster (better than 1).

    @pitrou
    Copy link
    Member

    pitrou commented Feb 5, 2011

    Maybe I understood and ctypes ImportError simply must be handled and
    fallbacked to something else.

    Indeed.

    But there are only 3 ways of getting MAC address:

    1. using popen
    2. using ctypes and native calls
    3. using C API and performing native calls in extension

    And ctypes seems to be the best choice: it's portable across Python
    VMs (better that 3) and faster (better than 1).

    Perhaps, but doing without ctypes should still be possible, otherwise
    it's a regression.

    @kdart
    Copy link
    Mannequin

    kdart mannequin commented Feb 5, 2011

    It's also possible using existing wrapped os system calls. One exaple is here: http://code.google.com/p/pycopia/source/browse/trunk/aid/pycopia/ifconfig.py

    Although that one doesn't current support MAC addresses, but it could. The socket module also now support the netlink socket on Linux, so it shouldbe possible to use that for getting MAC address on Linux.

    @nvetoshkin
    Copy link
    Mannequin

    nvetoshkin mannequin commented Feb 5, 2011

    It's also possible using existing wrapped os system calls.
    That's right, on linux we can use ioctls but windows would require win api calls like this one: http://stackoverflow.com/questions/166506/finding-local-ip-addresses-in-python/166992#166992

    @kdart
    Copy link
    Mannequin

    kdart mannequin commented Feb 5, 2011

    I'm thinking Python could use a general purpose ifconfig/mac-layer module that uuid.py could then just use.

    @pitrou
    Copy link
    Member

    pitrou commented Feb 5, 2011

    I'm thinking Python could use a general purpose ifconfig/mac-layer
    module that uuid.py could then just use.

    Perhaps, but that's really out of scope for this issue. Feel free to
    open another issue.

    @hynek
    Copy link
    Member

    hynek commented Dec 27, 2012

    The patch hasn’t incorporated Antoine’s comments AFAICT.

    Also I don’t see this fit for back porting to bug fix releases. Correct me if I’m wrong.

    @tiran
    Copy link
    Member

    tiran commented Dec 27, 2012

    Hynek, you are right.

    @nailor
    Copy link
    Mannequin

    nailor mannequin commented Feb 23, 2013

    The implementation does not actually end up in infinite loop, just repeating the loading of the CDLL is slow.

    I added caching to that and fixed the ctypes imports too.

    @hynek
    Copy link
    Member

    hynek commented Feb 24, 2013

    Jyrki, roundup doesn’t seem to recognize you patch so we can’t review it in Rietveld. Could you re-try, maybe using hg?

    @nailor
    Copy link
    Mannequin

    nailor mannequin commented Feb 24, 2013

    Here's a second take on the patch

    @vadmium
    Copy link
    Member

    vadmium commented Apr 25, 2016

    One thing I am wondering about is why we have to use find_library() at all. Wouldn’t it be more robust, and more efficient, to call CDLL() directly? We just have to know the exactly library version we are expecting. On Linux, the full soname is libuuid.so.1. It seems on OS X it is called libc.dylib (but it would be good for someone else to confirm).

    # The uuid_generate_* routines are provided by libuuid on at least
    # Linux and FreeBSD, and provided by libc on Mac OS X.
    if sys.platform == "darwin":
        libname = "libc.dylib"
    else:
        libname = "libuuid.so.1"
    _ctypes_lib = ctypes.CDLL(libname)

    @aixtools
    Copy link
    Contributor

    aixtools commented May 6, 2016

    I cannot comment on uuid directly, but for me, this is yet another example of how assumptions can break things.

    imho - if you know the exact version of s shared library that you want, calling cdll directly should be find. Maybe find_library is historic.

    However, an advantage to calling find_library is that it should lead to an OSError if it cannot be loaded. But trapping OSError on a call to ctypes.cdll or testing for None (NULL) from find_library() is the option of a developer using the ctypes interface.

    As far as libFOO.so.N - do you always want to assume it is going to be version N, or are you expecting to be able to work work version N+X?
    Again, find_library() can give you the library name it would load - but a programmer must be aware of the platform differences (e.g., AIX returns not a filename, but a libFOO.a(libFOO.so.N) - as just one example.
    p.s. as far as ldconfig being part of the problem on AIX (as it does not exist and can lead to OSError or just long delays, I have worked out a (pending) patch for ctypes/util (and ctypes/cdll) that may address the issues with uuid import on AIX. (see bpo-26439 for the patch)

    @vadmium
    Copy link
    Member

    vadmium commented May 8, 2016

    The versioning problem with libFOO.so.N already occurs with compiled programs. A C program compiled against libuuid.so.1 will fail to load if you only have libuuid.so.2. On the other hand, a Python program using find_library() will find either version. My point about robustness is that if a version 2 is invented, it might have different semantics or function signatures, and Python would then be assuming the wrong semantics.

    @tiran
    Copy link
    Member

    tiran commented May 8, 2016

    It sounds like ctypes is causing you some headache. How about we get rid of ctypes for uuid and replace it with a simple implementation in C instead? Autoconf (configure) can take care of the library detection easily.

    @vadmium
    Copy link
    Member

    vadmium commented May 8, 2016

    There is already bpo-20519 for that, although it looks like the proposed patch keeps ctypes as a fall-back. (My interest here is only theoretical.)

    @aixtoolsgmailcom
    Copy link
    Mannequin

    aixtoolsgmailcom mannequin commented May 13, 2016

    The way I have seen that resolved - in many locations, is to have the
    option to specify a specific version, e.g., libFOO.so.1 and then as long
    as that version remains available, perhaps as read-only for running with
    existing programs,they continue to work even when libFOO.so.2. However,
    for some who believes, or expects, to be able to deal with potential ABI
    changes - they can specify simply libFOO.so and let the loader decide
    (what I see is that libFOO.so is a symbolic link to, or a copy of the
    latest version.)

    So, I agree wholeheartedly, if a versioned number is requested, that, or
    nothing, should be returned. However, if it is generic - try to find a
    generic named library (and get the link or copy), and when that is not
    available either, take the latest versioned number.

    It has been over two months, and I may have read it wrong - but that
    appears to be what the current "ldconfig -p" solution implements. (in
    ctypes, not uuid, so perhaps this is not the correct place to be
    responding. If so, my apologies).

    On 08-May-16 05:24, Martin Panter wrote:

    Martin Panter added the comment:

    The versioning problem with libFOO.so.N already occurs with compiled programs. A C program compiled against libuuid.so.1 will fail to load if you only have libuuid.so.2. On the other hand, a Python program using find_library() will find either version. My point about robustness is that if a version 2 is invented, it might have different semantics or function signatures, and Python would then be assuming the wrong semantics.

    ----------


    Python tracker <report@bugs.python.org>
    <http://bugs.python.org/issue11063\>


    @methane
    Copy link
    Member

    methane commented Sep 28, 2017

    How often uuid1 is used?

    I never use it and it looks uuid1 makes uuid.py complicated.
    How about split it to _uuid1.py (or uuid/init.py and uuid/_uuid1.py)?

    I hope PEP-562 is accepted.
    It ease splitting out (heavy and slow and dirty) part into submodule without breaking backward compatibility.

    Without PEP-562, easy way is making proxy function.

    # uuid/init.py

    def uuid1(node=None, clock_seq=None):
        """Generate a UUID from a host ID, sequence number, and the current time.
        If 'node' is not given, getnode() is used to obtain the hardware
        address.  If 'clock_seq' is given, it is used as the sequence number;
        otherwise a random 14-bit sequence number is chosen."""
        from . import _uuid1 
        return _uuid1.uuid1()

    @vstinner vstinner changed the title uuid.py module import has heavy side effects Rework uuid module: lazy initialization and add a new C extension Sep 28, 2017
    @vstinner
    Copy link
    Member

    I abandonned my PR and started to review Antoine's PR 3796 which basically combines all previous patches proposed last 6 years :-)

    @pitrou
    Copy link
    Member

    pitrou commented Sep 28, 2017

    New changeset a106aec by Antoine Pitrou in branch 'master':
    bpo-11063, bpo-20519: avoid ctypes and improve import time for uuid (bpo-3796)
    a106aec

    @pitrou pitrou closed this as completed Sep 28, 2017
    @vstinner
    Copy link
    Member

    I ran two benchmarks on my Fedora 26.

    git co master
    ./python -m perf timeit -s 'import sys, uuid' "del sys.modules['uuid']; import uuid; uuid = None" --inherit=PYTHONPATH -v -o import_new.json
    ./python -m perf timeit -s 'import uuid; u=uuid.uuid1' "u()" --inherit=PYTHONPATH -v -o uuid1_new.json

    git co 8d59aca
    ./python -m perf timeit -s 'import uuid; u=uuid.uuid1' "u()" --inherit=PYTHONPATH -v -o uuid1_ref.json
    ./python -m perf timeit -s 'import sys, uuid' "del sys.modules['uuid']; import uuid; uuid = None" --inherit=PYTHONPATH -v -o import_ref.json

    Import:

    haypo@selma$ ./python -m perf compare_to import_ref.json import_new.json --table
    +-----------+------------+-----------------------------+
    | Benchmark | import_ref | import_new |
    +===========+============+=============================+
    | timeit | 4.04 ms | 430 us: 9.39x faster (-89%) |
    +-----------+------------+-----------------------------+

    uuid.uuid1():

    haypo@selma$ ./python -m perf compare_to uuid1_ref.json uuid1_new.json --table
    +-----------+-----------+------------------------------+
    | Benchmark | uuid1_ref | uuid1_new |
    +===========+===========+==============================+
    | timeit | 18.9 us | 15.2 us: 1.24x faster (-20%) |
    +-----------+-----------+------------------------------+

    Everything is faster. The import time is 9.4x faster, nice!

    In practice, the import time is probably even better. My benchmark uses repeated import, it doesn't measure the "first time" import which was more expensive because of the "import ctypes".

    @pitrou
    Copy link
    Member

    pitrou commented Sep 28, 2017

    Crude import benchmark (Ubuntu):

    • before:
    $ time ./python -c "import uuid"

    real 0m0.074s
    user 0m0.056s
    sys 0m0.012s

    • after:
    $ time ./python -c "import uuid"

    real 0m0.030s
    user 0m0.028s
    sys 0m0.000s

    • baseline:
    $ time ./python -c pass

    real 0m0.027s
    user 0m0.024s
    sys 0m0.000s

    @ambv
    Copy link
    Contributor

    ambv commented Sep 29, 2017

    uuid fails to build for me on master since that change landed:

    cpython/Modules/_uuidmodule.c:13:11: error: implicit declaration of function 'uuid_generate_time_safe' is invalid in C99
    [-Werror,-Wimplicit-function-declaration]
    res = uuid_generate_time_safe(out);
    ^
    cpython/Modules/_uuidmodule.c:13:11: note: did you mean 'py_uuid_generate_time_safe'?
    cpython/Modules/_uuidmodule.c:8:1: note: 'py_uuid_generate_time_safe' declared here
    py_uuid_generate_time_safe(void)
    ^
    cpython/Modules/_uuidmodule.c:13:11: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    res = uuid_generate_time_safe(out);
    ^
    1 warning and 1 error generated.

    This is on macOS Sierra.

    @pitrou
    Copy link
    Member

    pitrou commented Sep 30, 2017

    It's expected if uuid_generate_time_safe() isn't available on your platform. But test_uuid still passes?

    @vstinner
    Copy link
    Member

    vstinner commented Oct 2, 2017

    It's expected if uuid_generate_time_safe() isn't available on your platform. But test_uuid still passes?

    I would prefer to avoid compilation errors on a popular platforms like macOS. Would it possible to check if uuid_generate_time_safe() is available, maybe in configure? Or we can "simply" skip _uuid compilation on macOS?

    @vstinner vstinner reopened this Oct 2, 2017
    @pitrou
    Copy link
    Member

    pitrou commented Oct 2, 2017

    Would it possible to check if uuid_generate_time_safe() is available, maybe in configure?

    That's probably possible.

    @pitrou
    Copy link
    Member

    pitrou commented Oct 2, 2017

    Though I don't know how to reuse the find_file() logic in configure...

    @vstinner
    Copy link
    Member

    vstinner commented Oct 2, 2017

    Though I don't know how to reuse the find_file() logic in configure...

    Maybe we could use pkg-config instead?

    haypo@selma$ pkg-config uuid --cflags
    -I/usr/include/uuid
    haypo@selma$ pkg-config uuid --libs
    -luuid

    @pitrou
    Copy link
    Member

    pitrou commented Oct 2, 2017

    pkg-config is a Linux-ism. But Linux already works fine...

    $ uname 
    Darwin
    $ pkg-config
    -bash: pkg-config: command not found

    @vstinner
    Copy link
    Member

    vstinner commented Oct 2, 2017

    I proposed PR 3855 to add macOS support to _uuid (and fix the compilation error).

    @vstinner
    Copy link
    Member

    vstinner commented Oct 2, 2017

    New changeset 4337a0d by Victor Stinner in branch 'master':
    bpo-11063: Fix _uuid module on macOS (bpo-3855)
    4337a0d

    @ned-deily
    Copy link
    Member

    I agree with Barry's comment on PR 3855: "I'd rather see a configure check for the existence of uuid_generate_time_safe() rather than hard coding it to platforms !APPLE for two reasons. 1) If macOS ever adds this API in some future release, this ifndef will be incorrect, and 2) if some other platform comes along that doesn't have this API, it will still use the incorrect function." It's exactly for situations like this that autoconf tests exist; we should not be hardwiring assumptions about the lack of particular platform APIs.

    @skrah
    Copy link
    Mannequin

    skrah mannequin commented Oct 2, 2017

    I think the configure check should be this (sets HAVE_LIBUUID in pyconfig.h):

    diff --git a/configure.ac b/configure.ac
    index 41bd9effbf..90d53c1b7d 100644
    --- a/configure.ac
    +++ b/configure.ac
    @@ -2657,6 +2657,7 @@ AC_MSG_RESULT($SHLIBS)
     AC_CHECK_LIB(sendfile, sendfile)
     AC_CHECK_LIB(dl, dlopen)       # Dynamic linking for SunOS/Solaris and SYSV
     AC_CHECK_LIB(dld, shl_load)    # Dynamic linking for HP-UX
    +AC_CHECK_LIB(uuid, uuid_generate_time_safe)
     
     # only check for sem_init if thread support is requested
     if test "$with_threads" = "yes" -o -z "$with_threads"; then

    @berkerpeksag
    Copy link
    Member

    I've followed Stefan's suggestion and opened PR 4287 (tested on 10.10.5)

    @skrah
    Copy link
    Mannequin

    skrah mannequin commented Nov 5, 2017

    Berker's latest patch looks good to me.

    Unrelated to the patch (same before and after), this looks odd to me:

    >>> import uuid
    >>> uuid._has_uuid_generate_time_safe is None
    True
    >>> 
    >>> import _uuid
    >>> _uuid.has_uuid_generate_time_safe
    1

    [Also, I thought we weren't supposed to use ctypes in the stdlib.]

    @vstinner
    Copy link
    Member

    vstinner commented Nov 6, 2017

    """

    Unrelated to the patch (same before and after), this looks odd to me:

    >>> import uuid
    >>> uuid._has_uuid_generate_time_safe is None
    True
    >>> 
    >>> import _uuid
    >>> _uuid.has_uuid_generate_time_safe
    1
    """

    None means "not initialized yet". It's initialized on demand, at the first call of uuid1() or get_node():

    $ python3
    Python 3.7.0a2+ (heads/master:a5293b4ff2, Nov  6 2017, 12:22:04) 
    >>> import uuid
    >>> uuid._has_uuid_generate_time_safe  # == None
    >>> uuid.uuid1()
    UUID('3e5a7628-c2e5-11e7-adc1-3ca9f4650c0c')
    >>> uuid._has_uuid_generate_time_safe
    1

    [Also, I thought we weren't supposed to use ctypes in the stdlib.]

    Antoine's commit a106aec avoids ctypes when libuuid is available.

    For the other systems without libuuid, well, it was probably simpler to use ctypes. ctypes was more popular a few years ago. The code "just works" and I guess that nobody wants to touch it :-)

    @berkerpeksag
    Copy link
    Member

    New changeset 9a10ff4 by Berker Peksag in branch 'master':
    bpo-11063: Add a configure check for uuid_generate_time_safe (GH-4287)
    9a10ff4

    @serhiy-storchaka
    Copy link
    Member

    Does this check work? I tried similar checks with other functions and they were falsely passed because calling an undeclared function is not an error in C.

    The reliable check of the existence of the uuid_generate_time_safe function is:

    void *x = uuid_generate_time_safe
    

    @skrah
    Copy link
    Mannequin

    skrah mannequin commented Nov 8, 2017

    On Wed, Nov 08, 2017 at 08:28:10PM +0000, Serhiy Storchaka wrote:

    Does this check work? I tried similar checks with other functions and they were falsely passed because calling an undeclared function is not an error in C.

    Not here. If I replace uuid_generate_time_safe with a non-existing function
    name, it is still found:

    checking for uuid_generate_time_unsafe... yes

    The originally suggested AC_CHECK_LIB macro however works here in both cases. :)

    @berkerpeksag
    Copy link
    Member

    It worked for me on OS X (returns no) and Linux (returns yes after I installed uuid-dev) but I didn't test it on both systems at the same. Travis CI also returned 'no': https://travis-ci.org/python/cpython/jobs/299285001

    In any case, Serhiy's suggestion is better than mine so I've opened PR 4343.

    And yes, I'm beginning to regret my decision on not using AC_CHECK_LIB :)

    @berkerpeksag
    Copy link
    Member

    New changeset 0e163d2 by Berker Peksag in branch 'master':
    bpo-11063: Use more reliable way to check if uuid function exists (GH-4343)
    0e163d2

    @ncoghlan
    Copy link
    Contributor

    The header file check in setup.py incorrectly reported "not found" if uuid.h was in one of the standard include directories, so I've submitted a tweak to fix that: #4565

    @ncoghlan
    Copy link
    Contributor

    New changeset 53efbf3 by Nick Coghlan in branch 'master':
    bpo-11063: Handle uuid.h being in default include path (GH-4565)
    53efbf3

    @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.7 (EOL) end of life easy performance Performance or resource usage stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests