Commit Graph

23 Commits

Author SHA1 Message Date
Petr Viktorin 2c228a7b8f
bpo-46748: Don't import <stdbool.h> in public headers (GH-31553)
<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
2022-02-25 09:25:54 +01:00
Kumar Aditya bf95ff91f2
bpo-46608: exclude marshalled-frozen data if deep-freezing to save 300 KB 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
2022-02-04 09:57:03 -08:00
Victor Stinner eaede0ded7
bpo-44131: Test Py_FrozenMain() (GH-26126)
* Add test_frozenmain to test_embed
* Add Programs/test_frozenmain.py
* Add Programs/freeze_test_frozenmain.py
* Add Programs/test_frozenmain.h
* Add make regen-test-frozenmain
* Add test_frozenmain command to Programs/_testembed
* _testembed.c: add error(msg) function
2021-05-17 23:48:35 +02:00
Serhiy Storchaka 53c3fb186a Issue #22826: The result of open() in Tools/freeze/bkfile.py is now better
compatible with regular files (in particular it now supports the context
management protocol).
2015-03-20 09:21:59 +02:00
Ezio Melotti 7c4a7e6f3c #18803: fix more typos. Patch by Févry Thibault. 2013-08-26 01:32:56 +03:00
Guido van Rossum 5397039504 Minimal changes to make the "freeze" tool work again.
There are other issues left, but these were basics (e.g. keys().sort()).
2007-06-12 00:28:30 +00:00
Guido van Rossum 96bf7e8a37 Fix test_frozen. 2007-02-09 23:27:01 +00:00
Tim Peters 182b5aca27 Whitespace normalization, via reindent.py. 2004-07-18 06:16:08 +00:00
Walter Dörwald 70a6b49821 Replace backticks with repr() or "%r"
From SF patch #852334.
2004-02-12 17:35:32 +00:00
Walter Dörwald aaab30e00c Apply diff2.txt from SF patch http://www.python.org/sf/572113
(with one small bugfix in bgen/bgen/scantools.py)

This replaces string module functions with string methods
for the stuff in the Tools directory. Several uses of
string.letters etc. are still remaining.
2002-09-11 20:36:02 +00:00
Marc-André Lemburg 64b4f2770e Updated freeze.py to the new Makefile symbol layout.
Fixed a few compiler warnings.

freeze.py now produces binaries which can import shared
modules (unlike before).
2002-04-04 16:15:41 +00:00
Guido van Rossum 03f7f08874 Part 2/2 of SF patch #416704: More robust freeze, by Toby Dickenson.
(With slight cosmetic improvements to shorten lines and a grammar fix
to a docstring.)

This addes -X and -E options to freeze.  From the docstring:

-X module     Like -x, except the module can never be imported by
              the frozen binary.

-E:           Freeze will fail if any modules can't be found (that
              were not excluded using -x or -X).
2001-10-18 19:15:32 +00:00
Tim Peters dbd9ba6a6c Nuke all remaining occurrences of Py_PROTO and Py_FPROTO. 2000-07-09 03:09:57 +00:00
Guido van Rossum cfd76a202b Sjoerd Mullender:
Added some declarations to shut up compiler.
1999-11-02 15:44:40 +00:00
Guido van Rossum baf0603493 New version, with contributions from Sjoerd Mullender and Mark Hammond.
Sjoerd writes:

This version of freeze creates one file per Python module, instead of
one humongous file for all Python modules.
bkfile: new module to used to write files with backups.  No new file
is produced if the new contents is identical to the old.
New option "-x excluded-module" for modulefinder test program.
New option "-i filename" for freeze main program to include a list of
options in place of the -i option.
1998-08-25 14:06:55 +00:00
Guido van Rossum ce5988b3d9 Remove Emacs cruft. 1998-05-18 20:22:31 +00:00
Guido van Rossum 1abfb9c0f5 If freezing with the -O option, the optimized bytecode files are
used.  It is useful to implicitly set the -O flag in the frozen
application.
(Sjoerd Mullender)
1998-04-23 14:39:05 +00:00
Guido van Rossum 78fc3634cb Big changes by Mark Hammond to support freezing with DLLs on Windows. 1998-03-20 17:37:24 +00:00
Guido van Rossum 912a14c028 Reindented, removed tabs. 1998-03-05 04:56:37 +00:00
Guido van Rossum 75dc4969ab Added support for packages.
We have a whole new module finder that uses the actual Python
parser and scans the bytecode for IMPORT_NAME and IMPORT_FROM.
This requires some support in import.c (that hasn't been checked in).
New command line options for this: -d, -q, -m.
1998-03-05 03:42:00 +00:00
Guido van Rossum b3afce5763 Updated for new style build/install; much simpler! 1997-07-19 21:58:30 +00:00
Guido van Rossum f75f80eb48 Get struct _frozen defn from Python.h; new variable names. 1996-06-17 17:48:30 +00:00
Guido van Rossum 00ff4336a9 Totally new "freeze" program. 1994-10-03 16:33:08 +00:00