From 1e5c6500a4092ee73aec3dfc12ecaf3d51d67d84 Mon Sep 17 00:00:00 2001 From: Jason Giancono Date: Sun, 14 Jan 2024 17:44:20 +0800 Subject: [PATCH 1/2] force rpath on libgdal --- dockerfiles/Dockerfile | 1 + tests/tests.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dockerfiles/Dockerfile b/dockerfiles/Dockerfile index e4b9db6..621e587 100644 --- a/dockerfiles/Dockerfile +++ b/dockerfiles/Dockerfile @@ -399,6 +399,7 @@ RUN rm -f $PREFIX/lib/libturbojpeg.so* \ # FIX RUN for i in $PREFIX/bin/*; do patchelf --force-rpath --set-rpath '$ORIGIN/../lib' $i; done +RUN patchelf --force-rpath --set-rpath '$ORIGIN' $PREFIX/lib/libgdal.so # Build final image FROM public.ecr.aws/lambda/provided:al2 as runner diff --git a/tests/tests.sh b/tests/tests.sh index ed8b6fe..a7965b6 100755 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -21,7 +21,8 @@ if [[ ! "$(ogrinfo --formats | grep 'DXF')" ]]; then echo "DXF NOK" && exit 1; f echo "OK" echo "Checking sqlite build" -if [[ ! "$(ldd $PREFIX/bin/gdalwarp | grep '/opt/bin/../lib/libsqlite3')" ]]; then echo "libsql NOK" && exit 1; fi +if [[ ! "$(ldd $PREFIX/bin/gdalwarp | grep '/opt/bin/../lib/libsqlite3')" ]]; then echo "gdalwarp libsql NOK" && exit 1; fi +if [[ ! "$(ldd $PREFIX/lib/libgdal.so | grep '/opt/lib/libsqlite3')" ]]; then echo "libgdal libsql NOK" && exit 1; fi echo "OK" echo "Checking OGR" From fe3211f7f7183c224d1a1a37c2606663a41fe8d3 Mon Sep 17 00:00:00 2001 From: Jason Giancono Date: Mon, 15 Jan 2024 21:58:23 +0800 Subject: [PATCH 2/2] run patchelf on all libs --- dockerfiles/Dockerfile | 2 +- tests/tests.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dockerfiles/Dockerfile b/dockerfiles/Dockerfile index 621e587..aa5477e 100644 --- a/dockerfiles/Dockerfile +++ b/dockerfiles/Dockerfile @@ -399,7 +399,7 @@ RUN rm -f $PREFIX/lib/libturbojpeg.so* \ # FIX RUN for i in $PREFIX/bin/*; do patchelf --force-rpath --set-rpath '$ORIGIN/../lib' $i; done -RUN patchelf --force-rpath --set-rpath '$ORIGIN' $PREFIX/lib/libgdal.so +RUN for i in $PREFIX/lib/*.so; do patchelf --force-rpath --set-rpath '$ORIGIN' $i; done # Build final image FROM public.ecr.aws/lambda/provided:al2 as runner diff --git a/tests/tests.sh b/tests/tests.sh index a7965b6..8870528 100755 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -23,6 +23,8 @@ echo "OK" echo "Checking sqlite build" if [[ ! "$(ldd $PREFIX/bin/gdalwarp | grep '/opt/bin/../lib/libsqlite3')" ]]; then echo "gdalwarp libsql NOK" && exit 1; fi if [[ ! "$(ldd $PREFIX/lib/libgdal.so | grep '/opt/lib/libsqlite3')" ]]; then echo "libgdal libsql NOK" && exit 1; fi +if [[ ! "$(ldd $PREFIX/lib/libproj.so | grep '/opt/lib/libsqlite3')" ]]; then echo "libproj libsql NOK" && exit 1; fi +if [[ ! "$(ldd $PREFIX/lib/libgeotiff.so | grep '/opt/lib/libsqlite3')" ]]; then echo "libgeotiff libsql NOK" && exit 1; fi echo "OK" echo "Checking OGR"