summaryrefslogtreecommitdiffstats
path: root/Makefile.pre.in
Commit message (Collapse)AuthorAgeFilesLines
* gh-102304: Move _Py_RefTotal to _PyRuntimeState (gh-102543)Eric Snow2023-03-201-0/+1
| | | | | | | The essentially eliminates the global variable, with the associated benefits. This is also a precursor to isolating this bit of state to PyInterpreterState. Folks that currently read _Py_RefTotal directly would have to start using _Py_GetGlobalRefTotal() instead. https://github.com/python/cpython/issues/102304
* gh-102654: Insert #line directives in generated_cases.c.h (#102669)Guido van Rossum2023-03-151-0/+1
| | | | | | | | | This behavior is optional, because in some extreme cases it may just make debugging harder. The tool defaults it to off, but it is on in Makefile.pre.in. Also note that this makes diffs to generated_cases.c.h noisier, since whenever you insert or delete a line in bytecodes.c, all subsequent #line directives will change.
* gh-81057: Add a CI Check for New Unsupported C Global Variables (gh-102506)Eric Snow2023-03-141-0/+6
| | | | | | | | | | | This will keep us from adding new unsupported (i.e. non-const) C global variables, which would break interpreter isolation. FYI, historically it is very uncommon for new global variables to get added. Furthermore, it is rare for new code to break the c-analyzer. So the check should almost always pass unnoticed. Note that I've removed test_check_c_globals. A test wasn't a great fit conceptually and was super slow on debug builds. A CI check is a better fit. This also resolves gh-100237. https://github.com/python/cpython/issues/81057
* gh-102021 : Allow multiple input files for interpreter loop generator (#102022)Jacob Bower2023-03-041-2/+2
| | | The input files no longer use `-i`.
* gh-99108: Import MD5 and SHA1 from HACL* (#102089)Jonathan Protzenko2023-02-221-5/+9
| | | Replaces our fallback non-OpenSSL MD5 and SHA1 implementations with those from HACL* as we've already done with SHA2.
* gh-97930: Also include subdirectory in makefile. (#102030)Jason R. Coombs2023-02-191-0/+2
|
* gh-99108: Refactor _sha256 & _sha512 into _sha2. (#101924)Gregory P. Smith2023-02-161-8/+7
| | | | | | | | | This merges their code. They're backed by the same single HACL* static library, having them be a single module simplifies maintenance. This should unbreak the wasm enscripten builds that currently fail due to linking in --whole-archive mode and the HACL* library appearing twice. Long unnoticed error fixed: _sha512.SHA384Type was doubly assigned and was actually SHA512Type. Nobody depends on those internal names. Also rename LIBHACL_ make vars to LIBHACL_SHA2_ in preperation for other future HACL things.
* gh-99108: Build the hashlib HACL* code as a static library. (#101917)Gregory P. Smith2023-02-141-2/+31
| | | | | | This builds HACL* as a library in one place. A followup to #101707 which broke some WASM builds. This fixes 2/4 of them, but the enscripten toolchain in the others don't deduplicate linker arguments and error out. A follow-on PR will address those.
* gh-99108: Import SHA2-384/512 from HACL* (#101707)Jonathan Protzenko2023-02-141-1/+1
| | | | | | Replace the builtin hashlib implementations of SHA2-384 and SHA2-512 originally from LibTomCrypt with formally verified, side-channel resistant code from the [HACL*](https://github.com/hacl-star/hacl-star/) project. The builtins remain a fallback only used when OpenSSL does not provide them.
* gh-98831: Use opcode metadata for stack_effect() (#101704)Guido van Rossum2023-02-091-10/+7
| | | | | | | | | | * Write output and metadata in a single run This halves the time to run the cases generator (most of the time goes into parsing the input). * Declare or define opcode metadata based on NEED_OPCODE_TABLES * Use generated metadata for stack_effect() * compile.o depends on opcode_metadata.h * Return -1 from _PyOpcode_num_popped/pushed for unknown opcode
* gh-100221: Fix creating dirs in `make sharedinstall` (GH-100329)Michał Górny2023-02-081-12/+9
| | | | | Fix creating install directories in `make sharedinstall` if they exist already outside `DESTDIR`. The previous make rules assumed that the directories would be created via a dependency on a rule for `$(DESTSHARED)` that did not fire if the directory did exist outside `$(DESTDIR)`. While technically `$(DESTDIR)` could be prepended to the rule name, moving the rules for creating directories straight into the `sharedinstall` rule seems to fit the common practices better. Since the rule explicitly checks whether the individual directories exist anyway, there seems to be no reason to rely on make determining that implicitly as well.
* gh-99108: Replace SHA2-224 & 256 with verified code from HACL* (#99109)Jonathan Protzenko2023-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | replacing hashlib primitives (for the non-OpenSSL case) with verified implementations from HACL*. This is the first PR in the series, and focuses specifically on SHA2-256 and SHA2-224. This PR imports Hacl_Streaming_SHA2 into the Python tree. This is the HACL* implementation of SHA2, which combines a core implementation of SHA2 along with a layer of buffer management that allows updating the digest with any number of bytes. This supersedes the previous implementation in the tree. @franziskuskiefer was kind enough to benchmark the changes: in addition to being verified (thus providing significant safety and security improvements), this implementation also provides a sizeable performance boost! ``` --------------------------------------------------------------- Benchmark Time CPU Iterations --------------------------------------------------------------- Sha2_256_Streaming 3163 ns 3160 ns 219353 // this PR LibTomCrypt_Sha2_256 5057 ns 5056 ns 136234 // library used by Python currently ``` The changes in this PR are as follows: - import the subset of HACL* that covers SHA2-256/224 into `Modules/_hacl` - rewire sha256module.c to use the HACL* implementation Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-101282: Update BOLT --split-functions flag not to use deprecated u… ↵Dong-hee Na2023-02-041-1/+1
| | | | | (gh-101557) gh-101282: Update BOLT --split-functions flag not to use deprecated usage
* gh-101047: Remove vestigial references to macOS libtool options (gh-101048)Gregory Szorc2023-01-221-3/+0
| | | | LIBTOOL_CRUFT and OTHER_LIBTOOL_OPT variables have been unused since commit 19199830f7f880b1e9cff5d92d30706fd8bb4700 in 2011.
* GH-98831: Move assorted macros from ceval.h to a new header (#101116)Guido van Rossum2023-01-181-2/+6
|
* gh-100764: add `pycore_frame.h` to PYTHON_HEADERS and Windows build ↵Carl Meyer2023-01-091-0/+1
| | | | files(#100765)
* GH-98831: Update generate_cases.py: register inst, opcode_metadata.h (#100735)Guido van Rossum2023-01-051-0/+9
| | | | | | | | (These aren't used yet, but may be coming soon, and it's easier to keep this tool the same between branches.) Added a sanity check for all this to compile.c. Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
* GH-99005: Add `CALL_INTRINSIC_1` instruction (GH-100771)Mark Shannon2023-01-051-0/+2
| | | | | | | | * Remove PRINT_EXPR instruction * Remove STOPITERATION_ERROR instruction * Remove IMPORT_STAR instruction
* gh-100540: Remove obsolete Modules/_ctypes/darwin/ dlfcn shim (GH-100541)Zachary Ware2022-12-291-1/+1
| | | As far as I can tell, this hasn't been actually used since Mac OS X 10.2.
* gh-81057: Move faulthandler Globals to _PyRuntimeState (gh-100152)Eric Snow2022-12-121-0/+1
| | | https://github.com/python/cpython/issues/81057
* gh-81057: Move tracemalloc Globals to _PyRuntimeState (gh-100151)Eric Snow2022-12-121-0/+1
| | | https://github.com/python/cpython/issues/81057
* gh-99582: freeze `zipimport` into `_bootstrap_python` (#99583)Kai Zhang2022-12-101-1/+2
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-81057: Move Threading-Related Globals to _PyRuntimeState (#100084)Eric Snow2022-12-091-0/+1
| | | https://github.com/python/cpython/issues/81057
* gh-81057: Move Ceval Trampoline Globals to _PyRuntimeState (gh-100083)Eric Snow2022-12-091-0/+1
| | | https://github.com/python/cpython/issues/81057
* gh-81057: Move time Globals to _PyRuntimeState (gh-100122)Eric Snow2022-12-081-1/+1
| | | https://github.com/python/cpython/issues/81057
* gh-81057: Move OS-Related Globals to _PyRuntimeState (gh-100082)Eric Snow2022-12-081-0/+1
| | | https://github.com/python/cpython/issues/81057
* Fix zipfile packaging after GH-98103 (GH-99797)Jason R. Coombs2022-11-261-0/+2
| | | | | * Add zipfile and test_zipfile to list of packages. Fixes regression introduced in #98103. * Restore support for py -m test.test_zipfile
* gh-79315: Add Include/cpython/memoryobject.h header (#99723)Victor Stinner2022-11-231-0/+1
| | | | Move non-limited C API from Include/memoryobject.h to a new Include/cpython/memoryobject.h header file.
* gh-93649: Split float/long tests from _testcapimodule.c (GH-99549)Erlend E. Aasland2022-11-171-1/+1
| | | Automerge-Triggered-By: GH:erlend-aasland
* gh-81057: Move the global Dict-Related Versions to _PyRuntimeState (gh-99497)Eric Snow2022-11-161-0/+1
| | | | | We also move the global func version. https://github.com/python/cpython/issues/81057
* gh-96269: static and shared ext need different deps (#96316)Christian Heimes2022-11-161-1/+3
|
* gh-99289: Add COMPILEALL_OPTS to Makefile (#99291)Victor Stinner2022-11-141-21/+6
| | | | | | | | Add COMPILEALL_OPTS variable in Makefile to override compileall options (default: -j0) in "make install". Also merge the compileall commands into a single command building PYC files for the all optimization levels (0, 1, 2) at once. Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-81057: Move the Allocators to _PyRuntimeState (gh-99217)Eric Snow2022-11-111-0/+3
| | | | | The global allocators were stored in 3 static global variables: _PyMem_Raw, _PyMem, and _PyObject. State for the "small block" allocator was stored in another 13. That makes a total of 16 global variables. We are moving all 16 to the _PyRuntimeState struct as part of the work for gh-81057. (If PEP 684 is accepted then we will follow up by moving them all to PyInterpreterState.) https://github.com/python/cpython/issues/81057
* gh-98707: configure --with-system-libmpdec and --with-system-expat no longer ↵Miro Hrončok2022-11-111-3/+3
| | | | include vendored headers (#98711)
* gh-90868: Adjust the Generated Objects (gh-99223)Eric Snow2022-11-081-0/+2
| | | | | | | | | | | We do the following: * move the generated _PyUnicode_InitStaticStrings() to its own file * move the generated _PyStaticObjects_CheckRefcnt() to its own file * include pycore_global_objects.h in extension modules instead of pycore_runtime_init.h These changes help us avoid including things that aren't needed. https://github.com/python/cpython/issues/90868
* GH-98831: Add `regen-cases` to `regen-all` (#99107)Brandt Bucher2022-11-041-1/+1
|
* gh-92584: Remove the distutils package (#99061)Victor Stinner2022-11-031-7/+1
| | | | | | | | | | | | Remove the distutils package. It was deprecated in Python 3.10 by PEP 632 "Deprecate distutils module". For projects still using distutils and cannot be updated to something else, the setuptools project can be installed: it still provides distutils. * Remove Lib/distutils/ directory * Remove test_distutils * Remove references to distutils * Skip test_check_c_globals and test_peg_generator since they use distutils
* gh-98948: Remove obsolete readelf dependency (#98949)serge-sans-paille2022-11-031-1/+0
| | | | | This got introduced in commit 5884449539510313c826d69835829c7957c7154a to determine if readline is already linked against curses or tinfo in the setup.py, which is no longer present.
* GH-98831: "Generate" the interpreter (#98830)Guido van Rossum2022-11-031-1/+13
| | | | | | | | | | | The switch cases (really TARGET(opcode) macros) have been moved from ceval.c to generated_cases.c.h. That file is generated from instruction definitions in bytecodes.c (which impersonates a C file so the C code it contains can be edited without custom support in e.g. VS Code). The code generator lives in Tools/cases_generator (it has a README.md explaining how it works). The DSL used to describe the instructions is a work in progress, described in https://github.com/faster-cpython/ideas/blob/main/3.12/interpreter_definition.md. This is surely a work-in-progress. An easy next step could be auto-generating super-instructions. **IMPORTANT: Merge Conflicts** If you get a merge conflict for instruction implementations in ceval.c, your best bet is to port your changes to bytecodes.c. That file looks almost the same as the original cases, except instead of `TARGET(NAME)` it uses `inst(NAME)`, and the trailing `DISPATCH()` call is omitted (the code generator adds it automatically).
* gh-97731: Specify the full path to the docs for `make docclean` (GH-98982)Brett Cannon2022-11-021-1/+1
| | | | Specify the full path to the docs for `make docclean` This is to have `make clean` not error out on cross-builds.
* gh-98776: Fix make regen-test-levenshtein for out-of-tree builds (GH-98779)Miro Hrončok2022-10-281-1/+1
| | | | | Fixes https://github.com/python/cpython/issues/98776 Automerge-Triggered-By: GH:erlend-aasland
* gh-96143: Move the perf trampoline files to the Python directory (#98675)Pablo Galindo Salgado2022-10-251-2/+2
|
* gh-97669: Create Tools/build/ directory (#97963)Victor Stinner2022-10-171-31/+31
| | | | | | | | | | | | | | | | | | | | | | | 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.
* gh-97669: Create Tools/patchcheck/ directory (#98186)Victor Stinner2022-10-121-2/+2
| | | | Move patchcheck.py, reindent.py and untabify.py scripts to a new Tools/patchcheck/ directory.
* gh-94808: Fix regex on exotic platforms (#98036)Jelle Zijlstra2022-10-071-0/+1
| | | | | The test failed on a buildbot because the pointer was only 7 hex characters. To be safe, I bumped it down to 3: 4 in case we have 32-bit platforms, and 3 in case the pointer is very small.
* gh-97008: Add a Python implementation of AttributeError and NameError ↵Łukasz Langa2022-10-041-1/+6
| | | | | | | | | suggestions (#97022) Relevant tests moved from test_exceptions to test_traceback to be able to compare both implementations. Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
* gh-97731: fix distclean target to clean docs (#97732)Skip Montanaro2022-10-041-4/+3
| | | fix distclean target to clean docs
* gh-95853: Multiple ops and debug for wasm_build.py (#96744)Christian Heimes2022-09-111-0/+4
|
* gh-96143: Allow Linux perf profiler to see Python calls (GH-96123)Pablo Galindo Salgado2022-08-301-1/+6
| | | | | | | :warning: :warning: Note for reviewers, hackers and fellow systems/low-level/compiler engineers :warning: :warning: If you have a lot of experience with this kind of shenanigans and want to improve the **first** version, **please make a PR against my branch** or **reach out by email** or **suggest code changes directly on GitHub**. If you have any **refinements or optimizations** please, wait until the first version is merged before starting hacking or proposing those so we can keep this PR productive.
* gh-95973: Add a new --with-dsymutil option to link debug information in ↵Pablo Galindo Salgado2022-08-271-2/+43
| | | | | macOS (GH-95974) Automerge-Triggered-By: GH:pablogsal