build: Avoid secp256k1.h include from system #20469

pull dergoegge wants to merge 1 commits into bitcoin:master from dergoegge:fixincludeorder changing 1 files +1 −2
  1. dergoegge commented at 11:18 PM on November 23, 2020: member

    While building i ran into an error because i had a version of secp256k1.h under /usr/local/include that was incompatible with the secp256k1 code in the repository. This caused a problem because $(BOOST_CPPFLAGS) contained -I/usr/local/include and the include paths are searched by the compiler in order from left to right, so in the end $(BITCOIN_INCLUDES) contained -I/usr/local/include before -I$(srcdir)/secp256k1/include which caused the compiler to find secp256k1.h under /usr/local/include.

    Looking at git blame i am wondering how this has not happened to anyone else in several years: https://github.com/bitcoin/bitcoin/blame/cb89e18845852c005ba8ab94acc6544d7c876a42/src/Makefile.am#L25

    I am on macOS 10.15.

  2. build: Avoid secp256k1.h include from system e95aaefe25
  3. fanquake added the label Build system on Nov 23, 2020
  4. sipa commented at 11:26 PM on November 23, 2020: member

    This seems similar to #20351, but I think this is a cleaner solution than the (abandoned) fix from #20366.

  5. DrahtBot commented at 8:47 AM on November 24, 2020: member

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #18261 (Erlay: bandwidth-efficient transaction relay protocol by naumenkogs)

    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.

  6. laanwj commented at 9:10 AM on November 24, 2020: member

    Nice minimal fix. Putting local include paths first, before those of dependencies makes a lot of sense.

    Code review ACK e95aaefe2540cb76969818fcc2ff77d33448ed5a

    Looking at git blame i am wondering how this has not happened to anyone else in several years:

    Yes, I wonder too. But FWIW most people don't like to install dependencies system-wide manually, and there haven't been secp256k1 packages for most distributions. But it's definitely something that could trip up.

  7. hebasto approved
  8. hebasto commented at 8:20 AM on November 25, 2020: member

    ACK e95aaefe2540cb76969818fcc2ff77d33448ed5a, tested on macOS 11 Big Sur by adding #error into /usr/local/include/secp256k1.h.

  9. laanwj added the label Needs backport (0.21) on Nov 25, 2020
  10. laanwj merged this on Nov 25, 2020
  11. laanwj closed this on Nov 25, 2020

  12. dergoegge referenced this in commit 01b647b1a2 on Nov 26, 2020
  13. MarcoFalke removed the label Needs backport (0.21) on Dec 1, 2020
  14. fanquake referenced this in commit 68bd88597a on Dec 2, 2020
  15. fanquake commented at 2:58 AM on December 2, 2020: member

    Backported in #20505.

  16. kristapsk referenced this in commit d1918d2661 on Jan 31, 2021
  17. DrahtBot locked this on Feb 15, 2022

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-17 09:14 UTC

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