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
kernel: move RunCommandParseJSON to its own file #26196
Conversation
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.
Concept ACK
@fanquake mentioned to me today that he has this done already in a local branch, so I'll leave that to him to PR it at some point. |
Concept ACK
See #26198.
I have a larger Boost reduction branch, that builds on your signals2 implementation, that might a starting point for this. |
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. |
Concept ACK. |
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.
ACK fffbae5 - looks good. Could fixup the header comments if that's wanted. I'm optimistic that Boost Process will "go away" at some point. Removing it from the kernel is an improvement for now.
fffbae5
to
98a8ad8
Compare
Force-pushed the requested copyright comment fixup, no other changes. |
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.
re-ACK 98a8ad8
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.
ACK 98a8ad8
ACK 98a8ad8. This certainly sounds like something that doesn't need to be in the kernel. Given the name of the new file it would make sense to move |
I'd rather not, as we're really trying to separate out the nasty boost dependency here as opposed to the process launching functionality. If anything, I think it'd make more sense to just rename the function/file to be more specific as a follow-up. |
Because libbitcoinkernel does not include this new object, this has the side-effect of eliminating the unnecessary boost::process dependency.
98a8ad8
to
192325a
Compare
Rearranged the headers as suggested by @hebasto. Would prefer to leave any other fixups to follow-up PRs. |
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.
re-ACK 192325a - failing Windows CI can be ignored. Unrelated to this change.
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.
re-ACK 192325a
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.
Code review ACK 192325a, but I think you should consider moving the new file to libbitcoin_common.a
instead of libbitcoin_util_a
and src/common/
instead of src/util/
.
Previously the difference between util and common was more nebulous, but now after talking to Carl and writing https://github.com/bitcoin/bitcoin/blob/master/doc/design/libraries.md, it seems like util can be the library for things included in the kernel which the kernel can depend on, and common can be the library for other code that needs to be shared internally, but should not be part of the kernel or shared externally.
3743428
to
824e3c3
Compare
I know I said above that I was going to leave this PR as-is, but this makes a lot of sense to me and it may as well be moved to a proper home from the start. So I've added a second commit to move this out of util and into common. Thanks @ryanofsky for the suggestion! I do agree with @Sjors that maybe the file/function should be renamed and maybe some other functionality should be moved in, but I'd still prefer to discuss that in a follow-up PR as the primary goal here is getting a boost dep out of the kernel. |
I believe c-i blew up here because Edit: sigh, this is going to crash and burn because of |
Quoting ryanofsky: "util can be the library for things included in the kernel which the kernel can depend on, and common can be the library for other code that needs to be shared internally, but should not be part of the kernel or shared externally."
c59e057
to
43b8777
Compare
Mmm, that test-run really should have failed, but the compile failure is hidden because our boost header path is always implicitly included. Another instance of this: #26086 (comment) I have now begrudgingly made I suspect that @ryanofsky will be ok with this but @fanquake will consider it a regression. I'll let you two fight it out :). I'm fine with either:
Edit: to be clear, util needs boost for |
That's interesting. I would say |
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.
Code review ACK 43b8777. Could consider squashing the two commits, so the code just moves once instead of twice.
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.
ACK 43b8777
but the compile failure is hidden because our boost header path is always implicitly included. Another instance of this: #26086 (comment)
We'll follow up here (suggested change) very shortly.
I suspect that ryanofsky will be ok with this but fanquake will consider it a regression. I'll let you two fight it out :)
Happy to just move this forward. Things are going in the right direction.
or it could be done as a followup to fully drop the boost dependency from util.
I am happy to follow up with this.
#include <config/bitcoin-config.h> | ||
#endif | ||
|
||
#include <common/run_command.h> |
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.
pico-nit: Shouldn't this be in the very first line after the comment?
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.
I'll look at the follow up for moving more code, and could address as part of that.
This is now #26293.
After a second look, the remaining change in that branch is (as self-described) a hack, and I somehow forgot I'd already removed BOOST_CPPFLAGS from the BITCOIN_INCLUDES, so less to actually follow up on here. |
Because libbitcoinkernel does not include this new object, this has the side-effect of eliminating its unnecessary
boost::process
dependency.This leaves libbitcoinkernel with 3 remaining boost dependencies:
boost::date_time
forutil/time.cpp
, which I'll separate out next. Exactly like this PR.boost::signals2
for which I have a POC re-implementation here: https://github.com/theuni/bitcoin/commits/replace-boost-signalsboost::multi_index
which I'm not sure about yet.