Can't recognize libjq1 being installed on the system
est31 opened this issue · comments
When I try to use this library, it doesn't seem to be able to recognize libqj1 installed on the system. Most likely because on my system it's called libjq1
not libjq
.
Could you share the type of system you're on?
I can probably fake it by doing a docker build and just renaming the .so as a part of the build, but I'd rather know I've really fixed it for real.
@onelson I'm using ubuntu. This is the list of files provided: https://packages.ubuntu.com/disco/amd64/libjq1/filelist
It's weird that pkg-config doesn't resolve the library correctly. My current guess it's the lib
prefix.
Okay thanks. I'll take a closer look. All our builds tend to happen on debian, but I don't think we've ever tried it on ubuntu. I'll prep a dockerfile and see what's what.
Hmm I think I found the reason: there is no /usr/lib/x86_64-linux-gnu/pkgconfig/jq.pc file. Other libraries like libogg-dev ship with a corresponding .pc file: https://packages.ubuntu.com/disco/amd64/libogg-dev/filelist
Not sure why such a file isn't included but this is certainly the distro's fault not the fault of this crate.
Ah. Well, in that case, I'll aim to document this in the readme. Certainly, there are other ubuntu users out there who may run into this.
Thanks for doing the legwork.
@onelson you say it works in debian? That's weird, as it's lacking the file as well: https://packages.debian.org/stretch/amd64/libjq-dev/filelist vs https://packages.ubuntu.com/disco/amd64/libjq-dev/filelist
Yeah. We have only one service depending on this crate, but there are two docker builds, one for local dev (dynamic linking) and a multi-stage cross-builder (we link jq statically there and so build it from source).
The dynamic linking version (I'm checking the Dockerfile)... Yep.
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
libjq-dev libonig-dev libjq1 libonig4 \
&& rm -rf /var/lib/apt/lists/*
ENV JQ_LIB_DIR=/usr/lib/x86_64-linux-gnu
We set JQ_LIB_DIR
to side-step pkg-config
, I guess.
jq/libjq has no pc file that why pkg-config will always fail.