Opened 5 years ago
Closed 5 years ago
#4626 closed defect (fixed)
Fails to build with libxml2 2.9.10 (uses xml2-config)
Reported by: | sebastic | Owned by: | pramsey |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.5.4 |
Component: | postgis | Version: | 2.5.x -- EOL |
Keywords: | Cc: |
Description
As reported by Mattia Rizzolo in Debian Bug #949426:
your package is using
xml2-config
to detect and use libxml2. I'm removing that script, so please update your build system to use pkg-config instead.The libxml2 package in experimental already doesn't ship the xml2-config script.
Attached is the full build log, hopefully relevant excerpt follows:
checking for xml2-config... no configure: error: could not find xml2-config from libxml2 within the current path. You may need to try re-running configure with a --with-xml2config parameter.
Attachments (1)
Change History (19)
comment:1 by , 5 years ago
comment:2 by , 5 years ago
The main repo is still building and distributing xml2-config.in
, in fact I have libxml2 2.9.10 currently installed and it builds Postgis without issues.
Bas, does this change come from upstream or from a change in Debian packaging? If it's the latter, then this isn't a bug but a feature request to support pkg-config for libxml2 (which is a good idea IMO).
comment:3 by , 5 years ago
As stated in the Debian Bug the libxml2-dev package doesn't include xml2-config any more, upstream may still include it, but the Debian package won't.
by , 5 years ago
Attachment: | libxml2.patch added |
---|
comment:4 by , 5 years ago
I hacked up a patch that uses pkg-config when libxml2-config is not found.
comment:5 by , 5 years ago
Looks good to me. I'm going to remove an extra assignation in the patch (HAVE_LIBXML2="1"
) and push it to master, 3.0 and 2.5. I have no intention of going back to older stable releases unless someone explicitly ask for it.
comment:10 by , 5 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Not sure how but this seems to have broken Bessie's build. According to the logs it's not finding a known type so I think it migjt have some old liblwgeom headers installed and cunit test include some flags before including its parent directory.
I'll have a look at CUNIT_CPPFLAGS as its declared in the Makefile as CUNIT_CPPFLAGS=@CUNIT_CPPFLAGS@ -I.. @CPPFLAGS@
comment:11 by , 5 years ago
The CUNIT part of configure.ac
uses pkg-config if it's available, due to PKG_PROG_PKG_CONFIG
being executed far after that it never actually used pkg-config.
My patch moved PKG_PROG_PKG_CONFIG
before the first statements using pkg-config, hence CUNIT uses it too if available.
comment:12 by , 5 years ago
That's correct.
I'm going to have a look around to make sure any local directory is added to the CPPFLAGS o CFLAGS before any external input (via CFLAGS, CUNIT_CPPFLAGS, etc). This has bitten us way too many times.
comment:13 by , 5 years ago
This is everything I've found: https://github.com/postgis/postgis/pull/543
It looks right in my system, but I'll try to review it with a different setup to confirm I'm not breaking anything.
comment:15 by , 5 years ago
FYI the bessie build failing on raster, might have been some loose liblwgeom flaoting.
I found liblwgeom installed in /usr/local/include liblwgeom.h
and liblwgeom_topo.h
Also found in /usr/local/lib liblwgeom-2.4.so.0, liblwgeom-2.5.so .., liblwgeom.so
I deleted the non-versioned ones from here and the include files and reran and then bessie was fine. So I think it still might be picking up non-local first.
before: https://debbie.postgis.net/view/PostGIS/job/PostGIS_Worker_Run/label=bessie/1875/consoleFull
10:27:28 Test: test_raster_envelope_geom ...gmake[4]: *** [Makefile:77: check] Segmentation fault (core dumped) 10:27:28 gmake[4]: Leaving directory '/usr/home/jenkins/workspace/PostGIS_Worker_Run/label/bessie/220be347eeb5dea6a4a46f871e87779249353038/raster/test/cunit'
after: https://debbie.postgis.net/view/PostGIS/job/PostGIS_Worker_Run/label=bessie/1876/console
all tests pass
comment:16 by , 5 years ago
Thanks a lot Robe, I'll review linker flags to see if I find anything out of place and backport the changes to 3.0 too
comment:18 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Applied to 3.0 too in https://trac.osgeo.org/postgis/changeset/85fd73f570544e6ea9f62b08bc46214aff018ee1/git
libxml-2.0.pc
was apparently introduced in 2000, so it shouldn't be an issue to default to using it ifxml2-config
is not passed.This will also require changing how the libxml2 version is read to use
LIBXML_DOTTED_VERSION
instead. As far as I can see, that MACRO has existed at least since 2001.