Repository navigation
Remove obsolete and unused configure macros - #159513
Conversation
# Conflicts: # configure.ac
|
🤖 New build scheduled with the buildbot fleet by @methane for commit 87fd74b 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F159513%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
There was a problem hiding this comment.
🟢 Approval recommended
The removed checks have no remaining active consumers, and the compatibility cleanup preserves supported compiler and platform behavior.
No open issues 🎉
What changed in this PR
This PR simplifies CPython’s build configuration and portability code by removing unused feature checks and workarounds for unsupported platforms and compilers.
Changes:
- Remove configuration checks left behind by deleted modules, bundled libmpdec, and pre-ANSI compilers.
- Remove obsolete IRIX and BSD workarounds and simplify MSVC conditions while preserving supported paths.
- Synchronize generated configuration files, platform headers, and the C API macro allowlist.
| File | Description |
|---|---|
| Tools/build/check_capi_macros_ignored.txt | Remove obsolete macros from the allowlist. |
| Python/pylifecycle.c | Simplify the secure CRT signal-handling condition. |
| Python/mystrtoul.c | Remove an IRIX-specific macro definition. |
| Python/dynload_shlib.c | Remove the legacy NetBSD loader workaround. |
| pyconfig.h.in | Remove templates for deleted configuration checks. |
| PC/pyconfig.h | Remove unused macros and obsolete MSVC branches. |
| PC/invalid_parameter_handler.c | Remove the old MSVC guard and correct the header reference in a comment. |
| Modules/timemodule.c | Simplify secure CRT conditions and clarify a comment. |
| Modules/termios.c | Remove the IRIX control-character workaround. |
| Modules/socketmodule.c | Remove IRIX workarounds and simplify MSVC header handling. |
| Modules/selectmodule.c | Remove the IRIX-specific bzero declaration. |
| Modules/posixmodule.c | Remove the IRIX-specific ctermid_r declaration. |
| Modules/_cursesmodule.c | Remove IRIX-specific header and compatibility handling. |
| Include/pyport.h | Remove an IRIX-specific macro definition. |
| Include/pymacconfig.h | Remove the unused x64 assembler configuration macro. |
| Include/internal/pycore_fileutils.h | Simplify the MSVC invalid-parameter suppression condition. |
| configure.ac | Remove obsolete platform exceptions and unused checks. |
| configure | Reflect the configuration-check removals in generated output. |
Review effort: Balanced
| #if defined(__NetBSD__) | ||
| #include <sys/param.h> | ||
| #if (NetBSD < 199712) | ||
| #include <nlist.h> | ||
| #include <link.h> | ||
| #define dlerror() "error in dynamic linking" | ||
| #endif | ||
| #endif /* NetBSD */ | ||
|
|
There was a problem hiding this comment.
I think we can probably leave this in? I presume people are still using Python on NetBSD and it is actively getting releases.
There was a problem hiding this comment.
The NetBSD < 199712 workaround targets ancient NetBSD versions and is no longer needed. <sys/param.h> is included only for the NetBSD macro, so the whole block can be removed.
emmatyping
left a comment
There was a problem hiding this comment.
Thanks for the PR, I love to see negative diffs! I had two tweaks to the changes but the rest LGTM.
Co-authored-by: Emma Smith <emma@emmatyping.dev>
Remove obsolete platform workarounds and configuration checks whose results are no longer used: