-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pyexpat build failure on Solaris 10 for 2.6.1/2.6.2 #50548
Comments
|
I've built Python 2.6.1 and Python 2.6.2 on x86_64-sun-solaris2.10 using Most stuff builds just fine (even warnings are rare), but pyexpat fails building 'pyexpat' extension I never tried any of the 2.5.x Python builds, but I can tell you that I I do have expat 2.0.1 (also built with the Sun compiler in 64 bit mode) Please let me know if I can provide any relevant information. Thanks, Tim (the Enchanter) |
|
This still happens in 2.6.3 and 2.6.4 so I spent some time looking at it. It's happening because of a combination of issues, but ultimately it's because python's build isn't making certain that it's including its private copy of expat.h and expat_external.h. Basically, this -DHAVE_EXPAT_CONFIG_H=1 -DUSE_PYEXPAT_CAPI -I/local/src/RPM/BUILD/Python-2.6.4/./Modules/expat should *precede* CFLAGS, rather than coming after it. To reproduce:
This results in the special includes for python's local copy of the expat sources being *after* the -I/usr/local/include on the command line, so the copy of expat.h and expat_external.h in /usr/local/include are found first, and that causes the link failure when generating pyexpat.so. Note that it's not just as simple as not including -I/usr/local/include in CFLAGS, because there may be other locally-installed packages that python should be finding to build other modules. The real fix is for Python's build machinery to make certain that the special includes for Python's private expat sources precede CFLAGS. |
|
Is this still a problem given that both Python and Solaris have moved on? |
|
I just tried Python 2.7.6 on x86_64-pc-openindiana151a9. The core issue is still present. It's not currently causing a build failure, but only because OpenIndiana 151a9 and Python are using the exact same version of Expat, so the headers that python's build process is mistakenly including from the operating system match the code that it's compiling internally. My comment in msg97311 on 2010-01-06 is still valid. If Python's build process is going to use internal expat, then it better ensure that the compilation flags it needs for that (including the -I) comes before the standard CFLAGS & CPPFLAGS. |
|
The issue applies and is reproducible for all versions 2.6 through 3.5. This is the changeset we applied to all FreeBSD Ports to fix the issue: https://svnweb.freebsd.org/ports?view=revision&revision=326729 One specific example (Python 3.3):
https://svnweb.freebsd.org/ports/head/lang/python33/Makefile?r1=326729&r2=326728&pathrev=326729
This results in: Makefile.pre.in: Makefile: The root cause *requiring* the use of CPPFLAGS, is PY_CFLAGS before PY_CPPFLAGS here: PY_CORE_CFLAGS= As per https://www.gnu.org/prep/standards/html_node/Command-Variables.html "Put CFLAGS last in the compilation command, after other variables containing compiler options, so the user can use CFLAGS to override the others." We must use CPPFLAGS, because CFLAGS has been broken in one way or another for a long time. The target state is *both* must just work. This can only happen if the standard user-serviceable autoconf and Makefile variables are left alone, not extended or overridden, and behave in exactly the same way whether provided in the environment for *either* ./configure, make, or *both*. For the most recent chapter in the C[PP|LD]FLAGS/Makefile book, see: 92a9dc668c95 from bpo-9189 which was sound in intent, but in execution left us deeper down the rabbit-hole. Moving forward and as a first step, what does everyone think of switching the order of I hope (but I'm not holding my breath) that nothing relies on the current ordering. |
|
Setting versions to correctly reflect those affected. |
|
Adding a patch for reference only |
|
Closing as Python versions 2.6 - 3.5 are not supported. If this issue still exists, create a new issue targeting supported python versions with a reproducer. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: