Bug 214371

Summary: devel/py-lxml: Build fails, conflict with xlocale.h from base when devel/xlocale port installed
Product: Ports & Packages Reporter: Peter Sanchez <petersanchez>
Component: Individual Port(s)Assignee: William Grzybowski <wg>
Status: Closed Overcome By Events    
Severity: Affects Some People CC: vlad-fbsd, w.schwarzenfeld
Priority: --- Keywords: needs-qa
Version: LatestFlags: bugzilla: maintainer-feedback? (wg)
Hardware: Any   
OS: Any   

Description Peter Sanchez 2016-11-09 20:45:28 UTC
OS: 10.3-RELEASE-p12

The port will fail to build with xlocale-208080 (devel/xlocale) installed. xlocale-208080 adds /usr/local/include/xlocale.h which conflicts with /usr/include/xlocale.h. Output of the port build is as follows:

root:dev ~ # cd /usr/ports/devel/py-lxml/
root:dev /usr/ports/devel/py-lxml # make all
===>  License BSD3CLAUSE accepted by the user
===>  Found saved configuration for py27-lxml-3.6.0
===>   py27-lxml-3.6.0 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by py27-lxml-3.6.0 for building
===>  Extracting for py27-lxml-3.6.0
=> SHA256 Checksum OK for lxml-3.6.0.tar.gz.
===>  Patching for py27-lxml-3.6.0
===>  Applying FreeBSD patches for py27-lxml-3.6.0
===>   py27-lxml-3.6.0 depends on package: py27-setuptools27>0 - found
===>   py27-lxml-3.6.0 depends on file: /usr/local/bin/python2.7 - found
===>   py27-lxml-3.6.0 depends on shared library: libxml2.so - found (/usr/local/lib/libxml2.so)
===>   py27-lxml-3.6.0 depends on shared library: libxslt.so - found (/usr/local/lib/libxslt.so)
===>  Configuring for py27-lxml-3.6.0
Building lxml version 3.6.0.
Building without Cython.
Using build configuration of libxslt 1.1.29
Building against libxml2/libxslt in one of the following directories:
  /usr/local/lib
  /usr/lib
running config
===>  Building for py27-lxml-3.6.0
Building lxml version 3.6.0.
Building without Cython.
Using build configuration of libxslt 1.1.29
Building against libxml2/libxslt in one of the following directories:
  /usr/local/lib
  /usr/lib
running build
running build_py
creating build
creating build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7
creating build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml
copying src/lxml/builder.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml
copying src/lxml/cssselect.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml
copying src/lxml/pyclasslookup.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml
copying src/lxml/usedoctest.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml
copying src/lxml/ElementInclude.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml
copying src/lxml/sax.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml
copying src/lxml/_elementpath.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml
copying src/lxml/__init__.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml
copying src/lxml/doctestcompare.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml
creating build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/includes
copying src/lxml/includes/__init__.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/includes
creating build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/html
copying src/lxml/html/_html5builder.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/html
copying src/lxml/html/builder.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/html
copying src/lxml/html/html5parser.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/html
copying src/lxml/html/_diffcommand.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/html
copying src/lxml/html/clean.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/html
copying src/lxml/html/formfill.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/html
copying src/lxml/html/usedoctest.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/html
copying src/lxml/html/_setmixin.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/html
copying src/lxml/html/soupparser.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/html
copying src/lxml/html/ElementSoup.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/html
copying src/lxml/html/__init__.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/html
copying src/lxml/html/defs.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/html
copying src/lxml/html/diff.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/html
creating build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/isoschematron
copying src/lxml/isoschematron/__init__.py -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/isoschematron
copying src/lxml/lxml.etree.h -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml
copying src/lxml/lxml.etree_api.h -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml
copying src/lxml/includes/relaxng.pxd -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/includes
copying src/lxml/includes/xmlerror.pxd -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/includes
copying src/lxml/includes/etreepublic.pxd -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/includes
copying src/lxml/includes/c14n.pxd -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/includes
copying src/lxml/includes/dtdvalid.pxd -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/includes
copying src/lxml/includes/config.pxd -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/includes
copying src/lxml/includes/schematron.pxd -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/includes
copying src/lxml/includes/xpath.pxd -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/includes
copying src/lxml/includes/xmlparser.pxd -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/includes
copying src/lxml/includes/tree.pxd -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/includes
copying src/lxml/includes/xslt.pxd -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/includes
copying src/lxml/includes/htmlparser.pxd -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/includes
copying src/lxml/includes/xmlschema.pxd -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/includes
copying src/lxml/includes/uri.pxd -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/includes
copying src/lxml/includes/xinclude.pxd -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/includes
copying src/lxml/includes/lxml-version.h -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/includes
copying src/lxml/includes/etree_defs.h -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/includes
creating build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/isoschematron/resources
creating build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/isoschematron/resources/rng
copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/isoschematron/resources/rng
creating build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/isoschematron/resources/xsl
creating build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.freebsd-10.3-RELEASE-p11-amd64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
creating build/temp.freebsd-10.3-RELEASE-p11-amd64-2.7
creating build/temp.freebsd-10.3-RELEASE-p11-amd64-2.7/src
creating build/temp.freebsd-10.3-RELEASE-p11-amd64-2.7/src/lxml
cc -DNDEBUG -O2 -pipe -fstack-protector -fno-strict-aliasing -fPIC -I/usr/local/include -I/usr/local/include/libxml2 -I/usr/include -Isrc/lxml/includes -I/usr/local/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.freebsd-10.3-RELEASE-p11-amd64-2.7/src/lxml/lxml.etree.o -w
In file included from src/lxml/lxml.etree.c:357:
In file included from /usr/local/include/libxslt/xsltInternals.h:24:
In file included from /usr/local/include/libxslt/xsltlocale.h:20:
/usr/local/include/xlocale.h:22:30: error: typedef redefinition with different types ('struct _LC_locale_t *' vs 'struct _xlocale *')
typedef struct _LC_locale_t* locale_t;
                             ^
/usr/include/xlocale/_strings.h:31:26: note: previous definition is here
typedef struct  _xlocale *locale_t;
                          ^
In file included from src/lxml/lxml.etree.c:357:
In file included from /usr/local/include/libxslt/xsltInternals.h:24:
In file included from /usr/local/include/libxslt/xsltlocale.h:20:
/usr/local/include/xlocale.h:39:6: error: conflicting types for 'freelocale'
void freelocale(locale_t loc);
     ^
/usr/include/xlocale/_locale.h:51:7: note: previous declaration is here
int              freelocale(locale_t loc);
                 ^
2 errors generated.
Compile failed: command 'cc' failed with exit status 1
creating tmp
cc -I/usr/local/include -I/usr/local/include/libxml2 -I/usr/include -I/usr/include/libxml2 -c /tmp/xmlXPathInit9VAH3M.c -o tmp/xmlXPathInit9VAH3M.o
/tmp/xmlXPathInit9VAH3M.c:2:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main (int argc, char **argv) {
^~~~
1 warning generated.
cc tmp/xmlXPathInit9VAH3M.o -L/usr/local/lib -L/usr/lib -lxml2 -o a.out
error: command 'cc' failed with exit status 1
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/devel/py-lxml
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/py-lxml
root:dev /usr/ports/devel/py-lxml #

Removing the xlocale-208080 install resolves this issue.
Comment 1 VK 2016-11-09 21:05:31 UTC
Can confirm the same problem when, in a clean new jail:

1. pkg install xlocale
2. pkg install py27-pip libxml2 libxslt
3. run pip install lxml
or
3. run make in /usr/ports/devel/py-lxml
Comment 2 Walter Schwarzenfeld 2018-01-14 00:58:00 UTC
Maintainer feedback?
Comment 3 Walter Schwarzenfeld 2018-09-03 17:07:37 UTC
We have version 4.1.1. py-lxml installs fine. Seems overcome by events. If there are (same) problems with current version, please reopen.