Compilación de Erlang: crypto: Using OpenSSL 3.0 is not yet recommended for production code.
Se me mostraba el siguiente aviso al compilar Erlang con kerl
:
j@bt ~ % kerl build 24.3.4.11
Extracting source code
Building Erlang/OTP 24.3.4.11 (24.3.4.11), please wait...
APPLICATIONS INFORMATION (See: /home/j/.kerl/builds/24.3.4.11/otp_build_24.3.4.11.log)
* crypto : Using OpenSSL 3.0 is not yet recommended for production code.
Se necesita OpenSSL como dependencia, y por defecto encuentra la versión 3.0
instalada por Arch. Seguí esta guía para compilar la versión 1.1.1
sin quitar la 3.0
. Lo configuré para instalar en /usr/local/openssl-1.1
(ver nota final)
$ git clone https://github.com/openssl/openssl.git --branch OpenSSL_1_1_1-stable
$ ./config --prefix=/usr/local/openssl-1.1 shared -fPIC
$ make depend && make && sudo make install
Añadir esta línea a ~/.kerlrc
# ~/.kerlrc
# For Erlang 24
KERL_CONFIGURE_OPTIONS="--with-ssl=/usr/local/openssl-1.1"
Ahora al compilar Erlang nuevamente con kerl build 24.3.4.11
no aparecía ningún aviso.
Veamos la razón por la que emplear un --prefix
distinto al /usr/local
establecido por defecto por ./config
. Al ser ésta una ubicación habitual, el proceso de compilación de Erlang encuentra ahí las librerías aunque no se especifique explícitamente en --with-ssl
. Al cambiar a otro directorio poco común podemos enlazar con la versión del sistema si no especificamos --with-ssl
, u otras versiones compiladas manualmente en paths concretos con --with-ssl
.
Podemos hacer lo mismo con asdf:
j@bt /usr/local/bin % CFLAGS="-O2 -g -march=native" KERL_BUILD_DOCS=yes KERL_CONFIGURE_OPTIONS="--with-ssl=/usr/local/openssl-1.1" asdf install erlang 24.3.4.11
asdf_24.3.4.11 is not a kerl-managed Erlang/OTP installation
No build named asdf_24.3.4.11
Downloading 24.3.4.11 to /home/j/.asdf/downloads/erlang/24.3.4.11...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 102M 100 102M 0 0 46.0M 0 0:00:02 0:00:02 --:--:-- 45.1M
Extracting source code
Building Erlang/OTP 24.3.4.11 (asdf_24.3.4.11), please wait...
Building docs...
Erlang/OTP 24.3.4.11 (asdf_24.3.4.11) has been successfully built
Cleaning up compilation products for 24.3.4.11
Cleaned up compilation products for 24.3.4.11 under /home/j/.asdf/plugins/erlang/kerl-home/builds
Podemos examinar que se hayan aplicado las opciones de KERL_CONFIGURE_OPTIONS en :
# /home/j/.asdf/plugins/erlang/kerl-home/builds/asdf_24.3.4.11/otp_build_24.3.4.11.log
*** Thu Jun 1 09:31:52 AM CEST 2023 - kerl build 24.3.4.11 ***
* KERL_BUILD_DOCS=yes
* KERL_BUILD_BACKEND=git
/home/j/.asdf/plugins/erlang/kerl-home/builds/asdf_24.3.4.11/otp_src_24.3.4.11/configure --cache-file=/dev/null CFLAGS=-O2\ -g\ -march=native --with-ssl=/usr/local/openssl-1.1
=== Running configure in /home/j/.asdf/plugins/erlang/kerl-home/builds/asdf_24.3.4.11/otp_src_24.3.4.11/erts ===
./configure '--with-ssl=/usr/local/openssl-1.1' CFLAGS='-O2 -g -march=native' --disable-option-checking --cache-file=/dev/null --srcdir="/home/j/.asdf/plugins/erlang/kerl-home/builds/asdf_24.3.4.11/otp_src_24.3.4.11/erts"
checking build system type... x86_64-pc-linux-gnu
[...]