setuptools version
75.7.0
Python version
3.12.8
OS
ALTLinux
Additional environment information
No response
Description
With pypa/distutils#299 (merged to setuptools 75.7.0) the CFLAGS behavior changed.
Docs are not updated to that change and describe the previous state.
https://setuptools.pypa.io/en/latest/userguide/ext_modules.html#compiler-and-linker-options
The compiler options appear in the command line in the following order:
- first, the options provided by the sysconfig variable CFLAGS,
- then, the options provided by the environment variables CFLAGS and CPPFLAGS,
This is the behavior used for RPM build for long time. CFLAGS was/is used to append additional distro-specific options to the CPython's ones.
After the aforementioned change CFLAGS env variable overrides sysconfigs CFLAGS and it's no longer possible to supply additional flags.
So it's a behavior change.
Expected behavior
There should be a way to pass additional flags for compilers according to documentation.
How to Reproduce
Try to build an extension with CFLAGS and without to see the difference in compiler flags.
Output
setuptools version
75.7.0
Python version
3.12.8
OS
ALTLinux
Additional environment information
No response
Description
With pypa/distutils#299 (merged to
setuptools75.7.0) theCFLAGSbehavior changed.Docs are not updated to that change and describe the previous state.
https://setuptools.pypa.io/en/latest/userguide/ext_modules.html#compiler-and-linker-options
This is the behavior used for RPM build for long time.
CFLAGSwas/is used to append additional distro-specific options to theCPython's ones.After the aforementioned change
CFLAGSenv variable overridessysconfigsCFLAGSand it's no longer possible to supply additional flags.So it's a behavior change.
Expected behavior
There should be a way to pass
additionalflags for compilers according to documentation.How to Reproduce
Try to build an extension with
CFLAGSand without to see the difference in compiler flags.Output