Bug 229562 - lang/python37: Fails to build when misc/e2fsprogs-libuuid is installed (conflicts with base)
Summary: lang/python37: Fails to build when misc/e2fsprogs-libuuid is installed (confl...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dmitry Marakasov
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2018-07-06 07:45 UTC by Cy Schubert
Modified: 2018-12-31 16:04 UTC (History)
4 users (show)

See Also:
koobs: maintainer-feedback+


Attachments
Patch to ignore ${LOCALBASE}/include/uuid/uuid.h (893 bytes, patch)
2018-07-06 07:45 UTC, Cy Schubert
no flags Details | Diff
additional patch to avoid linking libuuid (139 bytes, patch)
2018-08-18 22:37 UTC, Yasuhito FUTATSUKI
no flags Details | Diff
Simple 2 line solution to disable detection of both includes and libs from e2fsprocs-libuuid (512 bytes, patch)
2018-12-29 14:30 UTC, Dmitry Marakasov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cy Schubert freebsd_committer freebsd_triage 2018-07-06 07:45:09 UTC
Created attachment 194911 [details]
Patch to ignore ${LOCALBASE}/include/uuid/uuid.h

lang/python37 fails to build when misc/e2fsprogs-libuuid is installed.

n file included from /usr/include/uuid.h:36:
/usr/include/sys/uuid.h:80:21: error: typedef redefinition with different types ('struct uuid' vs 'unsigned char [16]')
typedef struct uuid uuid_t;
                    ^
/usr/local/include/uuid/uuid.h:44:23: note: previous definition is here
typedef unsigned char uuid_t[16];
                      ^
In file included from /export/wrkdir/amd64/usr/ports/lang/python37/work/Python-3.7.0/Modules/_uuidmodule.c:8:
/usr/include/uuid.h:51:9: error: conflicting types for 'uuid_compare'
int32_t uuid_compare(const uuid_t *, const uuid_t *, uint32_t *);
        ^
/usr/local/include/uuid/uuid.h:73:5: note: previous declaration is here
int uuid_compare(const uuid_t uu1, const uuid_t uu2);
    ^
2 errors generated.

This is because uuid_t defined in ${LOCALBASE}/include/uuid/uuid.h conflicts with uuid_t defined in /usr/include/sys/uuid.h.
Comment 1 Shane 2018-07-08 09:06:03 UTC
Also of note is that it links to /usr/local/lib/libuuid.so.1 from misc/e2fsprogs-libuuid.

test_uuid.py appears to pass ok.

% python3.7 /usr/local/lib/python3.7/test/test_uuid.py
...ssss...s...ssss...s.........s.............s....
----------------------------------------------------------------------
Ran 50 tests in 5.628s

OK (skipped=12)
Comment 2 rsmith 2018-08-12 20:52:57 UTC
Confirm. I have the same issue.
Comment 3 rsmith 2018-08-12 21:08:43 UTC
Additionally, threads are not optional for Python3.7:

    configure: WARNING: unrecognized options: --with-threads
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2018-08-13 02:31:38 UTC
(In reply to rsmith from comment #3)

Can you create a separate issue for this please
Comment 5 rsmith 2018-08-13 21:59:30 UTC
(In reply to Kubilay Kocak from comment #4)

Done. See bug 230605.
Comment 6 Yasuhito FUTATSUKI 2018-08-18 22:37:43 UTC
Created attachment 196329 [details]
additional patch to avoid linking libuuid

In addition the "Patch to ignore ${LOCALBASE}/include/uuid/uuid.h", to avoid linking libuuid, some modification to setup.py is needed. As far as I've read Modules/_uuidmodule.c and Lib/uuid.py, those aren't use functions in libuuid comes from e2fsprogs-libuuid because it doesn't provide uuid_generate_time_safe().
Comment 7 Yasuhito FUTATSUKI 2018-08-20 00:58:31 UTC
Same issue at upstream (with pull request to fix it)
https://bugs.python.org/issue34366
Comment 8 Dmitry Marakasov freebsd_committer freebsd_triage 2018-12-29 14:29:11 UTC
Yasuhito, it seems like your patch has been eaten by bugzilla, I can't fetch it. I suggest alternative 2 line solution which totally disables detection and usage of both uuid/uuid.h and libuuid.so.

It's a shame this problem was has been lingering for months, I'm gonna treat this as maintainer timeout and commit it this year if there're no objections.
Comment 9 Dmitry Marakasov freebsd_committer freebsd_triage 2018-12-29 14:29:36 UTC
Maintainer timeout.
Comment 10 Dmitry Marakasov freebsd_committer freebsd_triage 2018-12-29 14:30:18 UTC
Created attachment 200603 [details]
Simple 2 line solution to disable detection of both includes and libs from e2fsprocs-libuuid
Comment 11 Dmitry Marakasov freebsd_committer freebsd_triage 2018-12-29 14:32:23 UTC
(In reply to Dmitry Marakasov from comment #10)
> Created attachment 200603 [details]
> Simple 2 line solution to disable detection of both includes and libs from
> e2fsprocs-libuuid

(build succeeds on all supported FreeBSD versions both with and without e2fsprogs-libuuid present; test_uuid.py passes in both cases too; ldd shows that libuuid.so is not linked to _uuid.so).
Comment 12 Yasuhito FUTATSUKI 2018-12-29 16:02:29 UTC
(In reply to Dmitry Marakasov from comment #8)
I have no objection. I'm glad if your patch will be commited. Thanks!
Comment 13 Kubilay Kocak freebsd_committer freebsd_triage 2018-12-30 02:15:37 UTC
@Dmitry The main reason for the delay has been complete analysis of the issue and an understanding/confidence in the best approach to take with a long-term view of resolving the issue permanently (upstream).

Additionally this issue is within a notoriously difficult and challenging class of "base vs local library conflicts" issues who's initial solutions have caused regressions elsewhere (eg: libintl, ssl, elementtree, expat issues in the poast).

Lastly, is this an issue in other Python ports? If so, we want to solve this consistently across the board.

That said, a two line patch to carry locally is fine if has been well QA tested, as it appears to be. Could you please add a comment above the new post-patch lines referencing this issue.
Comment 14 Yasuhito FUTATSUKI 2018-12-30 07:01:02 UTC
(In reply to Kubilay Kocak from comment #13)
> Lastly, is this an issue in other Python ports? If so, we want to solve this consistently across the board.

This is an issue to build _uuid module, which has been introduced in master prior Python 3.7, and not back ported, so it affects only Python >= 3.7.

https://github.com/python/cpython/commit/a106aec2ed6ba171838ca7e6ba43c4e722bbecd1#diff-14e6a94abb7632d46e0716870d57ff4a

https://github.com/python/cpython/pull/3796#issuecomment-338440114

(Please make sure Modules/_uuidmodule.c isn't exists on 3.6, 3.5, 3.4 and 2.7 branches)
Comment 15 commit-hook freebsd_committer freebsd_triage 2018-12-31 16:04:22 UTC
A commit references this bug:

Author: amdmi3
Date: Mon Dec 31 16:03:42 UTC 2018
New revision: 488798
URL: https://svnweb.freebsd.org/changeset/ports/488798

Log:
  - Fix build in presence of e2fsprogs-libuuid

  PR:		229562
  Reported by:	many

Changes:
  head/lang/python37/Makefile