build: Quiet warnings in symlinked headers installed from homebrew #26070

pull theuni wants to merge 1 commits into bitcoin:master from theuni:fix-brew-usrlocal changing 1 files +10 −0
  1. theuni commented at 7:07 pm on September 12, 2022: member

    From the included comment:

    Homebrew may create symlinks in /usr/local/include for some packages. Because MacOS’s clang internally adds -I /usr/local/include to its search paths, this will negate efforts to use -isystem for those packages, as they will be found first in /usr/local. Use the internal -internal-isystem option to system-ify all /usr/local/include paths without adding it to the list of search paths in case it’s not already there.

    This fixes the issue explained here: #26056 (comment)

    ~Also temporarily includes #26056 as a test. I will remove that commit if/when c-i is happy, and fanquake can rebase it post-merge.~ I’ve removed this commit now that c-i succeeded with it.

  2. build: quiet warnings in system headers installed from homebrew b50a4b7647
  3. theuni commented at 8:43 pm on September 12, 2022: member
    c-i was happy with this so I’m going to drop the test-commit.
  4. theuni force-pushed on Sep 12, 2022
  5. MarcoFalke renamed this:
    Quiet warnings in symlinked headers installed from homebrew
    build: Quiet warnings in symlinked headers installed from homebrew
    on Sep 13, 2022
  6. DrahtBot added the label Build system on Sep 13, 2022
  7. fanquake commented at 9:09 am on September 13, 2022: member
    Concept ACK - picked into #26056.
  8. hebasto commented at 11:01 am on September 13, 2022: member
    Concept ACK.
  9. in configure.ac:749 in b50a4b7647
    745@@ -746,6 +746,16 @@ case $host in
    746          dnl It's safe to add these paths even if the functionality is disabled by
    747          dnl the user (--without-wallet or --without-gui for example).
    748 
    749+         dnl Homebrew may create symlinks in /usr/local/include for some packages.
    


    hebasto commented at 12:25 pm on September 13, 2022:

    The /usr/local path is relevant for macOS Intel systems only. macOS M1 uses the /opt/homebrew one.

    Actually, the latter systems do not require this fix. But a comment update seems enough.


    theuni commented at 3:17 pm on September 13, 2022:

    I believe this would almost be safe enough to do everywhere (not just mac/homebrew), and possibly even for /usr/include because it should have no unintended side-effects, and for gcc it will just fail the test.

    I’m not suggesting that we do that, just pointing out that it should be pretty much harmless even if it’s not needed.


    fanquake commented at 4:13 pm on September 13, 2022:
    I think the wording here is ok; we don’t need to call out differences in defaults between x86_64 and arm64 installations of homebrew. Also, just because /opt/homebrew is the preferred prefix for arm64, it’s not clear to me that a brew installation couldn’t be in /usr/local on arm64, which this would also accomodate.
  10. hebasto approved
  11. hebasto commented at 12:27 pm on September 13, 2022: member

    ACK b50a4b7647c63f2557409308389ef09a67aef5ce, tested as a part of bitcoin/bitcoin#26056 on macOS Monterey 12.6 (21G115, both Intel and Apple M1) + Apple clang 14.0.0:

    0% ./configure --enable-suppress-external-warnings
    1...
    2checking for brew... brew
    3checking whether C++ preprocessor accepts -Xclang -internal-isystem/usr/local/include... yes
    4...
    
  12. fanquake merged this on Sep 13, 2022
  13. fanquake closed this on Sep 13, 2022

  14. sidhujag referenced this in commit ec769c1e22 on Sep 13, 2022
  15. bitcoin locked this on Sep 15, 2023

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: 2024-09-29 04:12 UTC

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