-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Berkeley DB v6 compatibility fix #8626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixes building error looking like this: CXX wallet/libbitcoin_wallet_a-db.o wallet/db.cpp: In member function ‘void CDBEnv::EnvShutdown()’: wallet/db.cpp:46:16: error: call of overloaded ‘DbEnv(int)’ is ambiguous DbEnv(0).remove(strPath.c_str(), 0); ^ wallet/db.cpp:46:16: note: candidates are: In file included from wallet/db.h:21:0, from wallet/db.cpp:6: /usr/include/db_cxx.h:916:2: note: DbEnv::DbEnv(const DbEnv&) DbEnv(const DbEnv &); ^ /usr/include/db_cxx.h:518:2: note: DbEnv::DbEnv(DB_ENV) DbEnv(DB_ENV *dbenv); ^ /usr/include/db_cxx.h:516:2: note: DbEnv::DbEnv(u_int32_t) DbEnv(u_int32_t flags); ^ Makefile:5780: recipe for target 'wallet/libbitcoin_wallet_a-db.o' failed make[2]: ** [wallet/libbitcoin_wallet_a-db.o] Error 1
|
I've originally found it for namecoin - all the detalis there namecoin/namecoin-core#101 |
|
I think this change makes sense. |
|
It might actually be a good idea to fail to build against BDB 6... it changed the license to AGPL, and so users will by default be infringing if they just use Bitcoin Core as-is this way (as AGPL requires providing source code to every peer). That said, I don't really care strongly either way. Perhaps a clear warning somewhere would be better. |
|
@luke-jr and the code is open to every peer, actually - the peer is running an open-source Bitcoin core. What exact do you mean by infringing the license? I see no license is broken here http://www.oracle.com/technetwork/database/berkeleydb/downloads/oslicense-093458.html |
|
@netsafe It's not enough that someone else is sharing the code; the person running the software would need to do so, or at least provide notice to each peer how to get it. Right now, Bitcoin Core doesn't do even the notice. That being said, skimming over the AGPL again it seems this requirement exists only for modified versions, so it's probably less of an issue than it seems at face value. But IANAL and it seems like not the best idea to have the license transparently change like this. In any case, I still don't really care strongly either way. :) |
|
@luke-jr I'm not caring that deep too. As far as I understood this situation, AGPL will fire the way we're speaking only if it's a client-server architecture. But in a P2P case - which is a case for Bitcoin - all peers not just should have the same source code, but they're explicitly obliged to : or the network will fall apart because it's nodes won't be able to work together in the same way. |
|
P2P is just "everyone is a client and server to each other". It's stronger with AGPL, not weaker. There is absolutely no requirement for all nodes to be running the same source code, only that they be using the same consensus logic, which is a subset of the full program (and doesn't touch the BDB-related code at all). |
Let's not get involved in copyfights here but focus on the technical side - apparently someone wants to fix building with BDB 6, and if the code changes are acceptable (and don't regress BDB 4/5 support), let's just accept that. |
|
@laanwj It does not breaks 4/5 BDB support - test build confirms it too Official docs http://docs.oracle.com/cd/E17076_02/html/api_reference/CXX/BDB-CXX_APIReference.pdf page 226 :
|
| LogPrintf("CDBEnv::EnvShutdown: Error %d shutting down database environment: %s\n", ret, DbEnv::strerror(ret)); | ||
| if (!fMockDb) | ||
| DbEnv(0).remove(strPath.c_str(), 0); | ||
| DbEnv((u_int32_t)0).remove(strPath.c_str(), 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would the c++11 keyword nullptr work here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it must be zero and explicitly of type u_int32_t : "The flags parameter must be set to 0." in the docs it's stated strictly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right! I was misreading, you're not casting 0 to a pointer.
|
ACK 323a5fe |
|
the configuration string that I'm using for Berkeley DB is - in
versions 6.2.23, 5.3.28 and 4.8.30 are producing db_cxx.h that contains the same definition |
|
utACK 323a5fe |
|
utACK 323a5fe |
323a5fe Berkeley DB v6 compatibility fix (Alexey Vesnin)
Fixes building error looking like this: CXX wallet/libbitcoin_wallet_a-db.o wallet/db.cpp: In member function ‘void CDBEnv::EnvShutdown()’: wallet/db.cpp:46:16: error: call of overloaded ‘DbEnv(int)’ is ambiguous DbEnv(0).remove(strPath.c_str(), 0); ^ wallet/db.cpp:46:16: note: candidates are: In file included from wallet/db.h:21:0, from wallet/db.cpp:6: /usr/include/db_cxx.h:916:2: note: DbEnv::DbEnv(const DbEnv&) DbEnv(const DbEnv &); ^ /usr/include/db_cxx.h:518:2: note: DbEnv::DbEnv(DB_ENV) DbEnv(DB_ENV *dbenv); ^ /usr/include/db_cxx.h:516:2: note: DbEnv::DbEnv(u_int32_t) DbEnv(u_int32_t flags); ^ Makefile:5780: recipe for target 'wallet/libbitcoin_wallet_a-db.o' failed make[2]: ** [wallet/libbitcoin_wallet_a-db.o] Error 1 Github-Pull: bitcoin#8626 Rebased-From: 323a5fe
323a5fe Berkeley DB v6 compatibility fix (Alexey Vesnin)
323a5fe Berkeley DB v6 compatibility fix (Alexey Vesnin)
323a5fe Berkeley DB v6 compatibility fix (Alexey Vesnin)
7105e7a Berkeley DB v6 compatibility fix (Alexey Vesnin) Pull request description: Fixes linking problem as seen on GA CMake-macOS [here](https://github.com/PIVX-Project/PIVX/runs/2032160204). From bitcoin#8626 ACKs for top commit: furszy: utACK 7105e7a Fuzzbawls: utACK 7105e7a Tree-SHA512: d14fe2e24a69a7511fe93526bf7c1a56bbe8cd2e60d95dd29aed8a0e13e92a52270cf44ee38c3a5319177f5f8f55adae4b30bb6a1fb288e7c3d867d467af8d5b
Fixes building error looking like this:
CXX wallet/libbitcoin_wallet_a-db.o
wallet/db.cpp: In member function ‘void CDBEnv::EnvShutdown()’:
wallet/db.cpp:46:16: error: call of overloaded ‘DbEnv(int)’ is ambiguous
DbEnv(0).remove(strPath.c_str(), 0);
^
wallet/db.cpp:46:16: note: candidates are:
In file included from wallet/db.h:21:0,
from wallet/db.cpp:6:
/usr/include/db_cxx.h:916:2: note: DbEnv::DbEnv(const DbEnv&)
DbEnv(const DbEnv &);
^
/usr/include/db_cxx.h:518:2: note: DbEnv::DbEnv(DB_ENV)
DbEnv(DB_ENV dbenv);
^
/usr/include/db_cxx.h:516:2: note: DbEnv::DbEnv(u_int32_t)
DbEnv(u_int32_t flags);
^
Makefile:5780: recipe for target 'wallet/libbitcoin_wallet_a-db.o' failed
make[2]: * [wallet/libbitcoin_wallet_a-db.o] Error 1