-
Notifications
You must be signed in to change notification settings - Fork 37.8k
build: Drop bitcoin-tx and bitcoin-wallet dependencies on libevent #18504
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
Don't include util/url.cpp to libbitcoin_util.a when libevent isn't available. This fixes a compile error trying to build bitcoin-tx without libevent reported by Luke Dashjr in bitcoin#18465 Fixes bitcoin#18465
Don't require urlDecode function in wallet code since urlDecode implementation currently uses libevent. Just call urlDecode indirectly though URL_DECODE function pointer constant if available. In bitcoind and bitcoin-qt, URL_DECODE is implemented and used to interpret RPC wallet requests. In bitcoin-wallet, URL_DECODE is null to avoid depending on libevent.
ddfe373
to
01a3392
Compare
Updated ddfe373 -> 01a3392 ( |
Gitian builds
|
utACK 01a3392. |
cc @luke-jr |
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.
Kind of ugly, but utACK
Nit: URL_DECODE
should probably be named g_url_decode_fn
or something...
Constant naming is used because it is a constant, not a global variable |
|
But it's not really a constant - its value varies between builds. |
The docs say "compile time constants", not "build time constants" |
Anyway, I was mostly joking about that style nit. Let's not hold back this pull based on naming guidelines. |
It's definitely not a compile time constant! ;) |
FWIW, following this up in #18568 |
Concept ACK, but wouldn't it be easier to implement It has always seemed weird to me that we depend on third-party code for such a trivial function :) |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
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. |
@@ -77,9 +77,9 @@ bool HaveKey(const SigningProvider& wallet, const CKey& key) | |||
|
|||
bool GetWalletNameFromJSONRPCRequest(const JSONRPCRequest& request, std::string& wallet_name) | |||
{ | |||
if (request.URI.substr(0, WALLET_ENDPOINT_BASE.size()) == WALLET_ENDPOINT_BASE) { | |||
if (URL_DECODE && request.URI.substr(0, WALLET_ENDPOINT_BASE.size()) == WALLET_ENDPOINT_BASE) { |
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.
Shouldn't this be #ifdef URL_DECODE, ie: on bitcoin-tx the symbol does not exist if libevent is not used.
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.
The symbol URL_DECODE
is always defined
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.
my bad, thx
…encies on libevent 01a3392 Drop bitcoin-wallet dependency on libevent (Russell Yanofsky) 0660119 Drop unintended bitcoin-tx dependency on libevent (Russell Yanofsky) Pull request description: This fixes compile errors trying to build bitcoin-tx and bitcoin-wallet without libevent, which were reported by Luke Dashjr in bitcoin#18465 The fix avoiding `bitcoin-tx` dependency on libevent just adds a conditional build rule. This is implemented in the first commit (more details in commit description). The fix avoiding `bitcoin-wallet` dependency on libevent requires minor code changes, because `bitcoin-wallet` (unlike `bitcoin-tx`) links against code that calls `urlDecode` / `evhttp_uridecode`. This fix is implemented in the second commit (again details in the commit description). ACKs for top commit: jonasschnelli: utACK 01a3392. Tree-SHA512: d2245e912ab494cccceeb427a1eca8e55b01a0006ff93eebcfb5461ae7cecd1083ac2de443d9db036b18bdc6f0fb615546caaa20c585046f66d234937f74870a
Bitcoin Core PR: bitcoin/bitcoin#18504 Pull request description: This fixes compile errors trying to build bitcoin-tx and bitcoin-wallet without libevent, which were reported by Luke Dashjr in bitcoin/bitcoin#18465 The fix avoiding `bitcoin-tx` dependency on libevent just adds a conditional build rule. This is implemented in the first commit (more details in commit description). The fix avoiding `bitcoin-wallet` dependency on libevent requires minor code changes, because `bitcoin-wallet` (unlike `bitcoin-tx`) links against code that calls `urlDecode` / `evhttp_uridecode`. This fix is implemented in the second commit (again details in the commit description).
This fixes compile errors trying to build bitcoin-tx and bitcoin-wallet without libevent, which were reported by Luke Dashjr in #18465
The fix avoiding
bitcoin-tx
dependency on libevent just adds a conditional build rule. This is implemented in the first commit (more details in commit description).The fix avoiding
bitcoin-wallet
dependency on libevent requires minor code changes, becausebitcoin-wallet
(unlikebitcoin-tx
) links against code that callsurlDecode
/evhttp_uridecode
. This fix is implemented in the second commit (again details in the commit description).