Opened 8 years ago

Closed 8 years ago

Last modified 7 years 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


Similar to, 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 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 8 years ago.
Debian use-json-c patch

Download all attachments as: .zip

Change History (16)

comment:1 Changed 8 years ago by robe

Milestone: PostGIS 2.2.0


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 8 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 8 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 8 years ago by mwanner

Attachment: use-json-c added

Debian use-json-c patch

comment:4 Changed 8 years ago by mwanner

Milestone: PostGIS 2.2.0PostGIS 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 8 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.


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 8 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 8 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:

comment:8 Changed 8 years ago by strk

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

comment:9 Changed 8 years ago by strk

r12658 attempts to fix the 0.9 support back

comment:10 Changed 8 years ago by brunofriedmann

Cc: brunofriedmann added

comment:11 Changed 8 years ago by pramsey

Resolution: fixed
Status: newclosed

Ported back to 2.0 r12662 and 2.1 r12663

comment:12 Changed 8 years ago by strk

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

comment:13 Changed 8 years ago by robe

Keywords: history added

comment:14 Changed 7 years ago by strk

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

comment:15 Changed 7 years ago by strk

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

Note: See TracTickets for help on using tickets.