Commit graph

1310 commits

Author SHA1 Message Date
Victor Stinner 354c35220d
bpo-45482: Rename namespaceobject.h to pycore_namespace.h (GH-28975)
Rename Include/namespaceobject.h to
Include/internal/pycore_namespace.h.

The _testmultiphase extension is now built with the
Py_BUILD_CORE_MODULE macro defined to access _PyNamespace_Type.

object.c: remove unused "pycore_context.h" include.
2021-10-15 15:21:21 +02:00
Victor Stinner 105582e74c
bpo-45434: Remove Include/eval.h header file (GH-28973)
Move Include/eval.h content into Include/ceval.h and
Include/cpython/ceval.h, and remove Include/eval.h.
2021-10-15 13:06:05 +02:00
Victor Stinner 063abd931f
bpo-35081: Move interpreteridobject.h to Include/internal/ (GH-28969)
Move the interpreteridobject.h header file from Include/ to
Include/internal/. It only provides private functions.
2021-10-15 11:56:34 +02:00
Victor Stinner 8e5de40f90
bpo-35134: Move classobject.h to Include/cpython/ (GH-28968)
Move classobject.h, context.h, genobject.h and longintrepr.h header
files from Include/ to Include/cpython/.

Remove redundant "#ifndef Py_LIMITED_API" in context.h.

Remove explicit #include "longintrepr.h" in C files. It's not needed,
Python.h already includes it.
2021-10-15 09:46:29 +02:00
Victor Stinner 77b24ba505
bpo-35134: Move Include/cellobject.h to Include/cpython/ (GH-28964) 2021-10-15 02:39:58 +02:00
Victor Stinner 37b1d607bf
po-35134: Move Include/funcobject.h to Include/cpython/ (GH-28958)
Remove redundant "#ifndef Py_LIMITED_API" in funcobject.h.
2021-10-15 01:50:28 +02:00
Victor Stinner 0a883a76cd
bpo-35134: Add Include/cpython/floatobject.h (GH-28957)
Split Include/floatobject.h into sub-files: add
Include/cpython/floatobject.h and
Include/internal/pycore_floatobject.h.
2021-10-14 23:41:06 +02:00
Serhiy Storchaka f59ed3c310
bpo-45229: Make tkinter tests discoverable (GH-28637) 2021-10-13 18:12:48 +02:00
Victor Stinner bbe7497c5a
bpo-45434: Remove pystrhex.h header file (GH-28923)
Move Include/pystrhex.h to Include/internal/pycore_strhex.h.
The header file only contains private functions.

The following C extensions are now built with Py_BUILD_CORE_MODULE
macro defined to get access to the internal C API:

* _blake2
* _hashopenssl
* _md5
* _sha1
* _sha3
* _ssl
* binascii
2021-10-13 15:22:35 +02:00
Steve Dower 5146877623
bpo-45375: Fix assertion failure due to searching for stdlib in unnormalised paths (GH-28735) 2021-10-05 13:37:43 +01:00
Eric Snow 7e5c107541
bpo-45020: Add more test cases for frozen modules. (gh-28664)
I've added a number of test-only modules. Some of those cases are covered by the recently frozen stdlib modules (and some will be once we add encodings back in). However, I figured we'd play it safe by having a set of modules guaranteed to be there during tests.

https://bugs.python.org/issue45020
2021-09-30 18:38:52 -06:00
Niyas Sait adc5d32f47
Select correct tool platform when building on Windows ARM64 natively (GH-28491) 2021-09-27 20:52:54 +01:00
Eric Snow 7c801e0fa6
bpo-45020: Fix some corner cases for frozen module generation. (gh-28538)
This also includes some cleanup in preparation for a PR to make the "make all" output less noisy.

https://bugs.python.org/issue45020
2021-09-24 14:35:47 -06:00
Erlend Egeberg Aasland 5846c9b71e
bpo-44848: Update Windows installer to use SQLite 3.36.0 (GH-27622) 2021-09-20 16:58:13 +01:00
Steve Dower ef9e22b253
bpo-45055: Add retry when downloading externals on Windows (GH-28399)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-09-20 15:33:00 +01:00
Eric Snow 090591636c
bpo-45020: Freeze os, site, and codecs. (gh-28398)
https://bugs.python.org/issue45020
2021-09-17 16:31:31 -06:00
Eric Snow fdc6b3d931
bpo-45020: Drop the frozen .h files from the repo. (gh-28392)
The main advantage is that the files will no longer show up in diffs and PRs. That means, for a PR, the number of files / lines changed will more clearly reflect the actual change.  (This is essentially an un-revert of gh-28375.)

