DragonFlyBSD / DPorts

The dedicated application build system for DragonFly BSD
Other
89 stars 44 forks source link

lang/python27 make expat #173

Closed davshao closed 8 years ago

davshao commented 8 years ago

Move /usr/local and /var/db/pkg. Clean /usr/obj/dports. Build dports from scratch using make clean && make NO_DIALOG=yes install clean and /etc/make.conf

CFLAGS+=-g STRIP=

WITH_PKGNG=yes DISABLE_VULNERABILITIES=yes

WITH_VIM_OPTIONS=yes

Building lang/python27 fails with:

*\ WARNING: renaming "pyexpat" since importing it failed: build/lib.dragonfly-4.5-DEVELOPMENT-x86_64-2.7/pyexpat.so: Undefined symbol "XML_ErrorString"

pkg-static: Unable to access file /usr/obj/dports/lang/python27/stage/usr/local/lib/python2.7/lib-dynload/_elementtree.so: No such file or directory pkg-static: Unable to access file /usr/obj/dports/lang/python27/stage/usr/local/lib/python2.7/lib-dynload/pyexpat.so: No such file or directory

I was able to get python27 to at least build adding -lexpat to the Makefile to get the line:

NLS_LIBS= -L${LOCALBASE}/lib -lintl -lexpat

davshao commented 8 years ago

I have the impression the above workaround is completely bogus as Python wants to link with its own internal version of expat.

davshao commented 8 years ago

This seems a lot more sensible solution to use Python's own configure option:

--- lang/python27/Makefile.orig 2016-01-14 16:26:21.000000000 -0800 +++ lang/python27/Makefile 2016-02-12 15:25:25.175039000 -0800 @@ -40,13 +40,14 @@ PORTVERSION=${PORTVERSION} \ OSMAJOR=${DFLYVERSION:C/([0-9])[0-9]{5}/\1/} # For plat-freebsd in pkg-plist. http://bugs.python.org/issue19554

-OPTIONS_DEFINE= DEBUG IPV6 LIBFFI NLS PYMALLOC SEM THREADS -OPTIONS_DEFAULT= IPV6 LIBFFI NLS PYMALLOC SEM THREADS UCS4 +OPTIONS_DEFINE= DEBUG IPV6 LIBFFI EXPAT NLS PYMALLOC SEM THREADS +OPTIONS_DEFAULT= IPV6 LIBFFI EXPAT NLS PYMALLOC SEM THREADS UCS4 OPTIONS_SINGLE= UNICODE OPTIONS_SINGLE_UNICODE= UCS2 UCS4 OPTIONS_SUB= yes

LIBFFI_DESC= Use libffi from ports instead of bundled version +EXPAT_DESC= Use expat from ports instead of bundled version NLS_DESC= Enable gettext support for the locale module UCS2_DESC= Enable UCS2 Unicode Strings UCS4_DESC= Enable UCS4 Unicode Strings @@ -57,6 +58,9 @@ LIBFFI_CONFIGURE_ON= --with-system-ffi LIBFFI_LIB_DEPENDS= libffi.so:${PORTSDIR}/devel/libffi

+EXPAT_CONFIGURE_ON= --with-system-expat +LIBFFI_LIB_DEPENDS= libexpat.so:${PORTSDIR}/textproc/expat +

Use CPPFLAGS over CFLAGS due to -I ordering, causing elementtree and pyexpat

to break in Python 2.7, or preprocessor complaints in Python >= 3.3

Upstream Issue: http://bugs.python.org/issue6299

jrmarino commented 8 years ago

Since a lang/python27 failure would result in approximately 14,000 ports failing to build, I'd say this issue is limited to "live" building. We're not seeing it in a clean jail.

I can check again via synth or poudriere, but I expect it will build without any expat tweaks.

davshao commented 8 years ago

And yet it fails to build.

Just try it on current master.

Move /usr/local, /var/db/pkg so they are safe, clean out /usr/obj/dports, reboot cd /usr/dports/ports-mgmt/pkg make clean && make NO_DIALOG=yes install clean

reboot

cd /usr/dports/lang/python27 make clean && make NO_DIALOG=yes install clean

Looking at pkg info, expat is getting pulled in as a dependency anyway, for at least gettext-tools:

expat-2.1.0_3 gettext-runtime-0.19.6 gettext-tools-0.19.6 indexinfo-0.2.4 libffi-3.2.1 ncurses-6.0_5 pkg-1.6.3 pkgconf-0.9.12_1 readline-6.3.8

jrmarino commented 8 years ago

over 23,300 ports have built on master post-privatization in poudriere (and python27 was also tested in synth).

jrmarino commented 8 years ago

it seems that I can reproduce this now.

davshao commented 8 years ago

Sorry for the delay responding. I can verify using make clean && make NO_DIALOG=yes install clean can install dports pkg, python27, git, xorg, xfce4, cscope, vim, and firefox from scratch after the latest patches. Thank you.