aboutsummaryrefslogtreecommitdiff
path: root/Makefile.pre.in
AgeCommit message (Collapse)Author
2022-02-22bpo-45459: Rename buffer.h to pybuffer.h (#31201)Victor Stinner
Rename Include/buffer.h header file to Include/pybuffer.h to avoid conflicts with projects having an existing "buffer.h" header file. * Incude pybuffer.h before object.h in Python.h. * Remove #include "buffer.h" from Include/cpython/object.h. * Add a forward declaration of the PyObject type in pybuffer.h to fix an inter-dependency issue.
2022-02-15bpo-46541: Drop the check for orphaned global strings. (gh-31363)Eric Snow
https://bugs.python.org/issue46541
2022-02-14Regen the global objects using PYTHON_FOR_REGEN. (gh-31344)Eric Snow
https://bugs.python.org/issue46541
2022-02-08bpo-46541: Replace core use of _Py_IDENTIFIER() with statically initialized ↵Eric Snow
global objects. (gh-30928) We're no longer using _Py_IDENTIFIER() (or _Py_static_string()) in any core CPython code. It is still used in a number of non-builtin stdlib modules. The replacement is: PyUnicodeObject (not pointer) fields under _PyRuntimeState, statically initialized as part of _PyRuntime. A new _Py_GET_GLOBAL_IDENTIFIER() macro facilitates lookup of the fields (along with _Py_GET_GLOBAL_STRING() for non-identifier strings). https://bugs.python.org/issue46541#msg411799 explains the rationale for this change. The core of the change is in: * (new) Include/internal/pycore_global_strings.h - the declarations for the global strings, along with the macros * Include/internal/pycore_runtime_init.h - added the static initializers for the global strings * Include/internal/pycore_global_objects.h - where the struct in pycore_global_strings.h is hooked into _PyRuntimeState * Tools/scripts/generate_global_objects.py - added generation of the global string declarations and static initializers I've also added a --check flag to generate_global_objects.py (along with make check-global-objects) to check for unused global strings. That check is added to the PR CI config. The remainder of this change updates the core code to use _Py_GET_GLOBAL_IDENTIFIER() instead of _Py_IDENTIFIER() and the related _Py*Id functions (likewise for _Py_GET_GLOBAL_STRING() instead of _Py_static_string()). This includes adding a few functions where there wasn't already an alternative to _Py*Id(), replacing the _Py_Identifier * parameter with PyObject *. The following are not changed (yet): * stop using _Py_IDENTIFIER() in the stdlib modules * (maybe) get rid of _Py_IDENTIFIER(), etc. entirely -- this may not be doable as at least one package on PyPI using this (private) API * (maybe) intern the strings during runtime init https://bugs.python.org/issue46541
2022-02-02 bpo-45459: Add Py_buffer to limited API (GH-29991)Christian Heimes
- [x] ``Py_buffer`` struct - [x] ``PyBuffer_*()`` API functions - [x] ``PyBUF_*`` constants - [x] ``Py_bf_getbuffer`` and ``Py_bf_releasebuffer`` type slots - [x] ``PyMemoryView_FromBuffer()`` API - [x] tests for limited API - [x] ``make regen-limited-abi`` - [x] documentation update - [ ] export ``PyPickleBuffer*()`` API ???
2022-01-27bpo-46541: Generate the global objects initializer. (gh-30941)Eric Snow
This change is a prerequisite for generating code for other global objects (like strings in gh-30928). (We borrowed some code from Tools/scripts/deepfreeze.py.) https://bugs.python.org/issue46541
2022-01-27make regen-all now suggests running: make autoconf (GH-30893)Victor Stinner
"make autoconf" also runs autoheader, whereas "autoconf" does not.
2022-01-26bpo-35134: Add Include/cpython/descrobject.h (GH-30923)Victor Stinner
Move Include/descrobject.h non-limited API to a new Include/cpython/descrobject.h header file.
2022-01-20bpo-46429: Merge all deepfrozen files into one (GH-30572)Kumar Aditya
2022-01-14bpo-40280: Build WASM stdlib bundle and more modules for node (GH-30597)Christian Heimes
2022-01-13bpo-46370: Move the static initializer for _PyRuntime to its own header ↵Eric Snow
file. (gh-30587) https://bugs.python.org/issue46370
2022-01-13bpo-44133: Link Python executable with object files (GH-30556)Victor Stinner
When Python is built without --enable-shared, the "python" program is now linked to object files, rather than being linked to the Python library (libpython.a), to make sure that all symbols are exported. Previously, the linker omitted some symbols like the Py_FrozenMain() function. When Python is configured with --without-static-libpython, the Python static library (libpython.a) is no longer built. * Check --without-static-libpython earlier in configure.ac * Add LINK_PYTHON_OBJS and LINK_PYTHON_DEPS variables to Makefile. * test_capi now ensures that the "Py_FrozenMain" symbol is exported.
2022-01-12bpo-40280: Add --with-emscripten-target to build for browser or node (GH-30552)Christian Heimes
Co-authored-by: Ethan Smith <ethan@ethanhs.me>
2021-12-30bpo-46118: Make sure importlib.resources is included. (GH-30311)Jason R. Coombs
2021-12-18bpo-40280: Add Tools/wasm with helpers for cross building (GH-29984)Christian Heimes
Co-authored-by: Ethan Smith <ethan@ethanhs.me> Co-authored-by: Brett Cannon <brett@python.org>
2021-12-13bpo-45953: Statically initialize the small ints. (gh-30092)Eric Snow
The array of small PyLong objects has been statically declared. Here I also statically initialize them. Consequently they are no longer initialized dynamically during runtime init. I've also moved them under a new sub-struct in _PyRuntimeState, in preparation for static allocation and initialization of other global objects. https://bugs.python.org/issue45953
2021-12-13bpo-45949: Pure Python freeze module for cross builds (GH-29899)Christian Heimes
2021-12-10bpo-45654: No need to freeze types (GH-30028)Christian Heimes
2021-12-09bpo-46008: Make runtime-global object/type lifecycle functions and state ↵Eric Snow
consistent. (gh-29998) This change is strictly renames and moving code around. It helps in the following ways: * ensures type-related init functions focus strictly on one of the three aspects (state, objects, types) * passes in PyInterpreterState * to all those functions, simplifying work on moving types/objects/state to the interpreter * consistent naming conventions help make what's going on more clear * keeping API related to a type in the corresponding header file makes it more obvious where to look for it https://bugs.python.org/issue46008
2021-12-09bpo-45654: Freeze the runpy module and stuff it imports (GH-29903)Kumar Aditya
2021-12-07bpo-45582: Fix framework path and bootstrap build (GH-29954)Christian Heimes
* Check NS API return values for NULL to prevent segfault in ``_bootstrap_python``. * Set modPathInitialized to 1 so the ``decode_to_dict`` path is used. Signed-off-by: Christian Heimes <christian@python.org>
2021-12-06bpo-45950: Fix macOS framework builds of _bootstrap_python (GH-29936)Christian Heimes
2021-12-03bpo-45950: Introduce Bootstrap Python again (#29859)Christian Heimes
The build system now uses a :program:`_bootstrap_python` interpreter for freezing and deepfreezing again. To speed up build process the build tools :program:`_bootstrap_python` and :program:`_freeze_module` are no longer build with LTO. Cross building depends on a build Python interpreter, which must have same version and bytecode as target host Python.
2021-12-03bpo-45582: Fix out-of-tree build issues with new getpath (GH-29902)Christian Heimes
2021-12-03bpo-45582: Port getpath[p].c to Python (GH-29041)Steve Dower
The getpath.py file is frozen at build time and executed as code over a namespace. It is never imported, nor is it meant to be importable or reusable. However, it should be easier to read, modify, and patch than the previous code. This commit attempts to preserve every previously tested quirk, but these may be changed in the future to better align platforms.
2021-11-29bpo-45881: configure --with-freeze-module --with-build-python (GH-29835)Christian Heimes
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no> Co-authored-by: Ethan Smith <ethan@ethanhs.me>
2021-11-26bpo-45886: Fix OOT build when srcdir has frozen module headers (GH-29793)Christian Heimes
The presence of frozen module headers in srcdir interfers with OOT build. Make considers headers in srcdir up to date, but later builds do not use VPATH to locate files. make clean now removes the headers, too. Also remove stale ``_bootstrap_python`` from .gitignore.
2021-11-26bpo-40280: clean and ignore .wasm files (GH-29794)Christian Heimes
2021-11-25bpo-33393: Update config.guess and config.sub (GH-29781)Christian Heimes
2021-11-24bpo-45886: Allow overriding freeze command for cross compiling (GH-29735)Christian Heimes
2021-11-23bpo-45873: Get rid of bootstrap_python (#29717)Guido van Rossum
Instead we use $(PYTHON_FOR_REGEN) .../deepfreeze.py with the frozen .h file as input, as we did for Windows in bpo-45850. We also get rid of the code that generates the .h files when make regen-frozen is run (i.e., .../make_frozen.py), and the MANIFEST file. Restore Python 3.8 and 3.9 as Windows host Python again Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2021-11-23bpo-44525: Copy free variables in bytecode to allow calls to inner functions ↵Mark Shannon
to be specialized (GH-29595) * Make internal APIs that take PyFrameConstructor take a PyFunctionObject instead. * Add reference to function to frame, borrow references to builtins and globals. * Add COPY_FREE_VARS instruction to allow specialization of calls to inner functions.
2021-11-23bpo-45561: Run smelly.py tool from $(srcdir) (GH-29138)Neil Schemenauer
2021-11-22Fix out-of-tree build support for multissltest (GH-29694)Christian Heimes
2021-11-21Refactor parser compilation units into specific components (GH-29676)Pablo Galindo Salgado
2021-11-20bpo-45847: Port test modules to PY_STDLIB_MOD (GH-29660)Christian Heimes
2021-11-19bpo-45573: Move mandatory core modules to Modules/Setup.bootstrap (GH-29616)Christian Heimes
2021-11-19bpo-45774: Autoconfiscate SQLite detection (GH-29507)Erlend Egeberg Aasland
Co-authored-by: Christian Heimes <christian@python.org>
2021-11-18bpo-45573: Add Modules/Setup.stdlib with conditional modules (GH-29615)Christian Heimes
2021-11-18bpo-45573: Introduce extension module flags in Makefile (GH-29594)Christian Heimes
``configure`` now uses a standardized format to forward state, compiler flags, and linker flags to ``Makefile``, ``setup.py``, and ``Modules/Setup``. ``makesetup`` use the new variables by default if a module line does not contain any compiler or linker flags. ``setup.py`` has a new function ``addext()``. For a module ``egg``, configure adds: * ``MODULE_EGG`` with value yes, missing, disabled, or n/a * ``MODULE_EGG_CFLAGS`` * ``MODULE_EGG_LDFLAGS`` ``Makefile.pre.in`` may also provide ``MODULE_EGG_DEPS`` that lists dependencies such as header files and static libs. Signed-off-by: Christian Heimes <christian@python.org>
2021-11-14bpo-45573: Use Makefile's dependencies in setup.py (GH-29559)Christian Heimes
2021-11-14bpo-45800: Move pyexpat build setup into configure (GH-29547)Christian Heimes
Settings for :mod:`pyexpat` C extension are now detected by ``configure``. The bundled ``expat`` library is built in ``Makefile``. Signed-off-by: Christian Heimes <christian@python.org>
2021-11-13bpo-45798: Move _decimal build setup into configure (GH-29541)Christian Heimes
Settings for :mod:`decimal` internal C extension are now detected by :program:`configure`. The bundled `libmpdec` library is built in ``Makefile``. Signed-off-by: Christian Heimes <christian@python.org>
2021-11-10bpo-45696: Deep-freeze selected modules (GH-29118)Guido van Rossum
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.
2021-11-02makefile: remove unused SGI_ABI variable (GH-29325)Filipe Laíns
SGI_ABI support was removed in [1] but this variable was never removed from the makefile. Currently, it is just a bad variable that does not get replaced by the configure script. [1] https://github.com/python/cpython/pull/3294 Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-10-29bpo-10572: Move `sqlite3` tests to `Lib/test` (GH-29304)Erlend Egeberg Aasland
Automerge-Triggered-By: GH:brettcannon
2021-10-29bpo-45548: Some test modules must be built as shared libs (GH-29268)Christian Heimes
Some test cases don't work when test modules are static extensions. Add dependency on Modules/config.c to trigger a rebuild whenever a module build type is changed. ``makesetup`` puts shared extensions into ``Modules/`` directory. Create symlinks from pybuilddir so the extensions can be imported. Note: It is not possible to use the content of pybuilddir.txt as a build target. Makefile evaluates target variables in the first pass. The pybuilddir.txt file does not exist at that point.
2021-10-26bpo-45548: makesetup improvements (GH-29225)Christian Heimes
* record which modules are build as shared extensions * put object files in same directory as source files * remove dependency on deleted _math.c Signed-off-by: Christian Heimes <christian@python.org>
2021-10-25bpo-45595: Make extensions depend on header files (GH-29198)Christian Heimes
``setup.py`` and ``makesetup`` now track build dependencies on all Python header files and module specific header files. Signed-off-by: Christian Heimes <christian@python.org>
2021-10-25bpo-45548: Remove _math.c workarounds for pre-C99 libm (GH-29179)Christian Heimes
The :mod:`math` and :mod:`cmath` implementation now require a C99 compatible ``libm`` and no longer ship with workarounds for missing acosh, asinh, expm1, and log1p functions. The changeset also removes ``_math.c`` and moves the last remaining workaround into ``_math.h``. This simplifies static builds with ``Modules/Setup`` and resolves symbol conflicts. Co-authored-by: Mark Dickinson <mdickinson@enthought.com> Co-authored-by: Brett Cannon <brett@python.org> Signed-off-by: Christian Heimes <christian@python.org>