This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Statically linking pyexpat in Modules/Setup fails to compile on macOS
Type: compile error Stage: resolved
Components: Build, Extension Modules, macOS Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Maxime Belanger, benjamin.peterson, miss-islington, ned.deily, ronaldoussoren
Priority: normal Keywords: patch

Created on 2018-11-01 21:56 by Maxime Belanger, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 10289 merged maxbelanger, 2018-11-01 22:02
PR 10291 merged miss-islington, 2018-11-02 02:50
PR 10292 merged miss-islington, 2018-11-02 02:50
PR 10293 merged benjamin.peterson, 2018-11-02 02:52
Messages (6)
msg329089 - (view) Author: Maxime Belanger (Maxime Belanger) Date: 2018-11-01 21:56
Uncommenting the following line in `Modules/Setup` leads to a compiler error on macOS (tested w/ Xcode 10):

```
./Modules/expat/xmlparse.c:92:3: error: You do not have support for any sources of high quality entropy enabled. For end user security, that is probably not what you want.
      Your options include: * Linux + glibc >=2.25 (getrandom): HAVE_GETRANDOM, * Linux + glibc <2.25 (syscall SYS_getrandom): HAVE_SYSCALL_GETRANDOM, * BSD / macOS >=10.7
      (arc4random_buf): HAVE_ARC4RANDOM_BUF, * BSD / macOS <10.7 (arc4random): HAVE_ARC4RANDOM, * libbsd (arc4random_buf): HAVE_ARC4RANDOM_BUF + HAVE_LIBBSD, * libbsd
      (arc4random): HAVE_ARC4RANDOM + HAVE_LIBBSD, * Linux / BSD / macOS (/dev/urandom): XML_DEV_URANDOM * Windows (RtlGenRandom): _WIN32. If insist on not using any of
      these, bypass this error by defining XML_POOR_ENTROPY; you have been warned. If you have reasons to patch this detection code away or need changes to the build system,
      please open a bug. Thank you!
```

I believe this is due to `setup.py` being out of sync with `Modules/Setup`, which defines `XML_POOR_ENTROPY`. I'll attach a patch that resolves the issue for me.
msg329090 - (view) Author: Maxime Belanger (Maxime Belanger) Date: 2018-11-01 21:58
The line in question being:

```
#pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI
```
msg329100 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2018-11-02 02:49
New changeset 318ab63c01f5b8e7562b122ab5ba01258a51277b by Benjamin Peterson (Max Bélanger) in branch 'master':
closes bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now match `setup.py` (GH-10289)
https://github.com/python/cpython/commit/318ab63c01f5b8e7562b122ab5ba01258a51277b
msg329101 - (view) Author: miss-islington (miss-islington) Date: 2018-11-02 03:09
New changeset 04c96669b161d802b7a906c06cd77895cee1864e by Miss Islington (bot) in branch '3.7':
closes bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now match `setup.py` (GH-10289)
https://github.com/python/cpython/commit/04c96669b161d802b7a906c06cd77895cee1864e
msg329102 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2018-11-02 03:28
New changeset a614cc92088c4e1b2d90aa03415ee6acf70f03b4 by Benjamin Peterson in branch '2.7':
[2.7] closes bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now match `setup.py` (GH-10293)
https://github.com/python/cpython/commit/a614cc92088c4e1b2d90aa03415ee6acf70f03b4
msg329104 - (view) Author: miss-islington (miss-islington) Date: 2018-11-02 03:32
New changeset 2339fe7cad9a84815fe551fedd6acdc3f2bf0a64 by Miss Islington (bot) in branch '3.6':
closes bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now match `setup.py` (GH-10289)
https://github.com/python/cpython/commit/2339fe7cad9a84815fe551fedd6acdc3f2bf0a64
History
Date User Action Args
2022-04-11 14:59:07adminsetgithub: 79320
2018-11-02 03:32:33miss-islingtonsetmessages: + msg329104
2018-11-02 03:28:39benjamin.petersonsetmessages: + msg329102
2018-11-02 03:09:07miss-islingtonsetnosy: + miss-islington
messages: + msg329101
2018-11-02 02:52:23benjamin.petersonsetpull_requests: + pull_request9603
2018-11-02 02:50:14miss-islingtonsetpull_requests: + pull_request9602
2018-11-02 02:50:01miss-islingtonsetpull_requests: + pull_request9601
2018-11-02 02:49:49benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg329100

resolution: fixed
stage: patch review -> resolved
2018-11-01 22:02:07maxbelangersetkeywords: + patch
stage: patch review
pull_requests: + pull_request9599
2018-11-01 21:58:03Maxime Belangersetmessages: + msg329090
2018-11-01 21:56:10Maxime Belangercreate