simplex-chat/simplexmq

"extra-libraries: crypto" error causes docker build to fail

Gregory92 opened this issue · 2 comments

Starting with a fresh git clone of the stable branch, running a docker build as follows will fail;

' docker buildx build -t smp:SomeHash --build-arg APP="smp-server" --build-arg APP_PORT="5223" .`

with

590.1 Configuring library for simplexmq-5.4.0.7..
591.5 Error: cabal-3.10.1.0: Missing dependency on a foreign library:
591.5 * Missing (or bad) C library: crypto

I tried adding libssl-dev and libssl3 to the Dockerfile, but the same error would manifest itself. Thinking that maybe the changes introduced in commit c22c15a were to blame, I removed lines 163-164 in simplexmq.cabal. This advanced the docker build process further until I reached the following error

718.8 cbits/sha512.c:1:10: error:
718.8      fatal error: openssl/sha.h: No such file or directory
718.8         1 | #include <openssl/sha.h>
718.8           |          ^~~~~~~~~~~~~~~
718.8   |
718.8 1 | #include <openssl/sha.h>
718.8   |          ^
718.8 compilation terminated.

Now knowing that eliminating the extra "library check" allowed cabal to get further along until the reason for the check in the first place appeared, I added line 163-164 back in, but also added extra-lib-dirs: option as a new line 165 thinking maybe the libs weren't in the include directory for some reason.

extra-lib-dirs:
   /usr/include/openssl/
   /usr/include/x86_64-linux-gnu/openssl/
   /usr/lib/x86_64-linux-gnu/
  /lib/x86_64-linux-gnu/

But now we get right back to the original error. At this point, I am not sure where to proceed next.
running on upto date Debian 12 and Docker engine 24.0.7

Let me know if you need additional information.

Compile the latest beta, it was fixed there.

Compile the latest beta, it was fixed there.

Used checkout v5.5.0-beta.2 (d0588bd)

Can confirm, both smp and xftp images built fine and are functional/reachable when deployed. Looking forward to the 5.5.x series and later!

Thank you.