Bitcoin: Alpine Linux 3.10 (último estable) tiene algunos problemas de compilación con dependencias

Creado en 20 sept. 2019  ·  3Comentarios  ·  Fuente: bitcoin/bitcoin

En la última versión de Alpine Linux (3.10), existen problemas de compilación que impiden la compilación de dos paquetes:

  • [] openssl (problema conocido con termio que se corrigió en versiones posteriores)
  • [] zeromq (el parche 4.3.1 es demasiado difuso para Alpine patch )

Para reproducir este problema y la solución, clone este repositorio en Alpine 3.10, cd depends && make NO_QT=1 . Al resolver estos 2 elementos, el sistema dependiente se construye sin problemas en Alpine y también he podido compilar los binarios de Bitcoin sin problemas.

Comportamiento esperado

Las dependencias deben construirse sin problemas.

Comportamiento real

No se encontró el encabezado termio de OpenSSL:

gcc -m64 -I.. -I../.. -I../modes -I../asn1 -I../evp -I../../include  -DOPENSSL_THREADS -D_REENTRANT -pipe -O2 -I/home/alpine/bitcoin/depends/x86_64-pc-linux-gnu/include -fPIC -Wa,--noexecstack -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM   -c -o ui_openssl.o ui_openssl.c
ui_openssl.c:232:11: fatal error: termio.h: No such file or directory
 # include <termio.h>
           ^~~~~~~~~~
compilation terminated.

El parche ZeroMQ no se aplicará:

make zeromq
Preprocessing zeromq...
patching file src/windows.hpp
Possibly reversed hunk 1 at 105
Hunk 1 FAILED 58/58.
 #include <winsock2.h>
 #include <windows.h>
 #include <mswsock.h>
+
+#if defined __MINGW64_VERSION_MAJOR && __MINGW64_VERSION_MAJOR < 4
+// Workaround for mingw-w64 < v4.0 which did not include ws2ipdef.h in iphlpapi.h.
+// Fixed in mingw-w64 by 9bd8fe9148924840d315b4c915dd099955ea89d1.
+#include <ws2def.h>
+#include <ws2ipdef.h>
+#endif
 #include <iphlpapi.h>

 #if !defined __MINGW32__
make: *** [funcs.mk:254: /home/alpine/bitcoin/depends/work/build/x86_64-pc-linux-gnu/zeromq/4.3.1-41472d87c95/.stamp_preprocessed] Error 1

Reproducir

En Alpine Linux 3.10 :

apk update
apk add git cmake make curl gcc g++ perl automake autoconf libtool pkgconfig python3

git clone https://github.com/bitcoin/bitcoin.git && cd bitcoin
cd depends
make NO_QT=1

Información del sistema

Esto está en la rama master partir de la confirmación f8b0b190a.

Especificaciones de la máquina:

  • Sistema operativo: Alpine Linux 3.10
  • CPU / RAM: AWS m5.8xlarge
  • Tamaño del disco: 80 GB
  • Tipo de disco (HD / SDD): volumen EBS
cat /etc/alpine-release
3.10.2
Bug Build system

Comentario más útil

También tuve un problema al construir qt en Alpine:

compiling thread/qmutex.cpp
In file included from thread/qmutex.cpp:734:
thread/qmutex_linux.cpp:49:10: fatal error: linux/futex.h: No such file or directory
 #include <linux/futex.h>
          ^~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:10849: .obj/qmutex.o] Error 1

Aunque eso fue resuelto por apk instalando el linux-headers .

Todos 3 comentarios

Gracias por informarnos. He reproducido ambos números. Revisará sus relaciones públicas.

making all in crypto/ui...
make[3]: Entering directory '/bitcoin/depends/work/build/x86_64-pc-linux-gnu/openssl/1.0.1k-9f8b92d0c9a/crypto/ui'
gcc -m64 -I.. -I../.. -I../modes -I../asn1 -I../evp -I../../include  -DOPENSSL_THREADS -D_REENTRANT -pipe -O2 -I/bitcoin/depends/x86_64-pc-linux-gnu/include -fPIC -Wa,--noexecstack -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM   -c -o ui_err.o ui_err.c
gcc -m64 -I.. -I../.. -I../modes -I../asn1 -I../evp -I../../include  -DOPENSSL_THREADS -D_REENTRANT -pipe -O2 -I/bitcoin/depends/x86_64-pc-linux-gnu/include -fPIC -Wa,--noexecstack -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM   -c -o ui_lib.o ui_lib.c
gcc -m64 -I.. -I../.. -I../modes -I../asn1 -I../evp -I../../include  -DOPENSSL_THREADS -D_REENTRANT -pipe -O2 -I/bitcoin/depends/x86_64-pc-linux-gnu/include -fPIC -Wa,--noexecstack -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM   -c -o ui_openssl.o ui_openssl.c
ui_openssl.c:232:11: fatal error: termio.h: No such file or directory
 # include <termio.h>
           ^~~~~~~~~~
compilation terminated.
make[3]: *** [<builtin>: ui_openssl.o] Error 1
make: Entering directory '/bitcoin/depends'
Preprocessing zeromq...
patching file src/windows.hpp
Possibly reversed hunk 1 at 105
Hunk 1 FAILED 58/58.
 #include <winsock2.h>
 #include <windows.h>
 #include <mswsock.h>
+
+#if defined __MINGW64_VERSION_MAJOR && __MINGW64_VERSION_MAJOR < 4
+// Workaround for mingw-w64 < v4.0 which did not include ws2ipdef.h in iphlpapi.h.
+// Fixed in mingw-w64 by 9bd8fe9148924840d315b4c915dd099955ea89d1.
+#include <ws2def.h>
+#include <ws2ipdef.h>
+#endif
 #include <iphlpapi.h>

 #if !defined __MINGW32__
make: *** [funcs.mk:254: /bitcoin/depends/work/build/x86_64-pc-linux-gnu/zeromq/4.3.1-1e82f76cb11/.stamp_preprocessed] Error 1
make: Leaving directory '/bitcoin/depends'

Una cosa a tener en cuenta es que el parche funcionará bien con el apk instalado patch :

patch -version
patch: unrecognized option: v
BusyBox v1.30.1 (2019-06-12 17:51:55 UTC) multi-call binary.

Usage: patch [OPTIONS] [ORIGFILE [PATCHFILE]]

    -p N    Strip N leading components from file names
    -i DIFF Read DIFF instead of stdin
    -R  Reverse patch
    -N  Ignore already applied patches
    -E  Remove output files if they become empty
    --dry-run   Don't actually change files
/ # apk add patch
(1/1) Installing patch (2.7.6-r6)
Executing busybox-1.30.1-r2.trigger
OK: 311 MiB in 64 packages
/ # patch --version
GNU patch 2.7.6
Copyright (C) 2003, 2009-2012 Free Software Foundation, Inc.
Copyright (C) 1988 Larry Wall

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Larry Wall and Paul Eggert

También tuve un problema al construir qt en Alpine:

compiling thread/qmutex.cpp
In file included from thread/qmutex.cpp:734:
thread/qmutex_linux.cpp:49:10: fatal error: linux/futex.h: No such file or directory
 #include <linux/futex.h>
          ^~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:10849: .obj/qmutex.o] Error 1

Aunque eso fue resuelto por apk instalando el linux-headers .

Gracias por señalar eso. Puedo reproducir este problema y la solución.

¿Fue útil esta página
0 / 5 - 0 calificaciones