Date: Mon, 28 Jan 2019 23:36:57 +0100 From: Stefan Metzmacher <metze@samba.org> To: koobs@FreeBSD.org, python@FreeBSD.org Subject: Re: Problem with pyconfig.h in python36 which is already solved for python27 Message-ID: <95248089-6874-24cd-76fa-2af24063988b@samba.org> In-Reply-To: <da878a4c-e6de-ca4b-c5d2-a5058b6198d7@FreeBSD.org> References: <e6e7ef63-6c72-ec5c-f6d6-bc1fa5d9b604@samba.org> <da878a4c-e6de-ca4b-c5d2-a5058b6198d7@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ZW0g1xMVoJhPwerUVQjdjQfZcRHidaZkw Content-Type: multipart/mixed; boundary="QotP6DKccGvvg19M4dluZEKQs1E1j9VYs"; protected-headers="v1" From: Stefan Metzmacher <metze@samba.org> To: koobs@FreeBSD.org, python@FreeBSD.org Message-ID: <95248089-6874-24cd-76fa-2af24063988b@samba.org> Subject: Re: Problem with pyconfig.h in python36 which is already solved for python27 References: <e6e7ef63-6c72-ec5c-f6d6-bc1fa5d9b604@samba.org> <da878a4c-e6de-ca4b-c5d2-a5058b6198d7@FreeBSD.org> In-Reply-To: <da878a4c-e6de-ca4b-c5d2-a5058b6198d7@FreeBSD.org> --QotP6DKccGvvg19M4dluZEKQs1E1j9VYs Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi koobs, >> in Samba we recently switched to use python3 by default. But this brea= ks >> the build on FreeBSD (at least 11.1 and 12.0). In order to be most >> portable, we have a policy in Samba to include <Python.h> as the >> first header when creating python bindings. It means pyconfig.h and >> various system headers are included before our own config.h. >> A detailed way to reproduce this can be found at the end of this mail.= >> >> The problem is that pyconfig.h defines >> _POSIX_C_SOURCE, __BSD_VISIBLE, _XOPEN_SOURCE and _XOPEN_SOURCE_EXTEND= ED. >> >> This seems to be fixed for python27 in this commit: >> https://github.com/freebsd/freebsd-ports/commit/4b17dd9aeb9b28759551f3= 8bf0f6b0edcac88607 >> >> which added lang/python27/files/patch-pr192365. >> >> Could this be fixed for all python versions? >=20 > Hi Stefan, >=20 > The commit was added via: >=20 > x11-toolkits/py-wxPython30 build fails > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D192365 >=20 > A similar issue (if not the same), reported upstream here: >=20 > https://bugs.python.org/issue17120 >=20 > I don't see any issues with carrying the same change in other python > ports, *but* we'd all like to see it resolved permanently upstream. >=20 > In order of preference, to progress we'd need: >=20 > 1) Upstream patches submitted against master, 3.7, 3.6, 2.7 so upstream= > can resolve this completely, commits/merges from which we can backport > to our python ports. >=20 > or >=20 > 2) Patches against lang/pythonXY ports similar to python27, which may > not be suitable for upstreaming *as is* (freebsd-specific?) >=20 > Along with either of those, create a new bug in Bugzilla to track this > too, with summary like "lang/python3*: <summary of issue>" adding bug > 192365 to "See Also" >=20 > I'm happy to put in the cycles to backport commits from (1) if we can > get the root of the issue solved upstream. >=20 > Thanks for the detailed report. Thanks for the hints. I the meantime I noticed https://en.cppreference.com/w/c/string/byte/memset which states that __STDC_WANT_LIB_EXT1__ should be explicitly defined in order to get memset_s(). I'm going to fix Samba by using -D__STDC_WANT_LIB_EXT1__=3D1 instead of defining it in Samba's lib/replace/replace.h. That means __STDC_WANT_LIB_EXT1__ is also defined if Python.h is the first header. Thanks! metze --QotP6DKccGvvg19M4dluZEKQs1E1j9VYs-- --ZW0g1xMVoJhPwerUVQjdjQfZcRHidaZkw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEfFbGo3YXpfgryIw9DbX1YShpvVYFAlxPhAkACgkQDbX1YShp vVYVVxAAsyMvpRjbXyot8gQNNDDYewmEBLhIqi19dWcxlgRDD5/YmRY++eGWyYup 5JLo6Z0QASLMInrhh4PkoDe//f8xtdzjbmHWQN/N1tOYrAtd4VXsXwJ2OtIsBHYu cFf8ZibJUO2rtemGHJ9lCFr5uywkSeX0CvKF2vMrVZ8q05FnVHZwQq064HuGt82l /5QVopnVpxe8Mbjp0RVDWwKNWFSyoki87DG7tckmkZhA33nKLOIp7wTM/bFEWEDE E5TrB70PEMobc+C9VNq+RAWPDR+awg+RTJY9cCZrKrxplsL65hb1fuhhOzLAllYE vdKtKb8EmqY856Hx3VeXlC6dx6gKKjMdoQjNbtwwjbxMmGWfInHCaMWeGZGuZ3oJ OOfHGY/pollSzuzCphRgxAy12vr5REpV2XNnFbYMhg/g/2ODkbECWuh4uv9pc/zH aWrB3bamNM5E/zuWbnh2+BrA46Z9xrA2V+uSsLvXoK7rj+he7D5B6s167wjU8gos XFVBWC245XGQ6vTpgQE18khckcHrZnLMqynmyQMnzUG7FnZH14cnUKuqCbY5lTrh j/UiiMy9laURZpUetTLAn/DqoI3+K7R+KA8aNF6i7LHIz2JXCvQIhoR8BZhJ4z7a RCbDDYCG+rvEpITAPsSh5qnXoVe2KO7e8aDaIrrbVRT02+yLTUc= =jSae -----END PGP SIGNATURE----- --ZW0g1xMVoJhPwerUVQjdjQfZcRHidaZkw--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?95248089-6874-24cd-76fa-2af24063988b>