summaryrefslogtreecommitdiffstats
path: root/Tools/scripts
Commit message (Collapse)AuthorAgeFilesLines
* bpo-45020: Identify which frozen modules are actually aliases. (gh-28655)Eric Snow2021-10-051-1/+38
| | | | | | | In the list of generated frozen modules at the top of Tools/scripts/freeze_modules.py, you will find that some of the modules have a different name than the module (or .py file) that is actually frozen. Let's call each case an "alias". Aliases do not come into play until we get to the (generated) list of modules in Python/frozen.c. (The tool for freezing modules, Programs/_freeze_module, is only concerned with the source file, not the module it will be used for.) Knowledge of which frozen modules are aliases (and the identity of the original module) normally isn't important. However, this information is valuable when we go to set __file__ on frozen stdlib modules. This change updates Tools/scripts/freeze_modules.py to map aliases to the original module name (or None if not a stdlib module) in Python/frozen.c. We also add a helper function in Python/import.c to look up a frozen module's alias and add the result of that function to the frozen info returned from find_frozen(). https://bugs.python.org/issue45020
* bpo-43760: Check for tracing using 'bitwise or' instead of branch in ↵Mark Shannon2021-10-051-1/+1
| | | | dispatch. (GH-28723)
* bpo-45020: Add more test cases for frozen modules. (gh-28664)Eric Snow2021-10-012-6/+12
| | | | | 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
* Fix EncodingWarning in freeze_modules. (GH-28591)Inada Naoki2021-09-301-4/+4
|
* bpo-45020: Do not freeze <pkg>/__init__.py twice. (gh-28635)Eric Snow2021-09-291-0/+7
| | | | | Currently we're freezing the __init__.py twice, duplicating the built data unnecessarily With this change we do it once. There is no change in runtime behavior. https://bugs.python.org/issue45020
* Select correct tool platform when building on Windows ARM64 natively (GH-28491)Niyas Sait2021-09-271-1/+5
|
* bpo-45020: Fix some corner cases for frozen module generation. (gh-28538)Eric Snow2021-09-242-32/+76
| | | | | This also includes some cleanup in preparation for a PR to make the "make all" output less noisy. https://bugs.python.org/issue45020
* bpo-45020: Freeze os, site, and codecs. (gh-28398)Eric Snow2021-09-171-11/+11
| | | https://bugs.python.org/issue45020
* bpo-45020: Fix build out of source tree (GH-28410)Victor Stinner2021-09-171-4/+10
| | | | | | * Makefile.pre.in: Add $(srcdir) when needed, remove it when it was used by mistake. * freeze_modules.py tool uses ./Programs/_freeze_module if the executable doesn't exist in the source tree.
* bpo-45231: update_file.py preserves end of line (GH-28411)Victor Stinner2021-09-171-1/+13
| | | | | | The update_file.py tool now preserves the end of line of the updated file. Fix the "make regen-frozen" command: it no longer changes the end of line of PCbuild/ files on Unix. Git changes the end of line depending on the platform.
* bpo-45020: Drop the frozen .h files from the repo. (gh-28392)Eric Snow2021-09-161-7/+4
| | | | | 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
* bpo-45020: Revert "Drop the frozen .h files from the repo." (gh-28380)Eric Snow2021-09-161-3/+6
| | | | | gh-28375 broke one of the buildbots. Until I figure out why, I'm rolling the change back. https://bugs.python.org/issue45020
* bpo-45020: Drop the frozen .h files from the repo. (gh-28375)Eric Snow2021-09-161-6/+3
| | | | | 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
* bpo-45019: Clean up the frozen __hello__ module. (gh-28374)Eric Snow2021-09-151-4/+4
| | | | | 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
* bpo-45188: Windows now regenerates frozen modules at the start of build ↵Steve Dower2021-09-151-13/+47
| | | | | | | 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.
* bpo-45020: Freeze some of the modules imported during startup. (gh-28335)Eric Snow2021-09-151-3/+28
| | | | | | | Doing this provides significant performance gains for runtime startup (~15% with all the imported modules frozen). We don't yet freeze all the imported modules because there are a few hiccups in the build systems we need to sort out first. (See bpo-45186 and bpo-45188.) Note that in PR GH-28320 we added a command-line flag (-X frozen_modules=[on|off]) that allows users to opt out of (or into) using frozen modules. The default is still "off" but we will change it to "on" as soon as we can do it in a way that does not cause contributors pain. https://bugs.python.org/issue45020
* bpo-45152: Add HAS_CONST macro and get_const_value() function and use… ↵Irit Katriel2021-09-141-0/+10
| | | | (#28262)
* bpo-45019: Do some cleanup related to frozen modules. (gh-28319)Eric Snow2021-09-132-103/+225
| | | | | There are a few things I missed in gh-27980. This is a follow-up that will make subsequent PRs cleaner. It includes fixes to tests and tools that reference the frozen modules. https://bugs.python.org/issue45019
* Fix typos in pep384_macrocheck.py (GH-28220)Ikko Ashimine2021-09-101-2/+2
| | | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
* bpo-45019: Add a tool to generate list of modules to include for frozen ↵Eric Snow2021-08-302-6/+526
| | | | | | | 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
* Classify specialization failures. Provides more useful stats, with lower ↵Mark Shannon2021-08-101-0/+12
| | | | overhead. (GH-27701)
* Add option to write specialization stats to files and script to summarize. ↵Mark Shannon2021-08-041-0/+41
| | | | | | | (GH-27575) * Add option to write stats to random file in a directory. * Add script to summarize stats.
* bpo-43795: Don't list private names in the limited API (GH-26740)Petr Viktorin2021-06-161-0/+12
| | | | | | | | | | | | | * Remove struct _node from the stable ABI list This struct was removed along with the old parser in Python 3.9 (PEP 617) * Stable ABI list: Use the public name "PyFrameObject" rather than "_frame" * Ensure limited API doesn't contain private names Names prefixed by an underscore are private by definition. * Add a blurb
* bpo-44337: Port LOAD_ATTR to PEP 659 adaptive interpreter (GH-26595)Mark Shannon2021-06-101-0/+9
| | | | | | | | | | | | | | * Specialize LOAD_ATTR with LOAD_ATTR_SLOT and LOAD_ATTR_SPLIT_KEYS * Move dict-common.h to internal/pycore_dict.h * Add LOAD_ATTR_WITH_HINT specialized opcode. * Quicken in function if loopy * Specialize LOAD_ATTR for module attributes. * Add specialization stats
* bpo-44125: Fix "make patchcheck" on non-English locale (GH-26102)Antoine Pitrou2021-05-131-1/+4
| | | | | The patch from [bpo-44074]() does not account for a possibly non-English locale and blindly greps for "HEAD branch" in a possibly localized text. Automerge-Triggered-By: GH:pitrou
* bpo-43795: PEP 652 user documentation (GH-25668)Petr Viktorin2021-05-111-6/+27
| | | | | | - Reformat the C API and ABI Versioning page (and extend/clarify a bit) - Rewrite the stable ABI docs into a general text on C API Compatibility - Add a list of Limited API contents, and notes for the individual items. - Replace `Include/README.rst` with a link to a devguide page with the same info
* bpo-44074: let patchcheck infer the base branch name (GH-25991)Leonardo Lai2021-05-101-4/+26
|
* bpo-40222: "Zero cost" exception handling (GH-25729)Mark Shannon2021-05-071-6/+4
| | | | | | | | "Zero cost" exception handling. * Uses a lookup table to determine how to handle exceptions. * Removes SETUP_FINALLY and POP_TOP block instructions, eliminating (most of) the runtime overhead of try statements. * Reduces the size of the frame object by about 60%.
* bpo-43795: Generate python3dll.c and doc data from manifest (PEP 652) (GH-25315)Petr Viktorin2021-04-292-111/+485
|
* bpo-43651: PEP 597: Fix pdeps used locale encoding (GH-25204)Inada Naoki2021-04-061-1/+1
|
* bpo-43688: Support "make regen-limited-abi" in debug mode (GH-25133)Victor Stinner2021-04-021-5/+0
|
* bpo-43690: stable_abi.py no longer parses macros (GH-25136)Victor Stinner2021-04-011-32/+1
| | | | | | | | The stable_abi.py script no longer parse macros. Macro targets can be static inline functions which are not part of the stable ABI, only part of the limited C API. Run "make regen-limited-abi" to exclude PyType_HasFeature from Doc/data/stable_abi.dat.
* bpo-42955: Add _overlapped to sys.stdlib_module_names (GH-25122)Victor Stinner2021-04-011-0/+1
|
* bpo-43244: Remove symtable.h header file (GH-24910)Victor Stinner2021-03-191-1/+0
| | | | | | | | | | | | | | | | | | Rename Include/symtable.h to to Include/internal/pycore_symtable.h, don't export symbols anymore (replace PyAPI_FUNC and PyAPI_DATA with extern) and rename functions: * PyST_GetScope() to _PyST_GetScope() * PySymtable_BuildObject() to _PySymtable_Build() * PySymtable_Free() to _PySymtable_Free() Remove PySymtable_Build(), Py_SymtableString() and Py_SymtableStringObject() functions. The Py_SymtableString() function was part the stable ABI by mistake but it could not be used, since the symtable.h header file was excluded from the limited C API. The Python symtable module remains available and is unchanged.
* bpo-43456: Remove _xxsubinterpreters from sys.stdlib_module_names (GH-24814)Victor Stinner2021-03-101-0/+1
|
* bpo-43445: Add frozen modules to sys.stdlib_module_names (GH-24798)Victor Stinner2021-03-101-3/+32
| | | | | | Add frozen modules to sys.stdlib_module_names. For example, add "_frozen_importlib" and "_frozen_importlib_external" names. Add "list_frozen" command to Programs/_testembed.
* bpo-35134: Move non-limited C API files to Include/cpython/ (GH-24561)Nicholas Sim2021-02-191-1/+0
| | | | | | Include/{odictobject.h,parser_interface.h,picklebufobject.h,pydebug.h,pyfpe.h} into Include/cpython/. Parser: peg_api: include Python.h instead of parser_interface.h.
* bpo-35134: Move Include/{pyarena.h,pyctype.h} to Include/cpython/ (GH-24550)Nicholas Sim2021-02-171-2/+0
| | | | Move non-limited C API headers pyarena.h and pyctype.h into Include/cpython/ directory.
* bpo-43103: Add configure --without-static-libpython (GH-24418)Victor Stinner2021-02-172-3/+8
| | | | | | | | Add a new configure --without-static-libpython option to not build the libpythonMAJOR.MINOR.a static library and not install the python.o object file. Fix smelly.py and stable_abi.py tools when libpython3.10.a is missing.
* bpo-42955: Remove sub-packages from sys.stdlib_module_names (GH-24353)Victor Stinner2021-01-271-19/+7
|
* bpo-42955: Rename module_names to sys.stdlib_module_names (GH-24332)Victor Stinner2021-01-251-4/+5
| | | | * Rename _Py_module_names to _Py_stdlib_module_names. * Rename Python/module_names.h to Python/stdlib_module_names.h.
* bpo-42955: Add sys.modules_names (GH-24238)Victor Stinner2021-01-251-76/+26
| | | | Add sys.module_names, containing the list of the standard library module names.
* bpo-42955: Add Python/module_names.h (GH-24258)Victor Stinner2021-01-191-0/+200
| | | | | | | | | | Add a private list of all stdlib modules: _Py_module_names. * Add Tools/scripts/generate_module_names.py script. * Makefile: Add "make regen-module-names" command. * setup.py: Add --list-module-names option. * GitHub Action and Travis CI also runs "make regen-module-names", not ony "make regen-all", to ensure that the module names remains up to date.
* Update stable ABI script for MacOS and update list of exported symbols ↵Pablo Galindo2020-12-151-1/+5
| | | | (GH-23783)
* bpo-42545: Improve the error message in the stable API script (GH-23648)Pablo Galindo2020-12-041-21/+41
|
* bpo-42545: Check that all symbols in the limited ABI are exported (GH-23616)Pablo Galindo2020-12-041-0/+234
|
* bpo-42212: smelly.py also checks the dynamic library (GH-23423)Victor Stinner2020-11-241-35/+119
| | | | | | | | The smelly.py script now also checks the Python dynamic library and extension modules, not only the Python static library. Make also the script more verbose: explain what it does. The GitHub Action job now builds Python with the libpython dynamic library.
* bpo-41463: Generate information about jumps from 'opcode.py' rather than ↵Mark Shannon2020-08-041-0/+19
| | | | | duplicating it in 'compile.c' (GH-21714) Generate information about jumps from 'opcode.py' rather than duplicate it in 'compile.c'
* bpo-39573: Use the Py_TYPE() macro (GH-21433)Victor Stinner2020-07-101-1/+1
| | | Replace obj->ob_type with Py_TYPE(obj).
* bpo-40939: Remove the old parser (Part 2) (GH-21005)Lysandros Nikolaou2020-06-201-53/+0
| | | Remove some remaining files and Makefile targets for the old parser