summaryrefslogtreecommitdiffstats
path: root/PCbuild
Commit message (Collapse)AuthorAgeFilesLines
* gh-111650: Ensure pyconfig.h includes Py_GIL_DISABLED on Windows (GH-112778)Steve Dower2023-12-133-3/+64
|
* gh-76785: More Fixes for test.support.interpreters (gh-113012)Eric Snow2023-12-122-0/+4
| | | This brings the module (along with the associated extension modules) mostly in sync with PEP 734. There are only a few small things to wrap up.
* gh-71383: Update Tcl/Tk version in Windows to our patched build containing a ↵Steve Dower2023-12-112-4/+4
| | | | targeted upstream fix (GH-112973)
* gh-112538: Add internal-only _PyThreadStateImpl "wrapper" for PyThreadState ↵Sam Gross2023-12-072-0/+4
| | | | | | | | (gh-112560) Every PyThreadState instance is now actually a _PyThreadStateImpl. It is safe to cast from `PyThreadState*` to `_PyThreadStateImpl*` and back. The _PyThreadStateImpl will contain fields that we do not want to expose in the public C API.
* gh-111863: Rename `Py_NOGIL` to `Py_GIL_DISABLED` (#111864)Hugo van Kemenade2023-11-201-1/+1
| | | Rename Py_NOGIL to Py_GIL_DISABLED
* gh-111545: Test PyHash_GetFuncDef() function (#112098)Victor Stinner2023-11-152-0/+4
| | | Add Modules/_testcapi/hash.c and Lib/test/test_capi/test_hash.py.
* gh-111545: Add Include/cpython/pyhash.h header file (#112063)Victor Stinner2023-11-152-0/+4
| | | Move non-limited C API to a new Include/cpython/pyhash.h header file.
* gh-111786: Optimize for space for _PyEval_EvalFrameDefault on MSVC for PGO ↵Michael Droettboom2023-11-091-0/+1
| | | | | | | (#111794) In PGO mode, this function caused a compiler error in MSVC. It turns out that optimizing for space only save the day, and is even faster. However, without PGO, this is neither necessary nor slower.
* gh-111569: Implement Python critical section API (gh-111571)Sam Gross2023-11-086-0/+24
| | | | | | | | Critical sections are helpers to replace the global interpreter lock with finer grained locking. They provide similar guarantees to the GIL and avoid the deadlock risk that plain locking involves. Critical sections are implicitly ended whenever the GIL would be released. They are resumed when the GIL would be acquired. Nested critical sections behave as if the sections were interleaved.
* gh-111520: Integrate the Tier 2 interpreter in the Tier 1 interpreter (#111428)Guido van Rossum2023-11-015-9/+1
| | | | | | | | | | | - There is no longer a separate Python/executor.c file. - Conventions in Python/bytecodes.c are slightly different -- don't use `goto error`, you must use `GOTO_ERROR(error)` (same for others like `unused_local_error`). - The `TIER_ONE` and `TIER_TWO` symbols are only valid in the generated (.c.h) files. - In Lib/test/support/__init__.py, `Py_C_RECURSION_LIMIT` is imported from `_testcapi`. - On Windows, in debug mode, stack allocation grows from 8MiB to 12MiB. - **Beware!** This changes the env vars to enable uops and their debugging to `PYTHON_UOPS` and `PYTHON_LLTRACE`.
* gh-111495: add stub files for C API test modules (GH-111586)Sergey B Kirpichev2023-11-012-0/+35
| | | | | This is to reduce merge conflicts (Modules/Setup.stdlib.in) for subsequent pull requests for the issue.
* gh-90815: Exclude mimalloc .c files from Windows build (#111532)Dino Viehland2023-10-314-112/+0
| | | | * Don't include mimalloc .c's in Windows build * Fix warnings on Windows related to mimalloc
* gh-76785: Move the Cross-Interpreter Code to Its Own File (gh-111502)Eric Snow2023-10-304-0/+12
| | | This is partly to clear this stuff out of pystate.c, but also in preparation for moving some code out of _xxsubinterpretersmodule.c. This change also moves this stuff to the internal API (new: Include/internal/pycore_crossinterp.h). @vstinner did this previously and I undid it. Now I'm re-doing it. :/
* gh-109515: When generating deep frozen modules on Windows, use a list file ↵Riccardo Ghetta2023-10-301-25/+39
| | | | instead of arguments (GH-109516)
* gh-90815: Add mimalloc memory allocator (#109914)Dino Viehland2023-10-305-1/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add mimalloc v2.12 Modified src/alloc.c to remove include of alloc-override.c and not compile new handler. Did not include the following files: - include/mimalloc-new-delete.h - include/mimalloc-override.h - src/alloc-override-osx.c - src/alloc-override.c - src/static.c - src/region.c mimalloc is thread safe and shares a single heap across all runtimes, therefore finalization and getting global allocated blocks across all runtimes is different. * mimalloc: minimal changes for use in Python: - remove debug spam for freeing large allocations - use same bytes (0xDD) for freed allocations in CPython and mimalloc This is important for the test_capi debug memory tests * Don't export mimalloc symbol in libpython. * Enable mimalloc as Python allocator option. * Add mimalloc MIT license. * Log mimalloc in Lib/test/pythoninfo.py. * Document new mimalloc support. * Use macro defs for exports as done in: https://github.com/python/cpython/pull/31164/ Co-authored-by: Sam Gross <colesbury@gmail.com> Co-authored-by: Christian Heimes <christian@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-111065: Add more tests for the C API with the PySys_ prefix (GH-111067)Serhiy Storchaka2023-10-252-0/+4
| | | | | | | * Move existing tests for PySys_GetObject() and PySys_SetObject() into specialized files. * Add test for PySys_GetXOptions() using _testcapi. * Add tests for PySys_FormatStdout(), PySys_FormatStderr(), PySys_WriteStdout() and PySys_WriteStderr() using ctypes.
* gh-109693: Remove pycore_atomic.h (gh-110992)Donghee Na2023-10-172-4/+0
|
* gh-110964: Remove private _PyArg functions (#110966)Victor Stinner2023-10-172-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the following private functions and structures to pycore_modsupport.h internal C API: * _PyArg_BadArgument() * _PyArg_CheckPositional() * _PyArg_NoKeywords() * _PyArg_NoPositional() * _PyArg_ParseStack() * _PyArg_ParseStackAndKeywords() * _PyArg_Parser structure * _PyArg_UnpackKeywords() * _PyArg_UnpackKeywordsWithVararg() * _PyArg_UnpackStack() * _Py_ANY_VARARGS() Changes: * Python/getargs.h now includes pycore_modsupport.h to export functions. * clinic.py now adds pycore_modsupport.h when one of these functions is used. * Add pycore_modsupport.h includes when a C extension uses one of these functions. * Define Py_BUILD_CORE_MODULE in C extensions which now include directly or indirectly (via code generated by Argument Clinic) pycore_modsupport.h: * _csv * _curses_panel * _dbm * _gdbm * _multiprocessing.posixshmem * _sqlite.row * _statistics * grp * resource * syslog * _testcapi: bad_get() no longer uses METH_FASTCALL calling convention but METH_VARARGS. Replace _PyArg_UnpackStack() with PyArg_ParseTuple(). * _testcapi: add PYTESTCAPI_NEED_INTERNAL_API macro which is defined by _testcapi sub-modules which need the internal C API (pycore_modsupport.h): exceptions.c, float.c, vectorcall.c, watchers.c. * Remove Include/cpython/modsupport.h header file. Include/modsupport.h no longer includes the removed header file. * Fix mypy clinic.py
* gh-104169: Refactor tokenizer into lexer and wrappers (#110684)Lysandros Nikolaou2023-10-114-6/+78
| | | | | | | | | | | * The lexer, which include the actual lexeme producing logic, goes into the `lexer` directory. * The wrappers, one wrapper per input mode (file, string, utf-8, and readline), go into the `tokenizer` directory and include logic for creating a lexer instance and managing the buffer for different modes. --------- Co-authored-by: Pablo Galindo <pablogsal@gmail.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* gh-110525: Add tests for internal `set` CAPI (GH-110630)Nikita Sobolev2023-10-101-0/+1
|
* gh-110437: Allow overriding VCRuntimeDLL with a semicolon separated list of ↵Steve Dower2023-10-091-1/+4
| | | | DLLs to bundle (GH-110470)
* gh-110525: Add CAPI tests for set and frozenset objects (GH-110526)Nikita Sobolev2023-10-091-0/+1
|
* gh-109286: Update Windows installer to use SQLite 3.43.1 (#110403)jtranquilli2023-10-063-3/+3
| | | | Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend@python.org>
* gh-88402: Add new sysconfig variables on Windows (GH-110049)Sam Gross2023-10-042-4/+8
| | | | Co-authored-by: Filipe Laíns <filipe.lains@gmail.com>
* gh-108494: Document how to add a project in PCbuild/readme.txt (#110077)Victor Stinner2023-10-021-0/+28
| | | Add _testclinic_limited to Tools/msi/test/test_files.wxs.
* gh-109566: PCbuild/rt.bat now uses --fast-ci (#110120)Victor Stinner2023-09-291-1/+1
| | | | | | Replace "--fail-env-changed --fail-rerun" with "--fast-ci". Tools/buildbot/test.bat pass --slow-ci which has the priority over --fast-ci.
* gh-109991: Update Windows build to use OpenSSL 3.0.11 (GH-110054)Zachary Ware2023-09-282-4/+4
|
* gh-109566: regrtest reexecutes the process (#109909)Victor Stinner2023-09-261-1/+1
| | | | | | | | | | | | | When --fast-ci or --slow-ci option is used, regrtest now replaces the current process with a new process to add "-u -W default -bb -E" options to Python. Changes: * PCbuild/rt.bat and Tools/scripts/run_tests.py no longer need to add "-u -W default -bb -E" options to Python: it's now done by regrtest. * Fix Tools/scripts/run_tests.py: flush stdout before replacing the process. Previously, buffered messages were lost.
* gh-109566: Fix typo in PCbuild/rt.bat (#109701)Victor Stinner2023-09-221-1/+1
|
* gh-109693: Remove pycore_atomic_funcs.h (#109694)Sam Gross2023-09-212-4/+0
| | | _PyUnicode_FromId() now uses pyatomic.h functions instead.
* gh-108724: Add PyMutex and _PyParkingLot APIs (gh-109344)Sam Gross2023-09-194-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | PyMutex is a one byte lock with fast, inlineable lock and unlock functions for the common uncontended case. The design is based on WebKit's WTF::Lock. PyMutex is built using the _PyParkingLot APIs, which provides a cross-platform futex-like API (based on WebKit's WTF::ParkingLot). This internal API will be used for building other synchronization primitives used to implement PEP 703, such as one-time initialization and events. This also includes tests and a mini benchmark in Tools/lockbench/lockbench.py to compare with the existing PyThread_type_lock. Uncontended acquisition + release: * Linux (x86-64): PyMutex: 11 ns, PyThread_type_lock: 44 ns * macOS (arm64): PyMutex: 13 ns, PyThread_type_lock: 18 ns * Windows (x86-64): PyMutex: 13 ns, PyThread_type_lock: 38 ns PR Overview: The primary purpose of this PR is to implement PyMutex, but there are a number of support pieces (described below). * PyMutex: A 1-byte lock that doesn't require memory allocation to initialize and is generally faster than the existing PyThread_type_lock. The API is internal only for now. * _PyParking_Lot: A futex-like API based on the API of the same name in WebKit. Used to implement PyMutex. * _PyRawMutex: A word sized lock used to implement _PyParking_Lot. * PyEvent: A one time event. This was used a bunch in the "nogil" fork and is useful for testing the PyMutex implementation, so I've included it as part of the PR. * pycore_llist.h: Defines common operations on doubly-linked list. Not strictly necessary (could do the list operations manually), but they come up frequently in the "nogil" fork. ( Similar to https://man.freebsd.org/cgi/man.cgi?queue) --------- Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* gh-109566: Run GHA and buildbot tests with --fail-rerun (#109567)Victor Stinner2023-09-191-1/+1
|
* gh-108753: Enhance pystats (#108754)Victor Stinner2023-09-062-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Statistics gathering is now off by default. Use the "-X pystats" command line option or set the new PYTHONSTATS environment variable to 1 to turn statistics gathering on at Python startup. Statistics are no longer dumped at exit if statistics gathering was off or statistics have been cleared. Changes: * Add PYTHONSTATS environment variable. * sys._stats_dump() now returns False if statistics are not dumped because they are all equal to zero. * Add PyConfig._pystats member. * Add tests on sys functions and on setting PyConfig._pystats to 1. * Add Include/cpython/pystats.h and Include/internal/pycore_pystats.h header files. * Rename '_py_stats' variable to '_Py_stats'. * Exclude Include/cpython/pystats.h from the Py_LIMITED_API. * Move pystats.h include from object.h to Python.h. * Add _Py_StatsOn() and _Py_StatsOff() functions. Remove '_py_stats_struct' variable from the API: make it static in specialize.c. * Document API in Include/pystats.h and Include/cpython/pystats.h. * Complete pystats documentation in Doc/using/configure.rst. * Don't write "all zeros" stats: if _stats_off() and _stats_clear() or _stats_dump() were called. * _PyEval_Fini() now always call _Py_PrintSpecializationStats() which does nothing if stats are all zeros. Co-authored-by: Michael Droettboom <mdboom@gmail.com>
* gh-107565: Update Windows build to use OpenSSL 3.0.10 (GH-108928)Zachary Ware2023-09-052-4/+4
| | | Also clean up some intermediate NEWS entries about previous versions.
* gh-108374: Add --disable-gil option to PCbuild/build.bat (#108729)Sam Gross2023-09-022-0/+4
| | | | This adds a `--disable-gil` option to PCbuild/build.bat. For now, all this does is define the Py_NOGIL macro.
* gh-108777: Split _PyTime tests from _testinternalcapi.c (gh-108787)Sam Gross2023-09-022-0/+4
|
* gh-108337: Add pyatomic.h header (#108701)Victor Stinner2023-08-314-0/+18
| | | | | | | | This adds a new header that provides atomic operations on common data types. The intention is that this will be exposed through Python.h, although that is not the case yet. The only immediate use is in the test file. Co-authored-by: Sam Gross <colesbury@gmail.com>
* gh-106320: Remove private pythonrun API (#108599)Victor Stinner2023-08-292-0/+4
| | | | | | | | | | | Remove these private functions from the public C API: * _PyRun_AnyFileObject() * _PyRun_InteractiveLoopObject() * _PyRun_SimpleFileObject() * _Py_SourceAsString() Move them to the internal C API: add a new pycore_pythonrun.h header file. No longer export these functions.
* gh-108240: Add pycore_capsule.h internal header file (#108596)Victor Stinner2023-08-292-0/+4
| | | | Move _PyCapsule_SetTraverse() definition to a new internal header file: pycore_capsule.h.
* gh-106320: Remove private _Py_Identifier API (#108593)Victor Stinner2023-08-292-4/+8
| | | | | | | | | | | | | | | Remove the private _Py_Identifier type and related private functions from the public C API: * _PyObject_GetAttrId() * _PyObject_LookupSpecialId() * _PyObject_SetAttrId() * _PyType_LookupId() * _Py_IDENTIFIER() * _Py_static_string() * _Py_static_string_init() Move them to the internal C API: add a new pycore_identifier.h header file. No longer export these functions.
* gh-108494: Build _testclinic_limited on Windows (#108589)Victor Stinner2023-08-285-62/+195
| | | | | | | | | | | | | | Add _testclinic_limited project to the Visual Studio solution: * In "PCbuild/", copy "_asyncio.vcxproj" to "_testclinic_limited.vcxproj", replace "RootNamespace" with "_testclinic_limited", replace "_asyncio.c" with "_testclinic_limited.c". * Open Visual Studio, open "PCbuild\pcbuild.sln", add the existing "PCbuild\_testclinic_limited.vcxproj" project to the solution. * Add a dependency from "python" project to the "_testclinic_limited" project. * Save and exit Visual Studio. * Add ";_testclinic_limited" to "<TestModules Include="...">" in "PCbuild\pcbuild.proj".
* gh-105481: remove regen-opcode. Generated _PyOpcode_Caches in regen-cases. ↵Irit Katriel2023-08-231-12/+2
| | | | (#108367)
* gh-105481: opcode.h is no longer generated during the build (#108080)Irit Katriel2023-08-171-2/+2
|
* gh-105481: generate op IDs from bytecode.c instead of hard coding them in ↵Irit Katriel2023-08-161-2/+2
| | | | opcode.py (#107971)
* gh-107557: Setup abstract interpretation (#107847)Ken Jin2023-08-154-0/+16
| | | | Co-authored-by: Guido van Rossum <gvanrossum@users.noreply.github.com> Co-authored-by: Jules <57632293+juliapoo@users.noreply.github.com>
* gh-105481: split opcode_ids.h out of opcode.h so that it can be generated ↵Irit Katriel2023-08-111-1/+1
| | | | separately (#107866)
* gh-107814: Avoid output from Nuget installation in find_python.bat (GH-107815)Max Bachmann2023-08-091-2/+6
|
* gh-91795: Update build optimization part of PCbuild/readme.txt (GH-91849)Fatih2023-08-081-3/+5
|
* gh-107178: Add the C API tests for the Abstract Objects Layer (GH-107179)Serhiy Storchaka2023-08-072-0/+8
| | | | | | | | | | Cover all the Mapping Protocol, almost all the Sequence Protocol (except PySequence_Fast) and a part of the Object Protocol. Move existing tests to Lib/test/test_capi/test_abstract.py and Modules/_testcapi/abstract.c. Add also tests for PyDict C API.
* gh-105481: combine regen-opcode-targets with regen-opcode to avoid ↵Irit Katriel2023-08-011-3/+1
| | | | calculating the specialized opcodes in two places (#107540)