build: use make < 3.82 syntax for define directive #32070

pull Sjors wants to merge 1 commits into bitcoin:master from Sjors:2025/03/capnp-make changing 2 files +2 −2
  1. Sjors commented at 3:15 pm on March 14, 2025: member

    From the GNU make 3.82 release announcement (2010):

    The ‘define’ make directive now allows a variable assignment operator after the variable name, to allow for simple, conditional, or appending multi-line variable assignment.

    macOS ships with 3.81 (2006). This caused the multiprocess config options to be ignored.

    Fixes #32068

  2. DrahtBot commented at 3:15 pm on March 14, 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/32070.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK ryanofsky

    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:

    • #31741 (multiprocess: Add libmultiprocess git subtree by ryanofsky)
    • #30975 (ci: build multiprocess on most jobs by Sjors)

    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. DrahtBot added the label Build system on Mar 14, 2025
  4. Sjors commented at 3:17 pm on March 14, 2025: member
    We don’t seem to specify a minimum make version?
  5. build: use make < 3.82 syntax for define directive
    From the GNU make 3.82 release announcement:
    
    * The 'define' make directive now allows a variable assignment operator
      after the variable name, to allow for simple, conditional, or appending
      multi-line variable assignment.
    
    macOS ships with 3.81. This caused the multiprocess config options
    to be ignored.
    
    Fixes #32068
    
    Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
    9157d9e449
  6. Sjors force-pushed on Mar 14, 2025
  7. ryanofsky approved
  8. ryanofsky commented at 3:44 pm on March 14, 2025: contributor

    Code review ACK 9157d9e449870851ef455e077249ac46fc2df24c. This is a pretty unusual bug and I don’t understand how it wasn’t causing any errors with make 3.81, just causing the flags to be ignored.

    (Another case where there was a problem with make 3.81 was https://github.com/bitcoin-core/libmultiprocess/issues/139 / #31741 (comment))

  9. Sjors commented at 3:50 pm on March 14, 2025: member

    I don’t understand how it wasn’t causing any errors with make 3.81

    I probably haven’t recently used the depends build to test multiprocess on my development machine. I would either use my locally install libmultiprocess or a (cross-compiled) Guix build.

    And macOS native CI doesn’t build depends with multiprocess.

  10. maflcko commented at 3:51 pm on March 14, 2025: member

    This is a pretty unusual bug and I don’t understand how it wasn’t causing any errors with make 3.81, just causing the flags to be ignored.

    In light of silent failures, it would be better to rule out this class of bug completely. Otherwise, a new instance will be added in the future, or will already exist somewhere in the code.

    I am not sure why reviewers should spend time on supporting build tools that were released about 20 years ago. So rejecting such a build tool early with a failure seems more appropriate and will likely save developer, reviewer and user time debugging silent failures.

  11. Sjors commented at 3:53 pm on March 14, 2025: member

    @maflcko I’m fine with introducing a minimum GNU make version, as long as we actually check the version (otherwise we’re back to silent failures).

    But note that I run the stock macOS GNU make all the time, as do many other devs. So new issues are likely to be caught during review, though they’ll still waste time debugging.

  12. maflcko commented at 3:56 pm on March 14, 2025: member
    (unrelated to the make issue, the same conceptual problem exists for the macOS bash version, but I guess the bash version check would be even harder to achieve and is only reliably avoidable by not writing bash code)
  13. fanquake added the label Needs backport (29.x) on Mar 16, 2025
  14. fanquake merged this on Mar 16, 2025
  15. fanquake closed this on Mar 16, 2025

  16. fanquake added this to the milestone 29.0 on Mar 16, 2025
  17. Sjors deleted the branch on Mar 16, 2025
  18. glozow referenced this in commit 4e438d326e on Mar 17, 2025
  19. glozow removed the label Needs backport (29.x) on Mar 17, 2025
  20. glozow commented at 2:12 am on March 17, 2025: member
    Backported in #32062
  21. hebasto commented at 11:33 am on March 17, 2025: member

    But note that I run the stock macOS GNU make all the time, as do many other devs. So new issues are likely to be caught during review, though they’ll still waste time debugging.

    FWIW, the stock macOS Make has other issues.

  22. Sjors commented at 11:37 am on March 17, 2025: member
    Is there a way we can pick up a modern homebrew version of make without forcing macOS devs and users to change their default make? (and without the use of env variables)
  23. hebasto commented at 11:41 am on March 17, 2025: member

    Is there a way we can pick up a modern homebrew version of make without forcing macOS devs and users to change their default make? (and without the use of env variables)

    I imagine something like that:

    0gmake -C depends -j 4
    
  24. Sjors commented at 12:37 pm on March 17, 2025: member
    Proposed in #32086.

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-29 00:12 UTC

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