classification
Title: Remove support for threads-less builds
Type: enhancement Stage: patch review
Components: Build, Interpreter Core Versions: Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Arfrever, Steve Gomez, christian.heimes, gregory.p.smith, haypo, pitrou, r.david.murray, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2017-09-06 21:10 by pitrou, last changed 2017-09-18 21:50 by pitrou.

Pull Requests
URL Status Linked Edit
PR 3385 merged pitrou, 2017-09-06 21:11
PR 3482 merged pitrou, 2017-09-10 18:19
PR 3648 merged pitrou, 2017-09-18 17:20
PR 3649 merged pitrou, 2017-09-18 17:35
Messages (21)
msg301518 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-09-06 21:10
The --without-threads option has a lot of repercussions on the code base, forcing us to maintain specific paths for builds with threads disabled, for no useful purpose.
msg301520 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-09-06 21:12
See discussion in https://mail.python.org/pipermail/python-dev/2017-September/149156.html
msg301521 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-09-06 21:15
Question: should we keep Modules/Setup.config.in?  It's going to become empty:
https://github.com/python/cpython/blob/master/Modules/Setup.config.in
msg301539 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2017-09-06 22:58
The PEP 11 should be updated just to mention that platforms without threading support are not supported in Python 3.7.
msg301543 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2017-09-06 23:23
We had a buildbot testing --without-threads, but it's gone. I just removed its unused class from the buildbot configuration:

https://github.com/python/buildmaster-config/commit/091f52aa05a8977966796ba3ef4b8257bef1c0e9
msg301559 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2017-09-07 00:50
I guess Setup.config.in can go.  It's only purpose was for autoconf driven Setup changes.
msg301595 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2017-09-07 16:56
New changeset a6a4dc816d68df04a7d592e0b6af8c7ecc4d4344 by Victor Stinner (Antoine Pitrou) in branch 'master':
bpo-31370: Remove support for threads-less builds (#3385)
https://github.com/python/cpython/commit/a6a4dc816d68df04a7d592e0b6af8c7ecc4d4344
msg301596 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2017-09-07 16:58
PEP 11 was updated, the change was merged, this issue can now be closed. Thanks Antoine!
msg301805 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * Date: 2017-09-10 09:04
Also 'import threading' code in Tools/scripts/run_tests.py should be cleaned.
msg301964 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * Date: 2017-09-12 15:46
Lib/_dummy_thread.py and Lib/dummy_threading.py were deleted, but Doc/library/_dummy_thread.rst and Doc/library/dummy_threading.rst still exist.

Probably Doc/whatsnew/3.7.rst should mention that these modules were deleted.

Or maybe they should be restored and firstly deprecated, before deletion in a later version of Python.
msg301968 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2017-09-12 16:01
Arfrever: "Lib/_dummy_thread.py and Lib/dummy_threading.py were deleted, but Doc/library/_dummy_thread.rst and Doc/library/dummy_threading.rst still exist."

Ah, it should be deleted as well.

Arfrever: "Probably Doc/whatsnew/3.7.rst should mention that these modules were deleted."

Right.

Arfrever: "Or maybe they should be restored and firstly deprecated, before deletion in a later version of Python."

I don't think that it's worth it, but I suggest to add a warning to Python 3.6 documentation. Something like the following warning in Python 2.7 documentation of the commands module:
"Deprecated since version 2.6: The commands module has been removed in Python 3. Use the subprocess module instead."
https://docs.python.org/2/library/commands.html
msg301971 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2017-09-12 16:12
Oh, Arfrever wrote me on IRC that the removal of dummy_threading broke portage on Gentoo: https://bugs.gentoo.org/630730

eventlet also uses dummy_threading:

eventlet/support/dns/entropy.py:23:    import dummy_threading as _threading
eventlet/support/dns/resolver.py:29:    import dummy_threading as _threading

Hum, maybe we need one release with the deprecated module, and only remove it in Python 3.8?
msg301973 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2017-09-12 16:23
+1 to restore dummy_threading and go through a proper deprecation phase in 3.7+.

-0 to restore _dummy_thread. It's an internal, private module.
msg301980 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-09-12 17:20
Following lines needs updating:

Lib/importlib/_bootstrap.py:1135
Lib/_pydecimal.py:436
Lib/test/ssl_servers.py:11
Lib/test/support/__init__.py:2053
Lib/test/test_httplib.py:1080
Lib/test/test_idle.py:4
Lib/test/test_multiprocessing_main_handling.py:3
Lib/test/test_thread.py:5
Lib/test/test_threadsignals.py:8
Lib/test/test_tools/test_sundry.py:43
Lib/test/test_winreg.py:7
Lib/test/test_wsgiref.py:256
Lib/test/test_xmlrpc.py:1179
msg301987 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2017-09-12 18:28
dummy_threading should definitely not have been removed, and like all the other APIs should not be removed until 2.7 is dead.  Deprecating it is of course fine :)
msg301988 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2017-09-12 18:31
And actually, I wouldn't be surprised if eventlet depended on the *functionality* in _dummy_threading, so you probably need to restore that, too.
msg302474 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-09-18 16:35
> eventlet also uses dummy_threading

