Closes: #32512
- Provide Alpine build instructions in build-unix.md.
- Instructions cover building all components except USDT which is marked as unsupported for Alpine.
Closes: #32512
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32559.
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline for information on the review process. A summary of reviews will appear here.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
143 | + 144 | +#### Dependency Build Instructions 145 | + 146 | +Build requirements: 147 | + 148 | + apk add build-base cmake libressl libtool linux-headers python3
Why libtool?
I'd add pkgconf.
libressl ?
Crikey that's an old hangover....
I ported initial requirements from my current Alpine Dockerfile
I foolishly assumed this was just the case of Alpine splitting packages more granularly that e.g. Ubuntu, but taking a closer look now suspect this is a hangover from pre 0.12 where we supported SSL on RPC?
Removed in 5332082d009
Thanks, dropped libtool and added pkgconf
52 | @@ -53,6 +53,21 @@ To build dependencies for the current arch+OS: 53 | 54 | gmake 55 | 56 | +### Alpine 57 | + 58 | + apk add bash build-base cmake curl m4 make patch
Don't think you need m4 here?
Verified correct. thanks
64 | +To build dependencies for the current arch+OS: 65 | + 66 | + make 67 | + 68 | +> [!TIP] 69 | +> Avoid parallel build jobs when building depends on Alpine.
Why?
Dropped in 64986e1a44e108628b245ca977d2b8eb69ed5580
147 | + 148 | + apk add build-base cmake linux-headers pkgconf python3 149 | + 150 | +Now, you can either build from self-compiled [depends](#dependencies) or install the required dependencies: 151 | + 152 | + apk add libevent-dev boost-dev
FWIW, linux-headers is a dependency of boost-dev on my system.
61 | + 62 | + apk add bison linux-headers ninja-build pkgconf python3 xz 63 | + 64 | +To build dependencies for the current arch+OS: 65 | + 66 | + make
not even a nit: gmake, which explicitly refers to GNU Make, also works.
160 | +ZMQ dependencies (provides ZMQ API): 161 | + 162 | + apk add zeromq-dev 163 | + 164 | +User-Space, Statically Defined Tracing (USDT) is not directly compatible on 165 | +Alpine as it uses libc functionality not available on musl.
Did using the tracepoints work? Depends and a build will likely succeed, depends is just copying a header, and the CMake existence check is basic.
I don't have a good way to test this personally, as I'm primarily using alpine in a container. I've therefore updated the comment here to:
User-Space, Statically Defined Tracing (USDT) is not supported or tested on Alpine Linux at this time.
...which I think is more accurate having done more research into systemtap/dtrace/usdt support on Alpine. This doesn't preclude someone from getting it working/documenting the steps in the future.
57 | + 58 | + apk add bash build-base cmake curl make patch 59 | + 60 | +Skip the following packages if you don't intend to use the GUI and will build with [`NO_QT=1`](#dependency-options): 61 | + 62 | + apk add bison linux-headers ninja-build pkgconf python3 xz
apk:Executing ninja-build-1.12.1-r1.post-install
* this only installs ninja to /usr/lib/ninja-build/bin/ninja
* add that to your path to use it, or invoke it directly.
* for most uses, you want samurai instead:
* $ apk add samurai
* which has a "ninja" executable compatible with ninja.
and install samurai. Otherwise, Qt still complains:
CMake Warning at qtbase/cmake/QtBuildHelpers.cmake:12 (message):
The officially supported CMake generator for building Qt is Ninja / Ninja
Multi-Config. You are using: 'Unix Makefiles' instead. Thus, you might
encounter issues. Use at your own risk.
xz really necessary?Is xz really necessary?
It's currently pulled in as a cmake dep, but it also seems fine to be explicit.
and install samurai.
Yea, I think we should use samurai here.
Updated to samurai and removed explicit xz (seems preferable to let this be pulled in as a dependency, or not, by cmake) in 4f502baf8f649e30d9495760b54080c272882213
seems preferable to let this be pulled in as a dependency, or not, by cmake
Not sure? It's a dep for Qt, and some of its sub deps. Nothing to do with CMake (just happens to also be pulled in by it).
On Alpine Linux v3.22:
$ apk info -e xz | wc -l
0
$ gmake -C depends freetype_extracted # Succeeds, just like for any other package with a .tar.xz tarball.
Tested 64986e1a44e108628b245ca977d2b8eb69ed5580 on Alpine Linux v3.22.
ACK 4f502baf8f649e30d9495760b54080c272882213.