Python has a collection of C files to get "build information"
- Modules/getbuildinfo.c
- Python/getcompiler.c
- Python/getcopyright.c
- Python/getplatform.c
- Python/getversion.c
_Py_gitidentifier(), Py_GetBuildInfo() and Py_GetVersion() build strings at runtime. For example, Python/getversion.c uses a static buffer of a fixed size: static char version[300];. Well, I recently changed that to allocate the version string in the heap memory to no longer truncate the string: #158608.
I propose to rework these files to build strings at build time, no longer truncate strings, and don't need to build strings at runtime (no error handling needed).
Linked PRs
Python has a collection of C files to get "build information"
_Py_gitidentifier(), Py_GetBuildInfo() and Py_GetVersion() build strings at runtime. For example, Python/getversion.c uses a static buffer of a fixed size:
static char version[300];. Well, I recently changed that to allocate the version string in the heap memory to no longer truncate the string: #158608.I propose to rework these files to build strings at build time, no longer truncate strings, and don't need to build strings at runtime (no error handling needed).
Linked PRs