#getting libcairo not found

17 messages · Page 1 of 1 (latest)

agile rain
#

i tried setting both of these... but no dice:

NIXPACKS_APT_PKGS=libcairo2,libcairo2-dev
NIXPACKS_PKGS= cairo

i still get this in my logs:

when i run sudo apt install libcairo2 and libcairo2-dev on jammy... everything works in my build

should i just stick that in the run command?

seems hacky

import cairosvg
File "/opt/venv/lib/python3.8/site-packages/cairosvg/__init__.py", line 26, in <module>
from . import surface  # noqa isort:skip
File "/opt/venv/lib/python3.8/site-packages/cairosvg/surface.py", line 9, in <module>
import cairocffi as cairo
File "/opt/venv/lib/python3.8/site-packages/cairocffi/__init__.py", line 47, in <module>
cairo = dlopen(
File "/opt/venv/lib/python3.8/site-packages/cairocffi/__init__.py", line 44, in dlopen
raise OSError(error_message)  # pragma: no cover
OSError: no library called "cairo-2" was found
no library called "cairo" was found
no library called "libcairo-2" was found
cannot load library 'libcairo.so.2': libcairo.so.2: cannot open shared object file: No such file or directory.  Additionally, ctypes.util.find_library() did not manage to locate a library called 'libcairo.so.2'
cannot load library 'libcairo.2.dylib': libcairo.2.dylib: cannot open shared object file: No such file or directory.  Additionally, ctypes.util.find_library() did not manage to locate a library called 'libcairo.2.dylib'
cannot load library 'libcairo-2.dll': libcairo-2.dll: cannot open shared object file: No such file or directory.  
sinful flintBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

mighty emberBOT
#

Project ID: N/A

orchid narwhal
#

it would be best for you to build your app with a dockerfile

agile rain
#

didn't even know nix supported dockerfiles

#

how do i convince it to use a dockerfile?

orchid narwhal
#

nixpacks and dockerfiles are not mutually exclusive, if you are using a dockerfile nixpacks has nothing to do with the build anymore

#

you simply place a Dockerfile in your repo

agile rain
#

cool

#

the thing is... it really looks like it's doing the right thing:

#9 17.60 Unpacking libcairo2:amd64 (1.16.0-5ubuntu2) ...
#9 17.63 Selecting previously unselected package libcairo-gobject2:amd64.

i suspect it's a path thing.

orchid narwhal
#

oh I know, it is doing the right thing but for some unknown reason during runtime it's like none of that stuff was ever installed

#

better to just use a Dockerfile for this kind of thing so you don't have to deal with the nixpacks stuff

agile rain
#

if i use a dockerfile... do i still get the environment variables exposed nicely with the control panel?

orchid narwhal
#

yes of course

agile rain
#

everything works... and the builds are faster because i can carefully control the layers. thanks a lot.

orchid narwhal
#

no problem!