Opened 2 years ago

Closed 2 years ago

Last modified 17 months ago

#2723 closed defect (fixed)

failure to build against external json-c 0.12

Reported by: landry Owned by: pramsey
Priority: medium Milestone: PostGIS 2.1.4
Component: postgis Version: 2.1.x
Keywords: history Cc: brunofriedmann

Description

Similar to http://trac.osgeo.org/gdal/ticket/5449, postgis as is fails to build against json-c 0.12 since they removed the extern json_tokener_errors array, deprecated in favor of json_tokener_error_desc() present since 0.10.

I've fixed it locally using http://www.openbsd.org/cgi-bin/cvsweb/ports/geo/postgis/patches/patch-liblwgeom_lwin_geojson_c?rev=1.1 but maybe a better fix could be commited upstream, depending if we want to require json 0.10 or still want to support older versions.

I can provide a patch if needed.

Attachments (1)

use-json-c (3.7 KB) - added by mwanner 2 years ago.
Debian use-json-c patch

Download all attachments as: .zip

Change History (16)

comment:1 Changed 2 years ago by robe

  • Milestone set to PostGIS 2.2.0

landry,

I think for PostGIS 2.2 json 0.10 or above as an option is probably okay. For 2.1 we still need to support the older versions (which I think is like 0.8 or somethig). I'm also not quite clear how easy it is for folks to upgrade their json-c on Linux so I'm even a bit leary about requiring a higher version in 2.2.

pramsey, dustymugs, strk -- have an opinion on this?

comment:2 Changed 2 years ago by landry

slackware has 0.10, gentoo has 0.11 with 0.12 available as alternative, archlinux has 0.11, fedora has 0.11, redhat/centos 6 (and 5?) has 0.10, debian stable has 0.10 and 0.11 in testing/unstable.. so i think 0.10 is a safe bet at that point.

comment:3 Changed 2 years ago by robe

okay then I think for cleanness we should probably make 0.10+ a requirement for PostGIS 2.2 (especially since newer stable GDAL has that as a minimum too). For 2.1 we'd need an uglier hack that supports older.

Changed 2 years ago by mwanner

Debian use-json-c patch

comment:4 Changed 2 years ago by mwanner

  • Milestone changed from PostGIS 2.2.0 to PostGIS 2.1.3

I run into the same issue on Debian, where I need the postgis package to compile against both, old and new json(-c). While r12347 (fixing #2539) is a step in the right direction, it's clearly not sufficient.

I've attached the patch that I'm going to use for Debian to allow postgis to compile if a new json-c is installed.

comment:5 Changed 2 years ago by pramsey

I've applied a patch to trunk that works for me, and hopefully others, trying to support json-c 12, which has removed some symbols and re-located where the install is.

r12647

In terms of supporting older versions, I'll have to get the source and see what's changed. I did check back to 0.10 and this fix should work back to there.

comment:6 Changed 2 years ago by strk

We're documenting minimum requirement to be 0.9 for the 2.1 branch -- The 2.2 branch I marked as requiring 0.10 minimum with r12653.

A patch is still needed to add support for 0.12 in 2.1 w/out breaking support for 0.9

comment:7 Changed 2 years ago by strk

I just noticed Travis build is failing for trunk due to the json-c version used by travis not having json_tokener_error_desc: https://travis-ci.org/postgis/postgis/builds/28394436#L1330

comment:8 Changed 2 years ago by strk

Travis is an Ubuntu Precise, has libjson-0.9 packaged.

comment:9 Changed 2 years ago by strk

r12658 attempts to fix the 0.9 support back

comment:10 Changed 2 years ago by brunofriedmann

  • Cc brunofriedmann added

comment:11 Changed 2 years ago by pramsey

  • Resolution set to fixed
  • Status changed from new to closed

Ported back to 2.0 r12662 and 2.1 r12663

comment:12 Changed 2 years ago by strk

Could you please add a NEWS entry in both 2.0 and 2.1 branches ?

comment:13 Changed 2 years ago by robe

  • Keywords history added

comment:14 Changed 17 months ago by strk

for the record, PostGIS 2.0 cannot build with libjson-0.12, PostGIS 2.1 can (cc robe)

comment:15 Changed 17 months ago by strk

(since we still miss a NEWS entry for this...)

Note: See TracTickets for help on using tickets.