bpo-31374: Create expat_config.h with autoconf#3571
bpo-31374: Create expat_config.h with autoconf#3571tiran wants to merge 2 commits intopython:masterfrom
Conversation
|
Would it be possible to modify expat_config.h instead of modifying code copied from libexpat? |
|
The AppVeyor failure is unrelated to your change, it's a regression that I introduced when I made threading_cleanup() stricter: https://bugs.python.org/issue31234#msg302163 |
|
We could fix it in |
|
Hum, I suggest to not define _POSIX_C_SOURCE if it's already set, rather than replacing the value: Do we really need pyconfig.h to configure expat? |
|
We use pyconfig.h to get endianess. |
64ab171 to
99b2675
Compare
|
I tried to generate expat_config.h from a expat_config.h.in template which doesn't include pyconfig.h. Problem: Expat requires the endian, but also the HAVE_MEMMOVE define. I don't know autotools good enough to propose a working change. I tried the following code in configure.ac: but then noticed that autoheader genereates more complex code in pyconfig.h for the endian: Oh wow, I didn't know that getting the endian would be so complex. I don't know how to pass HAVE_MEMMOVE from configure.ac to my Modules/expat/expat_config.h.in. Well, as @tiran told me on IRC, my solution is maybe too complex just to fix a single compiler warning :-) -- But I dislike modifying pyconfig.h because portability is also complex, and I don't know what are the consequences. I proposed a different fix which leaves pyconfig.h unchanged: PR #3601. It also documents what are get from pyconfig.h. @tiran: What do you think? |
99b2675 to
65c9f60
Compare
vstinner
left a comment
There was a problem hiding this comment.
You forgot the newly added .in file, no?
configure.ac
Outdated
There was a problem hiding this comment.
You may define AC_CONFIG_FILES([Modules/expat/expat_config.h]) here, to group things specific to Expat at the same place. It seems like AC_CONFIG_FILES() can be called multiple times.
There was a problem hiding this comment.
I prefer to keep all output files in one place
There was a problem hiding this comment.
This NEWS entry now seems to be outdated.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Fixes warnings in expat module: "_POSIX_C_SOURCE" redefined Signed-off-by: Christian Heimes <christian@python.org>
65c9f60 to
b95f803
Compare
|
I didn't expect the French Inquisition! And I didn't expect the Spanish Inquisition! |
|
Nobody expects the Spanish Inquisition! @Haypo: please review the changes made to this pull request. |
|
I tested this PR when HAVE_MEMMOVE is false (undefined): expat compilation fails because HAVE_BCOPY is unset, whereas my Fedora 29 supports bcopy() :-/ libexpat uses more "HAVE_xxx" macros: expat_config.h seems like the best approach, but I'm not longer sure that it's worth it. This approach requires a lot of work, whereas most platforms use system libexpat, not our vendored libexpat copy. |
|
This approach seems too complex :-( Since we are trying to fix a minor warning, I wrote a simpler patch which modifies the vendored copy of libexpat: PR #11064. |
|
I merged a simpler approach: PR #11064. |
include expat_config.h first to avoid warning:
"_POSIX_C_SOURCE" redefined
Signed-off-by: Christian Heimes christian@python.org
https://bugs.python.org/issue31374