Open thejohnfreeman opened 1 year ago
Moving this discussion elsewhere. Leaving the issue open just to indicate it is an open problem.
Some things I've run into while working on the script:
.cpp
) in basics
, json
, crypto
, and protocol
are linked in libxrpl
. One exception is a selection of files in basics/impl
that are linked into rippled
instead. In my testing, they can be moved to libxrpl
with no changes, and I think they should.beast
headers are installed, but there are 30 exceptions across beast/asio
, beast/container
, beast/core
, beast/test
, and beast/utility
. I think they should all be installed.json/README.md
json/TODO.md
: probably obsolete in the face of Boost.Json migration, and should be in issues anywayjson/impl/LICENSE
: should be moved to the top-level LICENSE
file if not removedjson/impl/version
: almost certainly out-of-date, and not used anywherebasics/PerfLog.h
) that is installed as part of libxrpl
but cannot be imported because it includes headers not installed as part of rippled
. I think it should not be installed.
There are several changes I'd like to see made to our physical source layout:
src/
toexternal/
. Cleanly separate first-party code from third-party. Make it clear that first-party code is under active development in this project.cmake/
. Follow convention.[^3]include/{name}
.name
can beripple
to start, to minimize impact on#include
directives[^1]. Put sources and private headers undersrc/rippled
[^2]. The separation will help consumers easily browse just the installed definitions.libxrpl
fromrippled
. Move sources and private headers for thelibxrpl
target intosrc/libxrpl
fromsrc/rippled
. This will help easily implement one aspect of levelization: no source inlibxrpl
should depend on any source inrippled.
impl
directories. Should be no need for this layer once public headers are separated.[^1]: Eventually it should be renamed to
xrpl
, to further draw the line of separation between the XRPL and Ripple. [^2]: Which should eventually be renamed tosrc/xrpld
for the same reason. [^3]: The rest of theBuilds/
directory should eventually disappear: container code should move to a separate project like rippled-docker; levelization code should be obviated by good physical design; and the rest is likely bit-rotted, unused for several years, and should just be deleted.These recommendations are based on my research into project structure, looking at standardization attempts, major projects, and build system conventions and defaults. The result of these changes will look something like this:
These changes are pretty easy to implement, taking maybe two days, but will have a very large "who moved my cheese?" effect. It will be more disruptive than the formatting commit from a few years ago. I think the best way to make it happen is with a script that makes all the changes (file moves and include fixes). Run that script on the
develop
branch and push the result as commitC
. Let developers merge their work-in-progress branch withparent(C)
, run the script, commit the result, and then merge withC
.See related: #4593