@@ -57,8 +57,29 @@ if [[ "$(uname -s)" == "Linux" ]]; then
5757
5858 local _jf
5959
60- # libcrypto: override stale system version via LD_PRELOAD
61- _jf=$(_jfind_artifact libcrypto.so.3) && _jpreloads+=("$_jf")
60+ # libcrypto: prefer Julia's own bundled libcrypto (guaranteed compatible with its
61+ # own libssl). Julia 1.12+ ships libcrypto in lib/julia/; older versions don't,
62+ # so fall back to the artifact for those.
63+ # Use type -P to bypass the julia shell function and find the real binary in PATH.
64+ # (command -v julia returns the function name when julia is a shell function.)
65+ _julia_real=$(type -P julia 2>/dev/null || command -v julia)
66+ [[ -L "$_julia_real" ]] && _julia_real=$(readlink -f "$_julia_real")
67+ # juliaup installs a launcher shim (julialauncher) rather than a real julia
68+ # binary, so dirname-relative paths are wrong. Find the actual julia install
69+ # directory by querying `juliaup status` for the active version.
70+ if [[ "$(basename "$_julia_real")" == "julialauncher" ]] && command -v juliaup &>/dev/null; then
71+ _jver=$(juliaup status 2>/dev/null | awk '$1 == "*" {print $3}' | head -1)
72+ if [[ -n "$_jver" ]]; then
73+ _jdepot=$(printf '%s' "${JULIA_DEPOT_PATH:-$HOME/.julia}" | cut -d: -f1)
74+ _julia_real="$_jdepot/juliaup/julia-${_jver}/bin/julia"
75+ fi
76+ fi
77+ _julia_bundled_crypto="$(dirname "$_julia_real")/../lib/julia/libcrypto.so.3"
78+ if [[ -f "$_julia_bundled_crypto" ]]; then
79+ _jpreloads+=("$(realpath "$_julia_bundled_crypto")")
80+ else
81+ _jf=$(_jfind_artifact libcrypto.so.3) && _jpreloads+=("$_jf")
82+ fi
6283
6384 # libiconv + libintl + libffi: add dirs to LD_LIBRARY_PATH
6485 # (libffi.so.6 is needed by Glib_jll on modern distros that only ship libffi.so.8)
0 commit comments