summaryrefslogtreecommitdiffstats
path: root/Python/frozen.c
Commit message (Collapse)AuthorAgeFilesLines
* gh-97669: Create Tools/build/ directory (#97963)Victor Stinner2022-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Create Tools/build/ directory. Move the following scripts from Tools/scripts/ to Tools/build/: * check_extension_modules.py * deepfreeze.py * freeze_modules.py * generate_global_objects.py * generate_levenshtein_examples.py * generate_opcode_h.py * generate_re_casefix.py * generate_sre_constants.py * generate_stdlib_module_names.py * generate_token.py * parse_html5_entities.py * smelly.py * stable_abi.py * umarshal.py * update_file.py * verify_ensurepip_wheels.py Update references to these scripts.
* bpo-46748: Don't import <stdbool.h> in public headers (GH-31553)Petr Viktorin2022-02-251-0/+2
| | | | | | | <stdbool.h> is the standard/modern way to define embedd/extends Python free to define bool, true and false, but there are existing applications that use slightly different redefinitions, which fail if the header is included. It's OK to use stdbool outside the public headers, though. https://bugs.python.org/issue46748
* bpo-46608: exclude marshalled-frozen data if deep-freezing to save 300 KB ↵Kumar Aditya2022-02-041-54/+29
| | | | | | | | | | | | | space (GH-31074) This reduces the size of the data segment by **300 KB** of the executable because if the modules are deep-frozen then the marshalled frozen data just wastes space. This was inspired by comment by @gvanrossum in https://github.com/python/cpython/pull/29118#issuecomment-958521863. Note: There is a new option `--deepfreeze-only` in `freeze_modules.py` to change this behavior, it is on be default to save disk space. ```console # du -s ./python before 27892 ./python # du -s ./python after 27524 ./python ``` Automerge-Triggered-By: GH:ericsnowcurrently
* bpo-45654: No need to freeze types (GH-30028)Christian Heimes2021-12-101-3/+0
|
* bpo-45654: Freeze the runpy module and stuff it imports (GH-29903)Kumar Aditya2021-12-091-0/+14
|
* bpo-45850: Implement deep-freeze on Windows (#29648)Guido van Rossum2021-11-221-5/+0
| | | | | | Implement changes to build with deep-frozen modules on Windows. Note that we now require Python 3.10 as the "bootstrap" or "host" Python. This causes a modest startup speed (around 7%) on Windows.
* bpo-45696: Deep-freeze selected modules (GH-29118)Guido van Rossum2021-11-111-32/+62
| | | | | | | This gains 10% or more in startup time for `python -c pass` on UNIX-ish systems. The Makefile.pre.in generating code builds on Eric's work for bpo-45020, but the .c file generator is new. Windows version TBD.
* bpo-45395: Make custom frozen modules additions instead of replacements. ↵Eric Snow2021-10-281-7/+12
| | | | | | | | | (gh-28778) Currently custom modules (the array set on PyImport_FrozenModules) replace all the frozen stdlib modules. That can be problematic and is unlikely to be what the user wants. This change treats the custom frozen modules as additions instead. They take precedence over all other frozen modules except for those needed to bootstrap the import system. If the "code" field of an entry in the custom array is NULL then that frozen module is treated as disabled, which allows a custom entry to disable a frozen stdlib module. This change allows us to get rid of is_essential_frozen_module() and simplifies the logic for which frozen modules should be ignored. https://bugs.python.org/issue45395
* bpo-45020: Identify which frozen modules are actually aliases. (gh-28655)Eric Snow2021-10-051-1/+17
| | | | | | | 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-45020: Add more test cases for frozen modules. (gh-28664)Eric Snow2021-10-011-2/+18
| | | | | 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
* bpo-45020: Fix some corner cases for frozen module generation. (gh-28538)Eric Snow2021-09-241-2/+2
| | | | | 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-1/+10
| | | 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-45020: Freeze some of the modules imported during startup. (gh-28335)Eric Snow2021-09-151-0/+19
| | | | | | | 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-45019: Do some cleanup related to frozen modules. (gh-28319)Eric Snow2021-09-131-1/+1
| | | | | 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
* bpo-45019: Add a tool to generate list of modules to include for frozen ↵Eric Snow2021-08-301-23/+51
| | | | | | | 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
* bpo-43372: Use _freeze_importlib for regen-frozen. (GH-24759)Neil Schemenauer2021-03-061-6/+5
| | | | | | | This approach ensures the code matches the interpreter version. Previously, PYTHON_FOR_REGEN was used to generate the code, which might be wrong. The marshal format for code objects has changed with bpo-42246, commit 877df851. Update the code and the expected code sizes in ctypes test_frozentable.
* bpo-39448: Add regen-frozen makefile target. (GH-18174)Neil Schemenauer2021-02-191-16/+6
| | | | | Add the "regen-frozen" makefile target that regenerates the code for the frozen __hello__ module.
* bpo-36540: PEP 570 -- Implementation (GH-12701)Pablo Galindo2019-04-291-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit contains the implementation of PEP570: Python positional-only parameters. * Update Grammar/Grammar with new typedarglist and varargslist * Regenerate grammar files * Update and regenerate AST related files * Update code object * Update marshal.c * Update compiler and symtable * Regenerate importlib files * Update callable objects * Implement positional-only args logic in ceval.c * Regenerate frozen data * Update standard library to account for positional-only args * Add test file for positional-only args * Update other test files to account for positional-only args * Add News entry * Update inspect module and related tests
* bpo-25711: Rewrite zipimport in pure Python. (GH-6809)Serhiy Storchaka2018-09-181-3/+7
|
* Issue #26647: Python interpreter now uses 16-bit wordcode instead of bytecode.Serhiy Storchaka2016-05-241-11/+9
| | | | Patch by Demur Rumed.
* Issue #23911: Move path-based bootstrap code to a separate frozen module.Eric Snow2015-05-031-0/+3
|
* make some freezing related stuff constBenjamin Peterson2013-03-131-2/+2
|
* Issue #2377: Make importlib the implementation of __import__().Brett Cannon2012-04-141-0/+3
| | | | | | | importlib._bootstrap is now frozen into Python/importlib.h and stored as _frozen_importlib in sys.modules. Py_Initialize() loads the frozen code along with sys and imp and then uses _frozen_importlib._install() to set builtins.__import__() w/ _frozen_importlib.__import__().
* Issue #11614: import __hello__ prints "Hello World!". Patch written by AndreasVictor Stinner2011-05-161-8/+11
| | | | Stührk.
* Recorded merge of revisions 81032 via svnmerge fromAntoine Pitrou2010-05-091-14/+14
| | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81032 | antoine.pitrou | 2010-05-09 17:52:27 +0200 (dim., 09 mai 2010) | 9 lines Recorded merge of revisions 81029 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........ ................
* Fix for refleak tests through regrtest.py -R:: bug #1414Christian Heimes2007-11-121-10/+9
| | | | The pre-commit hook doesn't allow a trailing newline
* Patch #1272, by Christian Heimes and Alexandre Vassalotti.Guido van Rossum2007-10-151-1/+1
| | | | | | | | | | Changes to make __file__ a proper Unicode object, using the default filesystem encoding. This is a bit tricky because the default filesystem encoding isn't set by the time we import the first modules; at that point we fudge things a bit. This is okay since __file__ isn't really used much except for error reporting. Tested on OSX and Linux only so far.
* Update the frozen bytecode for __hello__.Guido van Rossum2007-06-121-3/+3
|
* Fix test_frozen.Guido van Rossum2007-02-091-8/+9
|
* Oops, re-add 'static' qualifier.Thomas Wouters2006-12-131-1/+1
|
* Regenerate frozen.c's manual marshal as directed, fixing test_frozen.Thomas Wouters2006-12-131-8/+9
|
* This is my patchMichael W. Hudson2002-08-151-6/+6
| | | | | | | | [ 587993 ] SET_LINENO killer Remove SET_LINENO. Tracing is now supported by inspecting co_lnotab. Many sundry changes to document and adapt to this change.
* Fix SF bug # 561858 Assertion with very long listsNeal Norwitz2002-06-141-7/+7
| | | | | | | Write 4 bytes for co_stacksize, etc. to prevent writing out bad .pyc files which can cause a crash when read back in. (I forgot that frozen needs to be updated too for the test.)
* Squash compiler wng about signed/unsigned mismatch.Tim Peters2001-10-181-1/+1
|
* Fix the frozen bytecode for __hello__ (betcha didn't know that existedGuido van Rossum2001-10-181-5/+12
| | | | | | | | | | :-). Add a test that prevents the __hello__ bytecode from going stale unnoticed again. The test also tests the loophole noted in SF bug #404545. This test will fail right now; I'll check in the fix in a minute.
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-011-9/+0
| | | | This should match the situation in the 1.6b1 tree.
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
|
* Add primitive test for frozen package.Guido van Rossum1998-04-031-0/+4
|
* Oops -- this contains frozen bytecode, but it was Python 1.4 bytecode!Guido van Rossum1997-07-191-7/+7
|
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-13/+20
|
* New style interface via pointer variable.Guido van Rossum1996-06-171-5/+6
|
* grand renaming; added copyright to some filesGuido van Rossum1996-05-281-1/+29
|
* Initial revisionGuido van Rossum1995-08-041-0/+21