https://bugs.python.org/issue45020
2021-09-16 14:20:52 -06:00
Steve Dower f4b94b1f57
bpo-45220: Avoid automatically selecting the Windows 11 SDK preview when building (GH-28393) 2021-09-16 19:29:32 +01:00
Eric Snow 9fd87a5fe5
bpo-45020: Revert "Drop the frozen .h files from the repo." (gh-28380)
gh-28375 broke one of the buildbots. Until I figure out why, I'm rolling the change back.

https://bugs.python.org/issue45020
2021-09-15 23:27:38 -06:00
Eric Snow a9757bf34d
bpo-45020: Drop the frozen .h files from the repo. (gh-28375)
The main advantage is that the files will no longer show up in diffs and PRs. That means, for a PR, the number of files / lines changed will more clearly reflect the actual change.

https://bugs.python.org/issue45020
2021-09-15 19:15:26 -06:00
Eric Snow 3814e2036d
bpo-45019: Clean up the frozen __hello__ module. (gh-28374)
Here's one more small cleanup that should have been in PR gh-28319. We eliminate stdout side-effects from importing the frozen __hello__ module, and update tests accordingly. We also move the module's source file into Lib/ from Toos/freeze/flag.py.

https://bugs.python.org/issue45019
2021-09-15 14:15:32 -06:00
Steve Dower 09b4ad11f3
bpo-45188: Windows now regenerates frozen modules at the start of build instead of late (GH-28322)
This will enable us to drop the frozen module header files from the repository.

It does currently cause many source files to be built twice, which just takes more time. For whoever comes to fix this in the future, the files shared between freeze_module and pythoncore should be put into a static library that is consumed by both.
2021-09-15 18:11:12 +01:00
Hugo van Kemenade eb254b43d2
bpo-45124: Remove the bdist_msi command (GH-28195)
The bdist_msi command, deprecated in Python 3.9, is now removed.
Use bdist_wheel (wheel packages) instead.
2021-09-07 12:34:27 +02:00
Steve Dower 6f8bc464e0
bpo-45022: Update libffi to 3.4.2 in Windows build (GH-28146) 2021-09-03 19:37:31 +01:00
Victor Stinner a806608705
bpo-45085: Remove the binhex module (GH-28117)
The binhex module, deprecated in Python 3.9, is now removed. The
following binascii functions, deprecated in Python 3.9, are now also
removed:

* a2b_hqx(), b2a_hqx();
* rlecode_hqx(), rledecode_hqx().

The binascii.crc_hqx() function remains available.
2021-09-02 12:10:08 +02:00
Eric Snow 044e8d866f
bpo-45019: Add a tool to generate list of modules to include for frozen modules (gh-27980)
Frozen modules must be added to several files in order to work properly. Before this change this had to be done manually. Here we add a tool to generate the relevant lines in those files instead. This helps us avoid mistakes and omissions.

https://bugs.python.org/issue45019
2021-08-30 17:25:11 -06:00
Steve Dower d3bdbbf9a4
bpo-45007: Update to OpenSSL 1.1.1l in Windows build and CI (GH-28009) 2021-08-29 16:18:57 +02:00
Steve Dower 969ae7f735
bpo-45022: Pin current libffi build to fixed version in preparation for upcoming update (GH-27982)
Also improve the build script for libffi, which is not used as part of the regular build.
2021-08-27 00:57:00 +01:00
Pablo Galindo Salgado a24676bedc
Add tests for the C tokenizer and expose it as a private module (GH-27924) 2021-08-24 17:50:05 +01:00
Steve Dower 6871fd0e8e
Ensure LICENSE.txt file is generated even in PGO builds (GH-27580) 2021-08-03 16:52:45 +01:00
Steve Dower 3edec5d142
bpo-44479: Do not regenerate files during a PGO build as it will invalidate the profile. (GH-27460) 2021-07-29 20:53:29 +01:00
Mark Shannon ae0a2b7562
bpo-44590: Lazily allocate frame objects (GH-27077)
* Convert "specials" array to InterpreterFrame struct, adding f_lasti, f_state and other non-debug FrameObject fields to it.

* Refactor, calls pushing the call to the interpreter upward toward _PyEval_Vector.

* Compute f_back when on thread stack, only filling in value when frame object outlives stack invocation.

* Move ownership of InterpreterFrame in generator from frame object to generator object.

* Do not create frame objects for Python calls.

