doc: add alpine build instructions #32559

pull willcl-ark wants to merge 2 commits into bitcoin:master from willcl-ark:alpine-build-docs changing 2 files +51 −0
  1. willcl-ark commented at 9:49 AM on May 19, 2025: member

    Closes: #32512

    • Provide Alpine build instructions in build-unix.md.
    • Instructions cover building all components except USDT which is marked as unsupported for Alpine.
  2. DrahtBot commented at 9:49 AM on May 19, 2025: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32559.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  3. DrahtBot added the label Docs on May 19, 2025
  4. in doc/build-unix.md:148 in 5937bc78ae outdated
     143 | +
     144 | +#### Dependency Build Instructions
     145 | +
     146 | +Build requirements:
     147 | +
     148 | +    apk add build-base cmake libressl libtool linux-headers python3
    


    hebasto commented at 10:59 AM on May 19, 2025:

    Why libtool?


    hebasto commented at 11:01 AM on May 19, 2025:

    I'd add pkgconf.


    fanquake commented at 11:43 AM on May 19, 2025:

    libressl ?


    willcl-ark commented at 9:19 AM on May 20, 2025:

    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


    willcl-ark commented at 9:19 AM on May 20, 2025:

    Thanks, dropped libtool and added pkgconf

  5. willcl-ark force-pushed on May 20, 2025
  6. doc: add alpine build instructions 5332082d00
  7. willcl-ark force-pushed on May 20, 2025
  8. in depends/README.md:58 in 030c06562c outdated
      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
    


    fanquake commented at 3:54 PM on May 20, 2025:

    Don't think you need m4 here?


    willcl-ark commented at 6:41 PM on May 20, 2025:

    Verified correct. thanks

  9. in depends/README.md:69 in 030c06562c outdated
      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.
    


    luke-jr commented at 6:22 PM on May 20, 2025:

    Why?


    fanquake commented at 6:24 PM on May 20, 2025:

    Can be dropped after #32568.


    fanquake commented at 10:03 AM on June 4, 2025:

    #32568 landed.


    willcl-ark commented at 10:08 AM on June 4, 2025:

    Dropped in 64986e1a44e108628b245ca977d2b8eb69ed5580

  10. willcl-ark force-pushed on May 20, 2025
  11. willcl-ark force-pushed on Jun 4, 2025
  12. willcl-ark marked this as ready for review on Jun 4, 2025
  13. in doc/build-unix.md:152 in 64986e1a44 outdated
     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
    


    hebasto commented at 4:04 PM on June 27, 2025:

    FWIW, linux-headers is a dependency of boost-dev on my system.

  14. in depends/README.md:66 in 64986e1a44 outdated
      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
    


    hebasto commented at 4:09 PM on June 27, 2025:

    not even a nit: gmake, which explicitly refers to GNU Make, also works.

  15. in doc/build-unix.md:165 in 64986e1a44 outdated
     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.
    


    hebasto commented at 4:12 PM on June 27, 2025:

    However, depends build the systemtap package. The subsequent configuration results in:

    # cmake -B build --toolchain depends/x86_64-pc-linux-musl/toolchain.cmake
    <snip>
      USDT tracing ........................ ON
    <snip>
    

    And the build succeeds.

    cc @0xB10C


    fanquake commented at 3:13 PM on July 15, 2025:

    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.


    willcl-ark commented at 8:37 PM on July 15, 2025:

    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.

  16. in depends/README.md:62 in 64986e1a44 outdated
      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
    


    hebasto commented at 4:37 PM on June 27, 2025:
    1. I think we should consider a note from 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.
    
    1. Is xz really necessary?

    fanquake commented at 2:51 PM on July 15, 2025:

    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.


    willcl-ark commented at 8:34 PM on July 15, 2025:

    Updated to samurai and removed explicit xz (seems preferable to let this be pulled in as a dependency, or not, by cmake) in 4f502baf8f649e30d9495760b54080c272882213


    fanquake commented at 10:01 PM on July 15, 2025:

    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).


    hebasto commented at 11:25 AM on July 17, 2025:

    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.
    
  17. hebasto commented at 4:39 PM on June 27, 2025: member

    Tested 64986e1a44e108628b245ca977d2b8eb69ed5580 on Alpine Linux v3.22.

  18. doc: add alpine depends build instructions 4f502baf8f
  19. willcl-ark force-pushed on Jul 15, 2025
  20. hebasto commented at 11:26 AM on July 17, 2025: member

    ACK 4f502baf8f649e30d9495760b54080c272882213.

  21. fanquake merged this on Aug 1, 2025
  22. fanquake closed this on Aug 1, 2025


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-22 18:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me