I had an issue with installing a few packages that ultimately depended on MbedTLS (via HTTP). Adding and building MbedTLS 1.0.2 seemed to work fine, but while precompiling it raised the following error with undefined symbol: mbedtls_mutex_unlock
:
julia> using MbedTLS
[ Info: Precompiling MbedTLS [739be429-bea8-5141-9913-cc70e7f3736d]
ERROR: LoadError: InitError: could not load library "/home/asher/.julia/artifacts/519367e9365948074c1fcc9f4365597f147a5ab7/lib/libmbedtls.so"
/usr/lib64/libmbedx509.so.0: undefined symbol: mbedtls_mutex_unlock
Stacktrace:
[1] dlopen(::String, ::UInt32; throw_error::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/Libdl/src/Libdl.jl:109
[2] dlopen(::String, ::UInt32) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/Libdl/src/Libdl.jl:109
[3] __init__() at /home/asher/.julia/packages/MbedTLS_jll/qGMUr/src/wrappers/x86_64-linux-gnu.jl:74
[4] _include_from_serialized(::String, ::Array{Any,1}) at ./loading.jl:697
[5] _require_search_from_serialized(::Base.PkgId, ::String) at ./loading.jl:782
[6] _require(::Base.PkgId) at ./loading.jl:1007
[7] require(::Base.PkgId) at ./loading.jl:928
[8] require(::Module, ::Symbol) at ./loading.jl:923
[9] include(::Function, ::Module, ::String) at ./Base.jl:380
[10] include(::Module, ::String) at ./Base.jl:368
[11] top-level scope at none:2
[12] eval at ./boot.jl:331 [inlined]
[13] eval(::Expr) at ./client.jl:467
[14] top-level scope at ./none:3
during initialization of module MbedTLS_jll
in expression starting at /home/asher/.julia/packages/MbedTLS/VbsaQ/src/MbedTLS.jl:3
ERROR: Failed to precompile MbedTLS [739be429-bea8-5141-9913-cc70e7f3736d] to /home/asher/.julia/compiled/v1.5/MbedTLS/bf9T0_1dM57.ji.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1305
[3] _require(::Base.PkgId) at ./loading.jl:1030
[4] require(::Base.PkgId) at ./loading.jl:928
[5] require(::Module, ::Symbol) at ./loading.jl:923
Through a little trial and error, I found that manually installing MbedTLS as version 0.7.0 seemed to work out. Posting this here in case (1) anyone else is encountering this issue and (2) anyone has a good explanation for why this was happening.