* Do not create frame objects for generators.
2021-07-26 11:22:16 +01:00
Dong-hee Na 906fe47083
bpo-44611: Use BCryptGenRandom instead of CryptGenRandom on Windows (GH-27168) 2021-07-23 23:04:30 +09:00
Yurii Karabas 96c4cbd96c
bpo-44353: Implement typing.NewType __call__ method in C (#27262)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Denis Laxalde <denis@laxalde.org>
2021-07-22 23:06:54 +02:00
Steve Dower 3d3027c5fc
bpo-44479: Simplified LICENSE.txt regeneration in Windows build (GH-27056) 2021-07-07 18:21:54 +01:00
Steve Dower 1b133ab841
bpo-44479: Regenerate test_frozenmain.h and frozen_hello.h during build on Windows (GH-26984) 2021-07-05 16:18:14 +01:00
Steve Dower d3a95c1b6e
bpo-44535: Enable building with Visual Studio 2022 on Windows (GH-26962) 2021-06-30 20:06:06 +01:00
Steve Dower 80190b3e53
bpo-43298: Improved error message when building without the Windows SDK installed (GH-26800) 2021-06-19 13:45:16 +01:00
Steve Dower 5af56c6f2a
bpo-44381: Windows build now allows enabling control flow guard (GH-26645) 2021-06-11 21:35:40 +01:00
Mark Shannon 001eb520b5
bpo-44187: Quickening infrastructure (GH-26264)
* Add co_firstinstr field to code object.

* Implement barebones quickening.

* Use non-quickened bytecode when tracing.

* Add NEWS item

* Add new file to Windows build.

* Don't specialize instructions with EXTENDED_ARG.
2021-06-07 18:38:06 +01:00
Erlend Egeberg Aasland f461a7fc3f
bpo-42862: Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module (GH-24203)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-06-03 20:59:26 +01:00
Erlend Egeberg Aasland b451bc8d7e
bpo-42686: Enable SQLite math functions in Windows build (#24053) 2021-05-04 14:47:44 +02:00
Pablo Galindo c2931d31f8
bpo-43916: Move the _PyStructSequence_InitType function to the internal API (GH-25854) 2021-05-03 15:50:24 +01:00
Erlend Egeberg Aasland bf0c7c0147
bpo-43492: Upgrade Windows installer to use SQLite 3.35.5 (GH-25641) 2021-04-27 17:23:53 +01:00
Ken Jin 425434dadc
bpo-40432: Use python 3.8 or higher to compile CPython on Windows (#25389) 2021-04-26 20:11:43 +01:00
Terry Jan Reedy 6b59e662fa
bop-43652: Update Tcl and Tk to 8.6.11 in Windows installer (GH-25170) 2021-04-23 22:40:42 +01:00
Steve Dower a911bd15a1
bpo-43915: Add PCbuild/blurb.bat to simplify Windows contributors (GH-25528) 2021-04-22 20:45:47 +01:00
Victor Stinner cdad2724e6
bpo-40137: Add pycore_moduleobject.h internal header (GH-25507)
Add pycore_moduleobject.h internal header file with static inline
functions to access module members:

* _PyModule_GetDict()
* _PyModule_GetDef()
* _PyModule_GetState()

These functions don't check at runtime if their argument has a valid
type and can be inlined even if Python is not built with LTO.

_PyType_GetModuleByDef() uses _PyModule_GetDef().

Replace PyModule_GetState() with _PyModule_GetState() in the
extension modules, considered as performance sensitive:

* _abc
* _functools
* _operator
* _pickle
* _queue
* _random
* _sre
* _struct
* _thread
* _winapi
* array
* posix

The following extensions are now built with the Py_BUILD_CORE_MODULE
macro defined, to be able to use the internal pycore_moduleobject.h
header: _abc, array, _operator, _queue, _sre, _struct.
2021-04-22 00:52:52 +02:00
Pablo Galindo 37494b441a
bpo-38530: Offer suggestions on AttributeError (#16856)
When printing AttributeError, PyErr_Display will offer suggestions of similar 
attribute names in the object that the exception was raised from:

>>> collections.namedtoplo
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'collections' has no attribute 'namedtoplo'. Did you mean: namedtuple?
2021-04-14 02:36:07 +01:00
Steve Dower 7482838190
bpo-43567: Improved generated code refresh on Windows (GH-25120)
Generated files are now refreshed automatically on regular build, or may be forcibly regenerated by calling `build.bat --regen`.
2021-04-06 23:54:43 +01:00