https://docs.python.org/3.11/using/configure.html#envvar-LDFLAGS_NODIST
should explain more clearly that flags such as -I, -L, etc. and strict compiler flags such as -Werror... should not be put into CFLAGS, LDFLAGS, or it will make the resulting Python unusable for compiling user packages with extension modules via distutils and setuptools.
Various downstream packagers have provided misconfigured Pythons:
@jaraco Is there setuptools/distutils documentation that we can refer to explain how sysconfig CFLAGS and LDFLAGS are used?
It appears not. Distutils docs have been migrated to setuptools docs. When I searched there, I got no results, so it appears to be undocumented. I'd appreciate contributions in this area, especially if you invest the time to discover the details based on the code.
@jaraco Is there setuptools/distutils documentation that we can refer to explain how sysconfig CFLAGS and LDFLAGS are used?
It appears not. Distutils docs have been migrated to setuptools docs. When I searched there, I got no results, so it appears to be undocumented. I'd appreciate contributions in this area, especially if you invest the time to discover the details based on the code.
@jaraco Is there setuptools/distutils documentation that we can refer to explain how sysconfig CFLAGS and LDFLAGS are used?
It appears not. Distutils docs have been migrated to setuptools docs. When I searched there, I got no results, so it appears to be undocumented. I'd appreciate contributions in this area, especially if you invest the time to discover the details based on the code.
Activity
matthiaskoeppe commented on Jan 14, 2022
The documentation of
should explain more clearly that flags such as -I, -L, etc. and strict compiler flags such as -Werror... should not be put into CFLAGS, LDFLAGS, or it will make the resulting Python unusable for compiling user packages with extension modules via distutils and setuptools.
Various downstream packagers have provided misconfigured Pythons:
So this appears to be a documentation / user education issue in CPython.
11 remaining items
mkoeppe commented on May 12, 2022
Also:
jaraco commented on Jun 12, 2022
It appears not. Distutils docs have been migrated to setuptools docs. When I searched there, I got no results, so it appears to be undocumented. I'd appreciate contributions in this area, especially if you invest the time to discover the details based on the code.
vstinner commented on Jun 13, 2022
Current documentation:
mkoeppe commented on Jun 13, 2022
Yes, this is what my PR #92754 extends.
mkoeppe commented on Jun 13, 2022
I'll prepare a PR. Is it already possible to refer to the (sparse) docstrings such as those found in https://github.com/pypa/setuptools/blob/main/setuptools/_distutils/unixccompiler.py? (Is it formatted with sphinx somewhere?)
vstinner commented on Jun 13, 2022
The link is this issue, not a PR. I'm confused.
mkoeppe commented on Jun 13, 2022
Sorry, edited. I meant #92754
mkoeppe commented on Jun 13, 2022
That's now pypa/setuptools#3368
pythongh-90539: doc: Expand on what should not go into CFLAGS, LDFLAGS (
gh-90539: doc: Expand on what should not go into CFLAGS, LDFLAGS (#92754
pythongh-90539: doc: Expand on what should not go into CFLAGS, LDFLAGS (
gh-90539: doc: Expand on what should not go into CFLAGS, LDFLAGS (GH-…
gh-90539: doc: Expand on what should not go into CFLAGS, LDFLAGS (GH-…
Revert 30935 defer bpo45162 to 312 (#94285)