cmake: Use `HINTS` instead of `PATHS` in `find_*` commands #32805

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:250624-qrencode changing 1 files +3 −3
  1. hebasto commented at 8:05 PM on June 24, 2025: member

    According to the CMake documentation, HINTS "should be paths computed by system introspection, such as a hint provided by the location of another item already found", which is precisely the case in the FindQRencode module.

    Entries in HINTS are searched before those in PATHS. On macOS, Homebrew’s libqrencode will therefore be located at its real path rather than via the symlink in the default prefix.

    A backport to 29.x is required for #32804, as this change prevents contamination of include directories by broad locations such as /usr/local/include or /opt/homebrew/include, which take precedence over Qt’s -iframework flags.

    Below is the relevant change in the configuration logs on my macOS 15.5 x64:

    • master branch @ ead44687483e9c936ba970de890c01d5e7ad3485:
    % cmake -B build -DBUILD_GUI=ON
    <snip>
    -- Found QRencode: /usr/local/lib/libqrencode.dylib (found version "4.1.1")
    <snip>
    
    • this PR:
    % cmake -B build -DBUILD_GUI=ON
    <snip>
    -- Found QRencode: /usr/local/Cellar/qrencode/4.1.1/lib/libqrencode.dylib (found version "4.1.1")
    <snip>
    
  2. cmake: Use `HINTS` instead of `PATHS` in `find_*` commands
    According to the CMake documentation, `HINTS` "should be paths computed
    by system introspection, such as a hint provided by the location of
    another item already found", which is precisely the case in the
    `FindQRencode` module.
    
    Entries in `HINTS` are searched before those in `PATHS`. On macOS,
    Homebrew’s `libqrencode` will therefore be located at its real path
    rather than via the symlink in the default prefix.
    ead4468748
  3. hebasto added the label Build system on Jun 24, 2025
  4. hebasto added the label Needs backport (29.x) on Jun 24, 2025
  5. DrahtBot commented at 8:05 PM on June 24, 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/32805.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK fanquake
    Concept ACK purpleKarrot

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

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  6. maflcko added this to the milestone 29.1 on Jun 25, 2025
  7. fanquake commented at 1:10 PM on June 25, 2025: member
  8. purpleKarrot commented at 1:45 PM on June 25, 2025: contributor

    utACK

    Nit: Is there a problem on master? It looks like the result from libqrencode.pc is ignored, but if that is not causing actual problems, maybe pkg_check_modules could be dropped from FindQRencode.cmake? Also, what platforms actually provide the qrencoded library in the Debug configuration?

  9. hebasto commented at 4:34 PM on June 25, 2025: member

    @purpleKarrot

    Thank you for the review!

    Nit: Is there a problem on master?

    In terms of build failure -- no. In terms of needlessly including overly broad paths like /usr/local/include or /opt/homebrew/include on macOS -- yes.

    It looks like the result from libqrencode.pc is ignored...

    It depends on the platform used for building. On macOS, that's the case on the master branch, but not with this PR.

    ... if that is not causing actual problems, maybe pkg_check_modules could be dropped from FindQRencode.cmake?

    I believe that for packages providing *.pc files, this is the most reliable and widely accepted approach for the find module.

    Also, what platforms actually provide the qrencoded library in the Debug configuration?

    vcpkg does.

  10. fanquake commented at 11:09 AM on June 26, 2025: member

    ACK ead44687483e9c936ba970de890c01d5e7ad3485

  11. fanquake merged this on Jun 26, 2025
  12. fanquake closed this on Jun 26, 2025

  13. hebasto deleted the branch on Jun 26, 2025
  14. fanquake referenced this in commit a990c1002b on Jun 26, 2025
  15. fanquake removed the label Needs backport (29.x) on Jun 26, 2025
  16. fanquake commented at 11:13 AM on June 26, 2025: member

    Backported to 29.x in #32810.

  17. fanquake referenced this in commit 67ea4b9994 on Jun 26, 2025
  18. fanquake referenced this in commit d360a6ef56 on Jul 3, 2025
  19. luke-jr referenced this in commit 6777c6057f on Jul 17, 2025
  20. stringintech referenced this in commit f19e7819e9 on Jul 19, 2025
  21. alexanderwiederin referenced this in commit 9997c3d993 on Jul 25, 2025
  22. alexanderwiederin referenced this in commit 8d6ebb9c4e on Jul 28, 2025
  23. alexanderwiederin referenced this in commit 533a4585b5 on Jul 28, 2025
  24. yuvicc referenced this in commit 22f55cf11d on Aug 26, 2025
  25. bug-castercv502 referenced this in commit d4bd8a1259 on Sep 28, 2025
  26. stickies-v referenced this in commit a19c56cd7c on Nov 4, 2025
  27. morozow referenced this in commit 62ef58e311 on May 8, 2026
  28. morozow referenced this in commit 458fcf63d5 on May 8, 2026
  29. Kino1994 referenced this in commit cffdf3702b on Jun 28, 2026
  30. BigcoinBGC referenced this in commit 44b5e40158 on Jun 30, 2026
  31. bitcoin locked this on Jul 30, 2026

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-08-21 06:51 UTC

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