Closed jasongi-ac closed 9 months ago
The culprit is /var/lang/lib/libsqlite3.so.0
bash-4.2# ldd /opt/lib/libgdal.so | grep sqlite
libsqlite3.so.0 => /var/lang/lib/libsqlite3.so.0 (0x00007f33c6e5f000)
edit: Actually I don't think that's the case, all this cmake stuff really goes over my head. Appears to be dynamically being set at runtime. You can fix it by setting LD_PRELOAD or even LD_LIBRARY_PATH works. Would be better if this worked without that though, since the only viable option in lambda is LD_PRELOAD. Isn't this the reasoning behind doing the rpath stuff, so this doesn't happen?
after a couple of false starts adding
RUN patchelf --force-rpath --set-rpath '$ORIGIN' $PREFIX/lib/libgdal.so
to the docker build seems to do the trick. PR here: https://github.com/lambgeo/docker-lambda/pull/74
confirmed
docker run --platform=linux/amd64 --entrypoint bash --rm ghcr.io/lambgeo/lambda-gdal:3.8 ldd /opt/lib/libgdal.so | grep "sql"
libsqlite3.so.0 => /lib64/libsqlite3.so.0 (0x0000004006e28000)
@jasongi really appreciate your effort here, I have myself spends days on similar issues 😭
Sadly, as noted in your PR I think there is a bigger issue (see proj lib). I'm not sure I have enough free time at the moment to work on this but I'll try
Having a similar issue to this one: https://github.com/lambgeo/docker-lambda/issues/56
Steps for a simple reproduction:
workaround is to add LD_PRELOAD in your lambda env vars like so:
You can test this fix by doing the following simple repro:
I suspect the culprit is one of these libs outside of /opt/lib/:
I think it can be fixed by specifying either CMAKE_LIBRARY_PATH or SQLITE3_LIBRARY