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
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32559.
See the guideline for information on the review process. A summary of reviews will appear here.
143+
144+#### Dependency Build Instructions
145+
146+Build requirements:
147+
148+    apk add build-base cmake libressl libtool linux-headers python3
libtool?
              
            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
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
m4 here?
              
            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.
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
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
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.
However, depends build the systemtap package. The subsequent configuration results in:
0# cmake -B build --toolchain depends/x86_64-pc-linux-musl/toolchain.cmake
1<snip>
2  USDT tracing ........................ ON
3<snip>
And the build succeeds.
cc @0xB10C
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:
0User-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:0Executing ninja-build-1.12.1-r1.post-install
1* this only installs ninja to /usr/lib/ninja-build/bin/ninja
2* add that to your path to use it, or invoke it directly.
3* for most uses, you want samurai instead:
4*  $ apk add samurai
5* which has a "ninja" executable compatible with ninja.
and install samurai. Otherwise, Qt still complains:
0CMake Warning at qtbase/cmake/QtBuildHelpers.cmake:12 (message):
1  The officially supported CMake generator for building Qt is Ninja / Ninja
2  Multi-Config.  You are using: 'Unix Makefiles' instead.  Thus, you might
3  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.
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:
0$ apk info -e xz | wc -l
10
2$ gmake -C depends freetype_extracted  # Succeeds, just like for any other package with a .tar.xz tarball.