在最新的Alpine Linux版本(3.10)上,存在一些构建问题,这些问题阻止了两个软件包的编译:
termio
已知问题,在更高版本中已修复)patch
来说太模糊了)要重现此问题和解决方案,请在Alpine 3.10( cd depends && make NO_QT=1
上克隆此仓库。 通过解决这两个问题,depends系统可以在Alpine上毫无问题地构建,我也能够编译比特币二进制文件而没有问题。
预期行为
依存关系应该没有问题。
实际行为
找不到OpenSSL termio标头:
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.
ZeroMQ补丁将不适用:
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
重现
在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
系统信息
从提交f8b0b190a开始,它在master
分支上。
cat /etc/alpine-release
3.10.2
感谢您的举报。 我已经转载了这两个问题。 将审查您的PR。
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'
要注意的一件事是,该修补程序在安装了patch
的apk时可以正常工作:
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
我在Alpine上构建qt
时遇到了一个问题:
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
尽管通过apk
安装linux-headers
解决了这一问题。
感谢您指出了这一点。 我能够重现此问题以及解决方法。
最有用的评论
我在Alpine上构建
qt
时遇到了一个问题:尽管通过
apk
安装linux-headers
解决了这一问题。