refactor: Make all #includes relative to project root (laanwj, MeshCollider, ryanofsky) #11651

pull meshcollider wants to merge 8 commits into bitcoin:master from meshcollider:201711_absolute_includes changing 370 files +2071 −2064
  1. meshcollider commented at 1:51 AM on November 10, 2017: contributor

    Rebase of #11053

    Previously started by @laanwj, ACK'ed by promag, ryanofsky, jonasschnelli, and concept-ACK'ed by practicalswift and jnewbery. Thus should be almost RTM :)

  2. meshcollider commented at 1:55 AM on November 10, 2017: contributor

    @ryanofsky you might want to check this over :)

  3. fanquake added the label Build system on Nov 10, 2017
  4. fanquake cross-referenced this on Nov 10, 2017 from issue refactor: Make all #includes relative to project root by laanwj
  5. ryanofsky commented at 6:29 AM on November 10, 2017: contributor

    utACK 5d0eae757e30605ec3d26bc515856b1d20a13cc2

  6. laanwj commented at 6:53 AM on November 10, 2017: member

    So we're doing this? Okay! utACK 5d0eae7

  7. sipa commented at 7:22 AM on November 10, 2017: member

    Pieter was here.

  8. practicalswift commented at 9:23 AM on November 10, 2017: contributor

    utACK 5d0eae757e30605ec3d26bc515856b1d20a13cc2

    Nice!

  9. MarcoFalke renamed this:
    refactor: Make all #includes relative to project root (rebased)
    refactor: Make all #includes relative to project root (laanwj, MeshCollider, ryanofsky)
    on Nov 10, 2017
  10. jnewbery commented at 5:41 PM on November 10, 2017: member

    Thanks for taking and rebasing this. Big concept ACK. Will review later.

  11. laanwj commented at 3:28 PM on November 15, 2017: member

    Needs rebase, after that please let me know and we should just merge it, has had lots of review and is a pain to keep up to date.

  12. in doc/developer-notes.md:465 in 5d0eae757e outdated
     460 | @@ -461,6 +461,14 @@ namespace {
     461 |  
     462 |    - *Rationale*: Avoids confusion about the namespace context
     463 |  
     464 | +- Prefer `#include <primitives/transaction.h>` bracket syntax instead of
     465 | +  `#include "primitives/transactions.h" quote syntax when possible.
    


    promag commented at 3:38 PM on November 15, 2017:

    Missing `.


    promag commented at 3:40 PM on November 15, 2017:

    BTW, unrelated but the Rationale above doesn't render well. And some are missing a period.

  13. promag commented at 3:39 PM on November 15, 2017: member

    rere-utACK.

  14. scripted-diff: Replace #include "" with #include <> (ryanofsky)
    -BEGIN VERIFY SCRIPT-
    for f in \
      src/*.cpp \
      src/*.h \
      src/bench/*.cpp \
      src/bench/*.h \
      src/compat/*.cpp \
      src/compat/*.h \
      src/consensus/*.cpp \
      src/consensus/*.h \
      src/crypto/*.cpp \
      src/crypto/*.h \
      src/crypto/ctaes/*.h \
      src/policy/*.cpp \
      src/policy/*.h \
      src/primitives/*.cpp \
      src/primitives/*.h \
      src/qt/*.cpp \
      src/qt/*.h \
      src/qt/test/*.cpp \
      src/qt/test/*.h \
      src/rpc/*.cpp \
      src/rpc/*.h \
      src/script/*.cpp \
      src/script/*.h \
      src/support/*.cpp \
      src/support/*.h \
      src/support/allocators/*.h \
      src/test/*.cpp \
      src/test/*.h \
      src/wallet/*.cpp \
      src/wallet/*.h \
      src/wallet/test/*.cpp \
      src/wallet/test/*.h \
      src/zmq/*.cpp \
      src/zmq/*.h
    do
      base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f
    done
    -END VERIFY SCRIPT-
    1a445343f6
  15. qt: refactor: Use absolute include paths in .ui files 5b56ec969f
  16. build: Remove -I for everything but project root
    Remove -I from build system for everything but the project root,
    and built-in dependencies.
    0c715214dd
  17. qt: refactor: Changes to make include paths absolute
    This makes all include paths in the GUI absolute.
    
    Many changes are involved as every single source file in
    src/qt/ assumes to be able to use relative includes.
    e7b31631c7
  18. test: refactor: Use absolute include paths for test data files 138016bf92
  19. refactor: Include obj/build.h instead of build.h 96b92810a6
  20. Recommend #include<> syntax in developer notes 434f5a2506
  21. Remove trailing whitespace causing travis failure 7b91b5f8a4
  22. meshcollider commented at 7:24 PM on November 15, 2017: contributor

    Rebased and added missing tick pointed out by @promag, will just wait for travis to verify the scripted-diff again

  23. jnewbery commented at 9:22 PM on November 15, 2017: member

    Tested ACK 7b91b5f8a4417da1940956c1ab32dba94dc104e1.

    I noticed that there were a few .rc and .mm files still using the "" style includes. Should those also be changed to <> style? I think the change would be like this: https://github.com/jnewbery/bitcoin/commit/1a506c7ebf91747f40c9e408f8947e5491101422 but I don't have windows or mac machines to test the build on.

  24. theuni commented at 9:26 PM on November 15, 2017: member

    indifferent utACK 7b91b5f8a4417da1940956c1ab32dba94dc104e1.

  25. laanwj merged this on Nov 16, 2017
  26. laanwj closed this on Nov 16, 2017

  27. laanwj referenced this in commit 3c098a8aa0 on Nov 16, 2017
  28. meshcollider deleted the branch on Nov 16, 2017
  29. laanwj commented at 11:49 AM on November 16, 2017: member

    I noticed that there were a few .rc and .mm files still using the "" style includes.

    If they are correctly relative (so to include from the directory the including file is in, or even a directory relative to its directory) it's fine to keep them. "" style includes are a problem when they're used when <> is meant, which was common in this project before this change.

  30. meshcollider cross-referenced this on Nov 19, 2017 from issue Cleanups + nit fixes for walletdir PR by meshcollider
  31. MarcoFalke referenced this in commit 604e08c83c on Dec 20, 2017
  32. mxaddict cross-referenced this on May 30, 2019 from issue #include <> vs #include "" for headers by mxaddict
  33. PastaPastaPasta referenced this in commit 2a1222eb7c on Feb 13, 2020
  34. PastaPastaPasta referenced this in commit 1bc14bb293 on Feb 13, 2020
  35. PastaPastaPasta referenced this in commit e49f06cce6 on Feb 13, 2020
  36. PastaPastaPasta referenced this in commit 1b507c42c1 on Feb 13, 2020
  37. PastaPastaPasta referenced this in commit 7ddfb73623 on Feb 29, 2020
  38. PastaPastaPasta referenced this in commit 5bee9b326a on Feb 29, 2020
  39. UdjinM6 referenced this in commit 588f34c1ff on Feb 29, 2020
  40. PastaPastaPasta referenced this in commit be7bf2e9d8 on Mar 4, 2020
  41. PastaPastaPasta referenced this in commit 4e172c89f4 on Mar 5, 2020
  42. PastaPastaPasta referenced this in commit dd98106cab on Mar 5, 2020
  43. PastaPastaPasta referenced this in commit ebca1edc3c on Mar 5, 2020
  44. PastaPastaPasta referenced this in commit b32e6aa365 on Mar 11, 2020
  45. PastaPastaPasta referenced this in commit 2877a1271d on Mar 13, 2020
  46. PastaPastaPasta referenced this in commit 72c3cede7b on Mar 14, 2020
  47. PastaPastaPasta referenced this in commit e2465497a7 on Mar 15, 2020
  48. PastaPastaPasta referenced this in commit 2bceb6d735 on Mar 15, 2020
  49. UdjinM6 referenced this in commit 8a1ec935a0 on Mar 19, 2020
  50. ckti referenced this in commit 00d5d478ae on Mar 28, 2021
  51. ckti referenced this in commit 4d14c8e786 on Mar 28, 2021
  52. gades referenced this in commit 3b8742fe1f on Jun 26, 2021
  53. gades referenced this in commit fd48b7614e on Jun 30, 2021
  54. bitcoin locked this on Sep 8, 2021

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-05-20 06:55 UTC