Shuffle depends instructions and recommend modern make for macOS #32086

pull Sjors wants to merge 2 commits into bitcoin:master from Sjors:2025/03/mc-make changing 1 files +88 −65
  1. Sjors commented at 12:37 pm on March 17, 2025: member

    macOS ships with GNU Make 3.81 from 2006. This has caused difficult to debug issues, e.g. #32070 and #30978.

    Tell users / developers who use the depends system to install a modern version of make.

    This PR does not change the non-depends build.

    Although Homebrew allows overriding the system make, we instead just instruct users to build with gmake. This way there should be no impact on other projects they wish to compile.

    To increase the likeliness of anyone actually seeing and following this instruction, the first commit moves things around in depends/README.md. It now starts with instructions for a local build and moves cross-compilation to the end. For each platform it shows what to install (apt install, brew install, etc) and what command to run (make or gmake).

    There previously was no macOS specific section, so this is added. It points to the general build-osx.md for how to install the Xcode Command Line Tools and Homebrew Package Manager.

    I didn’t test on an empty system.

    Preview: https://github.com/Sjors/bitcoin/tree/2025/03/mc-make/depends#depends-build

  2. DrahtBot commented at 12:37 pm on March 17, 2025: contributor

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

    Code Coverage & Benchmarks

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK willcl-ark
    Concept ACK hebasto

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #31802 (Add bitcoin-{node,gui} to release binaries for IPC by Sjors)
    • #30997 (build: Switch to Qt 6 by hebasto)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  3. Sjors force-pushed on Mar 17, 2025
  4. hebasto commented at 1:19 pm on March 17, 2025: member

    Tell users / developers who use the depends system to install a modern version of make.

    Concept ACK on that.

  5. in depends/README.md:24 in 3ad36fce4b outdated
    22-To build for another arch/OS:
    23+### macOS
    24 
    25-    make HOST=host-platform-triplet
    26+Install Xcode Command Line Tools and Homebrew Package Manager,
    27+see [build-osx.md](../doc/build-osx.md).
    


    willcl-ark commented at 1:59 pm on March 17, 2025:
    0Install Xcode Command Line Tools, Homebrew Package Manager, and
    1the Required Dependencies from [build-osx.md](../doc/build-osx.md).
    

    Sjors commented at 2:39 pm on March 17, 2025:
    The Required Dependencies would defeat the purpose of depends. at least boost and libevent. But maybe pkgconf and cmake should be added to the brew install incantation?

    willcl-ark commented at 4:49 pm on March 17, 2025:
    Right, I meant those two only and would agree with adding them to the incantation here, if you agreed.

    Sjors commented at 5:05 pm on March 17, 2025:
    Added

    Sjors commented at 7:55 am on March 18, 2025:
    Apparently pkgconf isn’t needed, see #32086 (review)
  6. willcl-ark approved
  7. willcl-ark commented at 2:11 pm on March 17, 2025: member

    ACK 3ad36fce4be0aa413639468118d6dbd7379a2106

    I confirm that the make brew formula symlinks itself to gmake.

    Did a successful (NO_QT=1) depends build using gmake on macOS 15 and no longer see the errors from #30978.

    I think it would be good to keep #30978 open if this is merged, to address #30978 (comment)

  8. DrahtBot requested review from hebasto on Mar 17, 2025
  9. Sjors force-pushed on Mar 17, 2025
  10. willcl-ark approved
  11. willcl-ark commented at 7:47 pm on March 17, 2025: member
    reACK 31a0c5f3caa80c8e6baf4e8f909a673442a852d5
  12. in depends/README.md:3 in 31a0c5f3ca outdated
    0@@ -1,16 +1,59 @@
    1-### Usage
    2+# Depends build
    3+
    4+This is a system of building and caching dependencies necessary for building Bitcoin,
    


    fanquake commented at 5:55 am on March 18, 2025:

    s/Bitcoin/Bitcoin Core/

    either on your local machine or through cross-compilation

    I think this needs to be rephrased, or just dropped.


    Sjors commented at 7:59 am on March 18, 2025:
    I pushed a variation.
  13. doc: shuffle depends instructions 1ce974182d
  14. doc: recommend modern make for macOS depends
    macOS ships with GNU Make 3.81 from 2006. This has caused
    difficult to debug issues, see e.g.
    9157d9e449870851ef455e077249ac46fc2df24c.
    3dd8223d44
  15. in depends/README.md:26 in 31a0c5f3ca outdated
    25-    make HOST=host-platform-triplet
    26+Install Xcode Command Line Tools and Homebrew Package Manager,
    27+see [build-osx.md](../doc/build-osx.md).
    28 
    29-For example:
    30+    brew install cmake pkgconf make
    


    fanquake commented at 5:56 am on March 18, 2025:
    Do we need to copy-paste things here, given you’ve already linked to somewhere else that already has the same info? In either case, pkgconf isn’t needed with depends, so should be dropped.

    Sjors commented at 7:54 am on March 18, 2025:
    The main install instructions pull in libevent, boost (and pkgconf) which are not needed for a depends build. That’s not going to be obvious, as demonstrated by the fact that I didn’t know pkgconf isn’t needed :-) (which I’ll drop)

    willcl-ark commented at 11:11 am on March 19, 2025:

    Unrelated to the changes in this PR, but as I was on a fresh bookworm docker image (sha256:18023f131f52fc3ea21973cabffe0b216c60b417fd2478e94d9d59981ebba6af), it appears that depends build fails to build bdb on Debian when following current instructions:

     0# docker run -it debian:bookworm /bin/bash
     1
     2apt update
     3apt install -y git
     4git clone --depth=1 https://github.com/bitcoin/bitcoin
     5cd bitcoin/depends
     6apt install -y cmake curl make patch
     7make -j10 NO_QT=1
     8
     9# build logs
    10Fetching db-4.8.30.NC.tar.gz from https://download.oracle.com/berkeley-db
    11  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
    12                                 Dload  Upload   Total   Spent    Left  Speed
    13100 21.7M  100 21.7M    0     0  15.5M      0  0:00:01  0:00:01 --:--:-- 15.5M
    14/bitcoin/depends/work/download/bdb-4.8.30/db-4.8.30.NC.tar.gz.temp: OK
    15Extracting bdb...
    16/bitcoin/depends/sources/db-4.8.30.NC.tar.gz: OK
    17Preprocessing bdb...
    18patching file dbinc/atomic.h
    19patching file mp/mp_fget.c
    20patching file mp/mp_mvcc.c
    21patching file mp/mp_region.c
    22patching file mutex/mut_method.c
    23patching file mutex/mut_tas.c
    24Configuring bdb...
    25
    26<snip>
    27
    28checking how to run the C++ preprocessor... /lib/cpp
    29configure: error: in `/bitcoin/depends/work/build/x86_64-pc-linux-gnu/bdb/4.8.30-a3c72735bb6/build_unix':
    30configure: error: C++ preprocessor "/lib/cpp" fails sanity check
    31See `config.log' for more details.
    32make: *** [funcs.mk:303: /bitcoin/depends/x86_64-pc-linux-gnu/.bdb_stamp_configured] Error 1
    33
    34<snip>
    35
    36# This is fixed by installing g++
    37apt install -y g++
    

    Sjors commented at 11:49 am on March 19, 2025:

    Unrelated to the changes in this PR

    Indeed I’d like to avoid changing existing instructions here.

  16. Sjors force-pushed on Mar 18, 2025
  17. laanwj commented at 9:57 am on March 18, 2025: member

    i’m hesitant about recommending people to use GNU tools on BSD variants, one of the advantages i hoped cmake would have is that we can just use native build tools as-is.

    macOS ships with GNU Make 3.81 from 2006. This has caused difficult to debug issues, e.g. #32070 and #30978.

    That said, i didn’t realize that macOS (which i consider more like a BSD variant) already ships with GNU make, that changes things.

  18. Sjors commented at 10:02 am on March 18, 2025: member
    @laanwj in the longer run I hope we can “just” move depends over to cmake entirely.
  19. hebasto commented at 10:03 am on March 18, 2025: member

    i’m hesitant about recommending people to use GNU tools on BSD variants, one of the advantages i hoped cmake would have is that we can just use native build tools as-is.

    That’s true.

    However, our depends build subsystem is not managed by CMake and requires GNU Make, not BSD Make, to run.

  20. laanwj commented at 10:09 am on March 18, 2025: member

    @laanwj in the longer run I hope we can “just” move depends over to cmake entirely.

    However, our depends build subsystem is not managed by CMake and requires GNU Make, not BSD Make, to run.

    Ah yes for the depends it’s unavoidable right now, makes sense, sorry.

  21. Sjors commented at 11:11 am on March 18, 2025: member
    @laanwj I clarified the PR description by adding “This PR does not change the non-depends build.”
  22. laanwj added the label Docs on Mar 18, 2025
  23. willcl-ark approved
  24. willcl-ark commented at 11:29 am on March 19, 2025: member

    reACK 3dd8223d44928a7e7c2cdc451655a8ef7d1ef5be

    I’ve only tested the revised macOS instructions on a macOS system that already had other packages installed on it (not fresh), as I don’t have a fresh machine to test on currently.


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: 2025-03-28 15:12 UTC

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