Not sure what you mean by that.  eventlet uses the regular try/except import dance around "import threading":

https://github.com/eventlet/eventlet/blob/master/eventlet/support/dns/entropy.py#L20-L23
https://github.com/eventlet/eventlet/blob/master/eventlet/support/dns/resolver.py#L23-L26

As for portage, Arfrever fixed it :-)

https://gitweb.gentoo.org/proj/portage.git/commit/?id=504f66b0e25281e4465ebeceb799c3e54ff2b884

That said, I am not against bringing dummy_threading back, though it would sound rather weird to use it unconditionally...
msg302476 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-09-18 17:21
https://github.com/python/cpython/pull/3648 restores dummy_threading and _dummy_thread, but deprecates them.
msg302484 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-09-18 20:04
New changeset b43c4caf81b10e5c7ebaeb3a712c6db584f60bbd by Antoine Pitrou in branch 'master':
Restore dummy_threading and _dummy_thread, but deprecate them (bpo-31370) (#3648)
https://github.com/python/cpython/commit/b43c4caf81b10e5c7ebaeb3a712c6db584f60bbd
msg302490 - (view) Author: Steve Gomez (Steve Gomez) Date: 2017-09-18 21:05
Oracle Binary Code License Agreement for the Java SE Platform Products and JavaFX  ORACLE AMERICA, INC. ("ORACLE"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL, IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS  CONTAINED IN THIS BINARY CODE LICENSE AGREEMENT AND SUPPLEMENTAL LICENSE TERMS (COLLECTIVELY "AGREEMENT").  PLEASE READ THE AGREEMENT CAREFULLY.  BY SELECTING THE "ACCEPT LICENSE AGREEMENT" (OR THE EQUIVALENT) BUTTON AND/OR BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.  IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS.  IF YOU DO NOT HAVE SUCH AUTHORITY, OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, THEN SELECT THE "DECLINE LICENSE AGREEMENT" (OR THE EQUIVALENT) BUTTON AND YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.  1.  DEFINITIONS.  "Software" means the software identified above in binary form that you selected for download, install or use (in the version You selected for download, install or use) from Oracle or its authorized licensees, any other machine readable materials (including, but not limited to, libraries, source files, header files, and data files), any updates or error corrections provided by Oracle, and any user manuals, programming guides and other documentation provided to you by Oracle under this Agreement.  "General Purpose Desktop Computers and Servers" means computers,  including desktop and laptop computers, or servers, used for general  computing functions under end user control (such as but not specifically  limited to email, general purpose Internet browsing, and office suite  productivity tools).  The use of Software in systems and solutions that provide dedicated functionality (other than as mentioned above) or designed  for use in embedded or function-specific software applications, for example but not limited to: Software embedded in or bundled with industrial control systems, wireless mobile telephones, wireless handheld devices, kiosks, TV/STB, Blu-ray Disc devices, telematics and network control switching equipment, printers and storage management systems, and other related systems are excluded from this definition and not licensed under this  Agreement.  "Programs" means (a) Java technology applets and applications  intended to run on the Java Platform, Standard Edition platform on Java-enabled General Purpose Desktop Computers and Servers; and (b) JavaFX technology applications intended to run on the JavaFX Runtime on JavaFX-enabled General Purpose Desktop Computers and Servers.  “Commercial Features” means those features identified in Table 1-1 (Commercial Features In Java SE Product Editions) of the Java SE documentation accessible at  http://www.oracle.com/technetwork/java/javase/documentation/index.html.  “README File” means the README file for the Software accessible at http://www.oracle.com/technetwork/java/javase/documentation/index.html.  2.  LICENSE TO USE.  Subject to the terms and conditions of this Agreement   including, but not limited to, the Java Technology Restrictions of the  Supplemental License Terms, Oracle grants you a non-exclusive, non-transferable, limited license without license fees to reproduce and use internally the Software complete and unmodified for the sole purpose of  running Programs.  THE LICENSE SET FORTH IN THIS SECTION 2 DOES NOT EXTEND TO THE COMMERCIAL FEATURES.  YOUR RIGHTS AND OBLIGATIONS RELATED TO THE COMMERCIAL FEATURES ARE AS SET FORTH IN THE SUPPLEMENTAL TERMS ALONG WITH ADDITIONAL LICENSES FOR DEVELOPERS AND PUBLISHERS.
msg302492 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-09-18 21:50
New changeset 88c60c9668f0aa732693517a60b851cc1dfce0cb by Antoine Pitrou in branch 'master':
Trivial cleanups following bpo-31370 (#3649)
https://github.com/python/cpython/commit/88c60c9668f0aa732693517a60b851cc1dfce0cb
History
Date User Action Args
2017-09-18 21:50:45pitrousetmessages: + msg302492
2017-09-18 21:05:40Steve Gomezsetnosy: + Steve Gomez
messages: + msg302490
2017-09-18 20:04:27pitrousetmessages: + msg302484
2017-09-18 17:35:25pitrousetstage: resolved -> patch review
pull_requests: + pull_request3642
2017-09-18 17:21:41pitrousetmessages: + msg302476
stage: patch review -> resolved
2017-09-18 17:20:23pitrousetkeywords: + patch
stage: resolved -> patch review
pull_requests: + pull_request3641
2017-09-18 16:35:40pitrousetmessages: + msg302474
2017-09-12 18:31:14r.david.murraysetmessages: + msg301988
2017-09-12 18:28:57r.david.murraysetnosy: + r.david.murray
messages: + msg301987
2017-09-12 17:20:52serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg301980
2017-09-12 16:23:32christian.heimessetnosy: + christian.heimes
messages: + msg301973
2017-09-12 16:12:39hayposetmessages: + msg301971
2017-09-12 16:01:25hayposetmessages: + msg301968
2017-09-12 15:46:06Arfreversetstatus: closed -> open
resolution: fixed ->
messages: + msg301964
2017-09-10 18:19:37pitrousetpull_requests: + pull_request3472
2017-09-10 09:04:50Arfreversetnosy: + Arfrever
messages: + msg301805
2017-09-07 16:58:45hayposetstatus: open -> closed
resolution: fixed
messages: + msg301596

stage: patch review -> resolved
2017-09-07 16:56:26hayposetmessages: + msg301595
2017-09-07 00:50:54gregory.p.smithsetmessages: + msg301559
2017-09-06 23:23:08hayposetmessages: + msg301543
2017-09-06 22:58:47hayposetmessages: + msg301539
2017-09-06 21:15:49pitrousetstage: needs patch -> patch review
2017-09-06 21:15:38pitrousetmessages: + msg301521
2017-09-06 21:12:43pitrousetmessages: + msg301520
2017-09-06 21:11:07pitrousetpull_requests: + pull_request3398
2017-09-06 21:10:49pitroucreate