Repository navigation
wallet: don't include bdb files from our headers - #28039
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
fe5b4b6 to
2d09d0f
Compare
|
ACK 2d09d0f50408f9c522b9efa4f386072502c7b3d1 Changes are primarily moves and appear otherwise obviously correct. |
…ders bea9fc2 wallet: sqlite: force sqlite3.h to be included by the cpp files (Cory Fields) Pull request description: Only `#include` upstream sqlite headers from our cpp files. Like #28039 but simpler :) ACKs for top commit: achow101: ACK bea9fc2 TheCharlatan: Nice, ACK bea9fc2 kristapsk: utACK bea9fc2 hebasto: ACK bea9fc2, I have reviewed the code and it looks OK. Tree-SHA512: cb83ac51eed7e0740f1c75ee87c7849fa7e535bc4836c499290041eb995ccfd82533e3babfe83a164257b62b180f206112d6a1bae7ea290ad0ec7f55d62432da
hebasto
left a comment
There was a problem hiding this comment.
Approach ACK 2d09d0f50408f9c522b9efa4f386072502c7b3d1.
Suggesting to adjust our IWYU mapping file:
--- a/contrib/devtools/iwyu/bitcoin.core.imp
+++ b/contrib/devtools/iwyu/bitcoin.core.imp
@@ -4,4 +4,7 @@
{ include: [ "<bits/termios-struct.h>", private, "<termios.h>", public ] },
{ include: [ "<bits/termios-tcflow.h>", private, "<termios.h>", public ] },
{ include: [ "<bits/chrono.h>", private, "<chrono>", public ] },
+
+ # Berkeley DB
+ { include: [ "<db.h>", private, "<db_cxx.h>", public ] },
]or #include <db.h> explicitly along with #include <db_cxx.h>.
No functional change, just simplifies the code move in the next commit.
Dbt requires including bdb headers.
Else some compilers/stdlibs may not be able to construct std::unique_ptr<Db> without Db defined.
This way the dependency can't sneak into other files without being noticed. Forward-declare bdb classes as necessary.
2d09d0f to
8b5397c
Compare
|
@hebasto I'm ~0 on doing either/none of those changes. Happy to make a change if you or @achow101 or @MarcoFalke have a strong preference, otherwise I'll leave it as-is. |
|
reACK 8b5397c No preference to make those changes. |
Only
#includeupstream bdb headers from our cpp files.It's generally good practice to avoid including 3rd party deps in headers as otherwise they tend to sneak into new compilation units. IMO this makes for a nice cleanup.
There's a good bit of code movement here, but each commit is small and should be obviously correct.
Note: in the future, the buildsystem can add the bdb include path for
bdb.cppandsalvage.cpponly, rather than all wallet sources.