Commit graph

923 commits

Author SHA1 Message Date
Jeffrey Bosboom
5a31024da4
gh-83714: Check for struct statx.stx_atomic_write_unit_max_opt in configure (#140185)
stx_atomic_write_unit_max_opt was added in Linux 6.16, but is controlled
by the STATX_WRITE_ATOMIC mask bit added in Linux 6.11.  That's safe at
runtime because all kernels clear the reserved space in struct statx and
zero is a valid value for stx_atomic_write_unit_max_opt, and it avoids
allocating another mask bit, which are a limited resource.  But it also
means the kernel headers don't provide a way to check whether
stx_atomic_write_unit_max_opt exists, so add a configure check.
2025-10-16 13:40:47 +02:00
Jeffrey Bosboom
fe9ac7fc8c
gh-83714: Implement os.statx() function (#139178)
Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-10-15 13:44:08 +00:00
Stan Ulbrych
2ca3c85054
Update documented minimum required zlib library version (#140116) 2025-10-15 00:16:00 +02:00
Victor Stinner
35e9d41a9c
gh-139482: Add posix._clearenv() function (#139965) 2025-10-11 22:58:43 +02:00
danigm
96c59a6e42
gh-138497: Support LLVM_VERSION configuration via env (#138498)
Co-authored-by: Savannah Ostrowski <savannah@python.org>
2025-10-07 07:54:31 -07:00
Savannah Ostrowski
9964320d15
GH-137218: Fix unnecessary recompile of Programs/_freeze_module (#139241) 2025-10-04 20:05:37 -07:00
Donghee Na
c4f21d7c7c
gh-133171: Re-enable JUMP_BACKWARD to free-threading build (gh-137800) 2025-09-24 14:19:17 +09:00
Savannah Bailey
72d5ee0511
GH-137218: Fix Makefile to handle FreeBSD (fix for JIT stencil changes) (GH-139170) 2025-09-22 14:21:57 +02:00
Russell Keith-Magee
35c7e52b3e
gh-138171: Migrate iOS testbed location and add Apple build script (#138176)
Adds tooling to generate and test an iOS XCframework, in a way that will also facilitate
adding other XCframework targets for other Apple platforms (tvOS, watchOS, visionOS and 
even macOS, potentially).

---------
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-09-19 13:23:38 +01:00
Savannah Bailey
85c1ef6477
GH-137218: Update make for JIT stencils (#137265) 2025-09-19 10:36:42 +01:00
Victor Stinner
6504f20cce
gh-135755: Make Py_TAIL_CALL_INTERP macro private (#138981)
Rename Py_TAIL_CALL_INTERP to _Py_TAIL_CALL_INTERP.
2025-09-18 14:33:07 +02:00
Stefan Tatschner
a9b6b09141
gh-86819: Add ISO-TP CAN socket constants (#23794)
Co-authored-by: Stefan Tatschner <stefan@rumpelsepp.org>
Co-authored-by: Patrick Menschel <menschel.p@posteo.de>
2025-09-17 17:18:04 +00:00
Hood Chatham
2629ee4eb0
gh-128627: Use __builtin_wasm_test_function_pointer_signature for Emscripten trampoline (#137470)
With https://github.com/llvm/llvm-project/pull/150201 being merged, there is 
now a better way to generate the Emscripten trampoline, instead of including 
hand-generated binary WASM content. Requires Emscripten 4.0.12.
2025-09-17 15:33:55 +01:00
Brett Cannon
bde1291952
GH-95952: Require setting HOSTRUNNER when cross compiling for WASI (#138203)
macOS by default doesn't have the requisite CLI tools to make a default value easy. Plus Tools/wasm/wasi takes care of setting HOSTRUNNER.
2025-09-05 15:48:16 -07:00
Taegyun Kim
ffaec6e2a1
gh-128042: Emit a `configure warning when -O0 and --enable-optimizations` are combined (#137975)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-08-27 01:00:43 +02:00
Petr Viktorin
719e5c3f71
gh-123681: Check NORMALIZE_CENTURY behavior at runtime; require C99 (GH-136022)
A runtime check is needed to support cross-compiling.

Remove the _Py_NORMALIZE_CENTURY macro.
Remove _pydatetime.py's _can_support_c99.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-08-19 12:59:03 +02:00
Furkan Onder
54a5fdffc8
gh-137056: Fix DTrace build support on NetBSD (GH-137057) 2025-08-06 10:19:56 +03:00
markmcclain
001461a292
gh-137390: Add missing line continuation character in configure.ac (#137391) 2025-08-04 23:08:26 +01:00
Bénédikt Tran
fe0e921817
gh-131876: Revert "gh-131876: extract _hashlib helpers into a separate directory (#136995) (#137307)
Revert "gh-131876: extract `_hashlib` helpers into a separate directory (#136995)"

This reverts commit 45138d3584.
2025-08-01 10:45:40 -07:00
Bénédikt Tran
45138d3584
gh-131876: extract _hashlib helpers into a separate directory (#136995)
The `Modules/hashlib.h` helper file is now removed and split into multiple files:

* `Modules/_hashlib/hashlib_buffer.[ch]` -- Utilities for getting a buffer view and handling buffer inputs.
* `Modules/_hashlib/hashlib_fetch.h` -- Utilities used when fetching a message digest from a digest-like identifier.
  Currently, this file only contains common error messages as the fetching API is not yet implemented.
* `Modules/_hashlib/hashlib_mutex.h` -- Utilities for managing the lock on cryptographic hash objects.
2025-07-28 11:28:48 +02:00
Nazım Can Altınova
a667800558
gh-136459: Add perf trampoline support for macOS (#136461) 2025-07-22 16:47:24 +01:00
Hood Chatham
c933a6bb32
gh-124621: Emscripten: Support pyrepl in browser (GH-136931)
Basic support for pyrepl in Emscripten. Limitations:
* requires JSPI
* no signal handling implemented

As followup work, it would be nice to implement a webworker variant
for when JSPI is not available and proper signal handling.

Because it requires JSPI, it doesn't work in Safari. Firefox requires
setting an experimental flag. All the Chromiums have full support since
May. Until we make it work without JSPI, let's keep the original web_example
around.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Éric <merwok@netwok.org>
2025-07-22 12:13:38 +02:00
adam j hartz
d1d526afe7
gh-136251: Improvements to WASM demo REPL (GH-136252)
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-07-21 11:56:45 +02:00
Hood Chatham
e81c4e84b3
gh-127146: Report uid in Emscripten + node as native uid (#136509)
Corrects the handling of getuid on emscripten, which was consistently reporting as 0.
2025-07-16 06:17:16 +02:00
Hood Chatham
283b050523
gh-127146: Emscripten: Fix test_open_undecodable_uri by setting -sTEXTDECODER=2 (#136624)
Removes the JS text decoder fallback and gets rid of the bugs due to the differences 
in behavior on invalid utf8 strings. See https://github.com/emscripten-core/emscripten/issues/24690.
2025-07-13 20:30:38 +02:00
Will Childs-Klein
db47f4d844
gh-135401: Test AWS-LC as a cryptography library in CI (GH-135402)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Zachary Ware <zach@python.org>
2025-07-11 17:24:11 -05:00
Hood Chatham
6ea4258285
gh-136229: Remove Platform Emscripten is not supported warning (#136230)
Updates configure script to identify Emscripten as Tier 3.
2025-07-09 02:26:41 +00:00
Petr Viktorin
fb170cf50d
gh-120713: Make _Py_NORMALIZE_CENTURY private (GH-135933) 2025-07-07 17:57:48 +02:00
Sergey B Kirpichev
b19c9da401
gh-115119: Defer removal of bundled libmpdec to 3.16 (#133997)
Rename libmpdecimal -> libmpdec

see https://www.bytereef.org/mpdecimal/doc/libmpdec/index.html
2025-07-02 11:20:00 +02:00
Sergey B Kirpichev
17cf0a343b
gh-115119: Remove implicit fallback to the bundled libmpdec (#134078)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-07-01 17:50:51 +02:00
Bénédikt Tran
1e975aee28
gh-135755: rename undocumented HACL_CAN_COMPILE_SIMD{128,256} macros (#135847)
Rename undocumented `HACL_CAN_COMPILE_SIMD{128,256}` macros
to `_Py_HACL_CAN_COMPILE_VEC{128,256}`. These macros are private.
2025-06-27 17:12:21 +02:00
Petr Viktorin
9193efdeab
gh-125206: Make _Py_FFI_SUPPORT_C_COMPLEX private (GH-135932) 2025-06-26 11:48:37 +02:00
Petr Viktorin
c2f2fd4eca
gh-131591: Make --without-remote-debug work (GH-135925)
The feature is checked using `defined(Py_REMOTE_DEBUG)`; defining
the macro (even as `0`) enables it.
2025-06-25 13:51:32 +02:00
Hood Chatham
01c80b2650
gh-127146: Enable large files on Emscripten (#135635)
Large files have been fully supported by Emscripten for a long time.
2025-06-18 04:34:30 +00:00
Donghee Na
f079979599
gh-119132: Remove "experimental" tag from the CPython free-threading. (gh-135550)
* gh-119132: Remove "experimental" tag from the CPython free-threading build

* Address code review

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>

* Add NEWS.d

* Regen configure.ac

* Update doc

* Update

* Update

* Update

* Update Doc/howto/free-threading-python.rst

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>

* Update ctypes.rst

* Update

* Update Doc/howto/free-threading-python.rst

Co-authored-by: T. Wouters <thomas@python.org>

* Apply suggestions from code review

Co-authored-by: T. Wouters <thomas@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>

---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: T. Wouters <thomas@python.org>
2025-06-16 23:32:52 +09:00
Caleb Xu
2e15a50851
gh-135497: fix MAXLOGNAME detection in configure.ac (#135508) 2025-06-14 16:04:16 +00:00
Zanie Blue
2b0c684e07
GH-134273: Allow setting JIT compiler flags at build time with CFLAGS_JIT (GH134276) 2025-06-12 16:11:08 -07:00
Duane Griffin
1ffe913c20
gh-127081: use getlogin_r if available (gh-132751)
The `getlogin` function is not thread-safe: replace with `getlogin_r` where
available.
2025-06-03 13:28:58 -04:00
Sam Ng
ac7511062b
gh-130478: fix HACL* build for macOS Silicon (#134188) 2025-06-01 17:35:58 +02:00
Bénédikt Tran
3bffada467
gh-132710: only use stable _uuid.generate_time_safe() to deduce MAC address (#132901) 2025-05-26 10:56:31 +02:00
Brandt Bucher
7ad90463df
GH-133779: Fix finding pyconfig.h on Windows JIT builds (GH-134349) 2025-05-20 12:32:26 -04:00
Adam Turner
2c7cac4c0d
GH-132983: Restore libzstd fallback detection (#133565) 2025-05-09 15:09:20 +01:00
Hugo van Kemenade
9748fb3867 Python 3.15.0a0 2025-05-07 18:47:42 +03:00
Adam Turner
f8691901d7
GH-132983: Remove zstd version check in the header file (#133502) 2025-05-06 15:04:50 +03:00
Adam Turner
793402e217
GH-132983: Use a standard autoconf version check for zstd (#133479) 2025-05-06 01:35:02 +01:00
Adam Turner
e6f8e0a035
GH-132983: Build `_zstd` on Windows (#133366) 2025-05-06 00:58:47 +01:00
Sergey B Kirpichev
1bc16504ef
gh-61103: drop unused Py_HAVE_C_COMPLEX define (GH-133435)
Py_HAVE_C_COMPLEX was added in 3.14 so the removal doesn't need a deprecation
period even under a strict reading of PEP 387.

The Py_FFI_SUPPORT_C_COMPLEX check configure check implies support for
complex types in ctypes.
2025-05-05 15:50:57 +02:00
Adam Turner
3f80165a26
GH-91048: Minor fixes for `_remotedebugging & rename to _remote_debugging` (#133398) 2025-05-05 02:30:14 +02:00
Bénédikt Tran
7b96701ccc
gh-133042: disable HACL* HMAC on Emscripten (#133064) 2025-05-04 21:55:49 +02:00
Emma Smith
3b4333583f
gh-132983: Introduce _zstd bindings module (GH-133027)
* Add _zstd module for https://peps.python.org/pep-0784/

This commit introduces the `_zstd` module, with bindings to libzstd from
the pyzstd project. It also includes the unix build system configuration.
Windows build system support will be integrated independently as it
depends on integration with cpython-source-deps.

* Add _zstd to modules

* Fix path for compression.zstd module

* Ignore _zstd module like _io

* Expand module state macros to improve code quality

Also removes module state references from the classes in the _zstd
module and instead uses PyType_GetModuleState()

* Remove backticks suggested in review

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>

* Use critical sections to lock object state

This should avoid races and deadlocks.

* Remove compress/decompress and mark module as not reliant on the GIL

The `compress`/`decompress` functions will be moved to Python code for simplicity.
C implementations can always be re-added in the future.

Also, mark _zstd as not requiring the GIL.

* Lift critical section to avoid clang warning

* Respond to comments by picnixz

* Call out pyzstd explicitly in license description

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>

* Use a much more robust implementation...

... for `get_zstd_state_from_type`

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Use PyList_GetItemRef for thread safety purposes

* Use a macro for the minimum supported version

* remove const from primivite types

* Use PyMem_New in another spot

* Simplify error handling in _get_frame_size

* Another simplification of error handling in get_frame_info

* Rename _module_state to mod_state

* Rewrite comment explaining the context of the code

* Add link to pyzstd

* Add TODO about refactoring dict training code

* Use PyModule_AddObjectRef over PyModule_AddObject

PyModule_AddObject is soft-deprecated, so we should use PyModule_AddObjectRef

* Check result of OutputBufferGrow

* Simplify return logic in `add_constant_to_type`

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Ignore return value of _zstd_clear()

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Remove redundant comments

* Remove __reduce__ from ZstdDict

We should instead document that to pickle a dictionary a user should use
the `.dict_content` attribute.

* Use PyUnicode_FromFormat instead of a buffer

* Don't use C constants/types in error messages

* Make error messages easier to understand for Python users

* Lower minimum required version 1.4.0

* Use casts and make slot function signatures correct

* Be consistent with CPython on const usage

* Make else clauses in line with PEP 7

* Fix over-indented blocks in argument clinic

* Add critical section around ZSTD_DCtx_setParameter

* Add a TODO about refactoring critical sections

* Use Py_UNREACHABLE

* Move bytes operations out of Py_BEGIN_ALLOW_THREADS

* Add TODO about ensuring a lock is held

* Remove asserts that may not be correct

* Add TODO to make ZstdDict and others GC objects

* Make objects GC tracked

* Remove unused include

* Fix some memory issues

* Fix refleaks on module and in ZstdDict

* Update configure to check for ZDICT_finalizeDictionary

* Properly check version in configure

* exit(1) if check fails

* Use AC_RUN_IFELSE

* Use a define() to re-use version check

* Actually properly set _zstd module status based on version

---------

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-04 01:29:55 +00:00