Libmbedtls not defined in julia 1.4.1 on ARM (Raspberry Pi)

I try to install HTTP (requiring MbedTLS) on a Raspberry Pi 3 in julia 1.4.1 (official binaries).
The armv7l platform should be supported as far as I can see (Releases · JuliaBinaryWrappers/MbedTLS_jll.jl · GitHub ), but I get the following error when using HTTP:

ERROR: UndefVarError: libmbedtls not defined

Rebuilding HTTP, MbedTLS or MbedTLS_jll did not solve the problem. I can see the libmbedtls.so.2.16.0 in the folder ~/.julia/artifacts/f2ef98b4f23c9b3dec27d9c65218d83b31c0f9c5/lib/ . I guess that the path of this libary should be the value of libmbedtls.

Any ideas how to debug this issue?

(@v1.4) pkg> build MbedTLS
(@v1.4) pkg> build MbedTLS_jll

julia> using HTTP
[ Info: Precompiling HTTP [cd3eb016-35fb-5094-929b-558a96fad6f3]
ERROR: LoadError: LoadError: UndefVarError: libmbedtls not defined
Stacktrace:
 [1] MbedTLS.SSLConfig() at /home/pi/.julia/packages/MbedTLS/VbsaQ/src/ssl.jl:18
 [2] top-level scope at /home/pi/.julia/packages/HTTP/GkPBm/src/ConnectionPool.jl:647
 [3] include(::Module, ::String) at ./Base.jl:377
 [4] include(::String) at /home/pi/.julia/packages/HTTP/GkPBm/src/HTTP.jl:1
 [5] top-level scope at /home/pi/.julia/packages/HTTP/GkPBm/src/HTTP.jl:25
 [6] include(::Module, ::String) at ./Base.jl:377
 [7] top-level scope at none:2
 [8] eval at ./boot.jl:331 [inlined]
 [9] eval(::Expr) at ./client.jl:449
 [10] top-level scope at ./none:3
in expression starting at /home/pi/.julia/packages/HTTP/GkPBm/src/ConnectionPool.jl:647
in expression starting at /home/pi/.julia/packages/HTTP/GkPBm/src/HTTP.jl:25
ERROR: Failed to precompile HTTP [cd3eb016-35fb-5094-929b-558a96fad6f3] to /home/pi/.julia/compiled/v1.4/HTTP/zXWya_wGtzX.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1272
 [3] _require(::Base.PkgId) at ./loading.jl:1029
 [4] require(::Base.PkgId) at ./loading.jl:927
 [5] require(::Module, ::Symbol) at ./loading.jl:922

(@v1.4) pkg> st
Status `~/.julia/environments/v1.4/Project.toml`
  [1b08a953] Dash v0.1.0 [`~/.julia/dev/Dash`]
  [cd3eb016] HTTP v0.8.14
  [739be429] MbedTLS v1.0.2
  [c8ffd9c3] MbedTLS_jll v2.16.0+1
  [7e0a740d] WeatherStation v0.1.0 [`~/.julia/dev/WeatherStation`]

julia> VERSION
v"1.4.1"
pi@wetter:~ $ cat /etc/issue
Raspbian GNU/Linux 10 \n \l

pi@wetter:~ $ uname -a
Linux wetter 4.19.57-v7+ #1244 SMP Thu Jul 4 18:45:25 BST 2019 armv7l GNU/Linux

pi@wetter:~ $ ls -ld .julia/artifacts/f2ef98b4f23c9b3dec27d9c65218d83b31c0f9c5/
drwxr-xr-x 7 pi pi 4096 Apr 17 16:34 .julia/artifacts/f2ef98b4f23c9b3dec27d9c65218d83b31c0f9c5/
pi@wetter:~ $ ls .julia/artifacts/f2ef98b4f23c9b3dec27d9c65218d83b31c0f9c5/
bin  include  lib  logs  share
pi@wetter:~ $ ls .julia/artifacts/f2ef98b4f23c9b3dec27d9c65218d83b31c0f9c5/l
lib/  logs/ 
pi@wetter:~ $ ls .julia/artifacts/f2ef98b4f23c9b3dec27d9c65218d83b31c0f9c5/l
lib/  logs/ 
pi@wetter:~ $ ls .julia/artifacts/f2ef98b4f23c9b3dec27d9c65218d83b31c0f9c5/lib/
libmbedcrypto.a   libmbedcrypto.so.2.16.0  libmbedtls.a   libmbedtls.so.12      libmbedx509.a   libmbedx509.so.0
libmbedcrypto.so  libmbedcrypto.so.3       libmbedtls.so  libmbedtls.so.2.16.0  libmbedx509.so  libmbedx509.so.2.16.0
pi@wetter:~ $ ls -l .julia/artifacts/f2ef98b4f23c9b3dec27d9c65218d83b31c0f9c5/lib/
total 1896
-r-xr-xr-x 1 pi pi 604298 Apr 17 16:34 libmbedcrypto.a
lrwxrwxrwx 1 pi pi     18 Apr 17 16:34 libmbedcrypto.so -> libmbedcrypto.so.3
-r-xr-xr-x 1 pi pi 522685 Apr 17 16:34 libmbedcrypto.so.2.16.0
lrwxrwxrwx 1 pi pi     23 Apr 17 16:34 libmbedcrypto.so.3 -> libmbedcrypto.so.2.16.0
-r-xr-xr-x 1 pi pi 288732 Apr 17 16:34 libmbedtls.a
lrwxrwxrwx 1 pi pi     16 Apr 17 16:34 libmbedtls.so -> libmbedtls.so.12
lrwxrwxrwx 1 pi pi     20 Apr 17 16:34 libmbedtls.so.12 -> libmbedtls.so.2.16.0
-r-xr-xr-x 1 pi pi 285996 Apr 17 16:34 libmbedtls.so.2.16.0
-r-xr-xr-x 1 pi pi 107250 Apr 17 16:34 libmbedx509.a
lrwxrwxrwx 1 pi pi     16 Apr 17 16:34 libmbedx509.so -> libmbedx509.so.0
lrwxrwxrwx 1 pi pi     21 Apr 17 16:34 libmbedx509.so.0 -> libmbedx509.so.2.16.0
-r-xr-xr-x 1 pi pi 119764 Apr 17 16:34 libmbedx509.so.2.16.0

MbedTLS does work on version 0.7.0 (not requiring MbedTLS_jll) on my Raspberry, but it fails for version 1.0.0, 1.0.1 and 1.0.2 (with the same error message above).

https://github.com/JuliaPackaging/Yggdrasil/pull/887

1 Like

Thanks a lot @giordano for looking into this!

Let’s change approach: Fix filtering of armv7l platforms in JLL wrappers by giordano · Pull Request #1 · JuliaBinaryWrappers/MbedTLS_jll.jl · GitHub