-
Notifications
You must be signed in to change notification settings - Fork 37.7k
refactor: Split ArgsManager out of util/system #24455
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
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!
In fact I did almost the exact same thing here 😆: dongcarl@81d1857
Happy to use your changes though if you're planning on proactively rebasing over master when merge conflicts arise!
One thing: the only difference I can spot between your changes and mine is that you didn't move BITCOIN_CONF_FILENAME
and BITCOIN_SETTINGS_FILENAME
out of util/system.h
, I think doing that makes the split even better? Lmk!
This is pretty reasonable. I know we don't generally like to move code around, but this move was probably inevitable. One suggestion would be to rename "util/args_manager" to "util/args". I think "_manager" suffix does not contribute or clarify much, and will make it awkward to add other argument-handling functions and classes to the same file without attaching them to the ArgsManager class. ArgsManager class is already monolithic and it should be possible to break up or extend without putting everything inside. Related to this, I don't necessarily see a need to put the |
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. |
da3a3e7
to
6c653cc
Compare
f12603b
to
a1b266d
Compare
These were introduced in bitcoin#22950, but they're not used in the header, rather equivalent includes in addrman.cpp do the work.
This file is not required for the dbwrapper interfaces provided, but several other files were getting their necessary includes indirectly via this header. Removing results in more minimal includes throughout.
This is the more minimal include, and the only used therein.
f3a7954
to
9f8fe54
Compare
To eliminate circular chainparamsbase dependencies.
9f8fe54
to
bfcbe09
Compare
See #24811 for the setup commits of this PR. |
This PR impacting the need for |
🐙 This pull request conflicts with the target branch and needs rebase. Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft". |
@Empact I'm wondering if you'd be open to splitting off the last two commits off to their own PR (or just this PR) not based on #24811? I think "removing references to gArgs and header tree cleanup" (which is what #24811 is doing) probably stands on its own merit and can be done either before or after the "split util/args and util/system" work here. Selfishly, I also want to get the last 2 commits reviewed and merged ASAP since it'll soon become a blocker for |
Closing in favor of my next attempt: #25152 |
By splitting
ArgsManager
and related functions out of the grab-bagutil/system
file, this enables more specific includes,referencing, and eliminate a circular dependency betweenArgsManager
without pulling ingArgs
chainparamsbase
andutils/system
.The proposed new modules are:
gArgs
Other notable points:
ArgsManager::ReadConfigFiles
callsClearPathCache
andCheckDataDirOption
ongArgs
rather than the currentArgsManager
instance in the status quo.The new files are nearly unchanged from their sources, so
git diff master --color-moved=dimmed-zebra
could be helpful.