Repository navigation
build: Drop bitcoin-tx and bitcoin-wallet dependencies on libevent - #18504
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
|
|
cc @luke-jr |
luke-jr
left a comment
There was a problem hiding this comment.
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. |
| 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.
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.
The symbol URL_DECODE is always defined
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-txdependency on libevent just adds a conditional build rule. This is implemented in the first commit (more details in commit description).The fix avoiding
bitcoin-walletdependency 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).