You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, I want to second #2. Thank you for open-sourcing this lambda-layer!
I need to build libvips with poppler support. I'm using the lambci/lambda:build-go1.x as base image as it matches the lambda environment very closely.
The lambda environment includes old versions of libraries such as libpng (which are not included in the amazonlinux:2018.03 image).
Still, I'm building the newest version of those libraries from source as the older ones have known security problems (see libvips/libvips#1749 (comment)).
However, Poppler picks up the pre-installed (old) versions /usr/lib64/ instead of the new version from /opt/lib during the build, e.g. it uses /usr/lib64/libpng.so instead of /opt/lib/libpng.so.
-- Found Freetype: /usr/lib64/libfreetype.so (found version "2.3.11")
-- Checking for module 'fontconfig'
-- Found fontconfig, version 2.13.1
-- Found Fontconfig: /usr/lib64/libfontconfig.so
-- Found JPEG: /usr/lib64/libjpeg.so (found version "62")
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.8")
-- Found PNG: /usr/lib64/libpng.so (found version "1.2.49")
-- Found TIFF: /usr/lib64/libtiff.so (found version "4.0.3")
I can reproduce this issue using the Dockerfile from this repository by adding libpng and libpng-devel via yum to the image.
-- Found Freetype: /opt/lib/libfreetype.so (found version "2.10.1")
-- Checking for module 'fontconfig'
-- Found fontconfig, version 2.13.1
-- Found Fontconfig: /opt/lib/libfontconfig.so
-- Found JPEG: /opt/lib/libjpeg.so (found version "62")
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.8")
-- Found PNG: /opt/lib/libpng.so (found version "1.6.37")
-- Found TIFF: /opt/lib/libtiff.so (found version "4.1.0")
Output of Poppler build after installing libpng and libpng-devel via yum:
-- Found Freetype: /opt/lib/libfreetype.so (found version "2.10.1")
-- Checking for module 'fontconfig'
-- Found fontconfig, version 2.13.1
-- Found Fontconfig: /opt/lib/libfontconfig.so
-- Found JPEG: /opt/lib/libjpeg.so (found version "62")
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.8")
-- Found PNG: /usr/lib64/libpng.so (found version "1.2.49") // <=== Poppler uses old verion instead of new one
-- Found TIFF: /opt/lib/libtiff.so (found version "4.1.0")
Question:
How can I "force" Poppler to build with a custom (new) version of a library instead of the default (old) one?
I appreciate any help on this
The text was updated successfully, but these errors were encountered:
@asterikx did you try with setting LD_LIBRARY_PATH to $LAMBDA_TASK_ROOT/lib:$LAMBDA_TASK_ROOT/lib64:$LAMBDA_RUNTIME_DIR:$LAMBDA_RUNTIME_DIR/lib:$LAMBDA_TASK_ROOT:/opt/lib:/opt/lib64:/lib64:/usr/lib64
Hey @pavinthan, I solved the problem by adding the option -DCMAKE_PREFIX_PATH=${INSTALL_DIR} to any cmake invocation (see this discussion).
By default cmake does not use pkg-config so it's not aware of any non-default installations. I would recommend adding it to you compiler.Dockerfile as well.
Hi @pavinthan!
First, I want to second #2. Thank you for open-sourcing this lambda-layer!
I need to build libvips with poppler support. I'm using the
lambci/lambda:build-go1.x
as base image as it matches the lambda environment very closely.The lambda environment includes old versions of libraries such as
libpng
(which are not included in theamazonlinux:2018.03
image).Still, I'm building the newest version of those libraries from source as the older ones have known security problems (see libvips/libvips#1749 (comment)).
However, Poppler picks up the pre-installed (old) versions
/usr/lib64/
instead of the new version from/opt/lib
during the build, e.g. it uses/usr/lib64/libpng.so
instead of/opt/lib/libpng.so
.I can reproduce this issue using the Dockerfile from this repository by adding
libpng
andlibpng-devel
viayum
to the image.aws-lambda-poppler-layer/compiler.Dockerfile
Line 31 in 50e6d79
Original output of Poppler build:
Output of Poppler build after installing
libpng
andlibpng-devel
viayum
:Question:
How can I "force" Poppler to build with a custom (new) version of a library instead of the default (old) one?
I appreciate any help on this
The text was updated successfully, but these errors were encountered: