From 5b7d2c133aba41d9b25e71dd7a01cf9932bb75cc Mon Sep 17 00:00:00 2001 From: Scott Determan Date: Fri, 15 Sep 2023 11:08:17 -0400 Subject: [PATCH 1/6] Change `XChainBridge` amendment to `Supported::yes` (#4709) --- src/ripple/protocol/impl/Feature.cpp | 2 +- src/test/app/XChain_test.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ripple/protocol/impl/Feature.cpp b/src/ripple/protocol/impl/Feature.cpp index dcb35641360..aa41b7d5b6e 100644 --- a/src/ripple/protocol/impl/Feature.cpp +++ b/src/ripple/protocol/impl/Feature.cpp @@ -455,7 +455,7 @@ REGISTER_FIX (fixNFTokenRemint, Supported::yes, VoteBehavior::De REGISTER_FIX (fixReducedOffersV1, Supported::yes, VoteBehavior::DefaultNo); REGISTER_FEATURE(Clawback, Supported::yes, VoteBehavior::DefaultNo); REGISTER_FEATURE(AMM, Supported::yes, VoteBehavior::DefaultNo); -REGISTER_FEATURE(XChainBridge, Supported::no, VoteBehavior::DefaultNo); +REGISTER_FEATURE(XChainBridge, Supported::yes, VoteBehavior::DefaultNo); // The following amendments are obsolete, but must remain supported // because they could potentially get enabled. diff --git a/src/test/app/XChain_test.cpp b/src/test/app/XChain_test.cpp index 14fcf8bf3cd..a27370dbf02 100644 --- a/src/test/app/XChain_test.cpp +++ b/src/test/app/XChain_test.cpp @@ -532,7 +532,7 @@ struct XChain_test : public beast::unit_test::suite, // coverage test: BridgeCreate::preflight() - create bridge when feature // disabled. { - Env env(*this); + Env env(*this, supported_amendments() - featureXChainBridge); env(create_bridge(Account::master, jvb), ter(temDISABLED)); } From 01fc4b02030b0b96258ddbeb87113c72235c270f Mon Sep 17 00:00:00 2001 From: Michael Legleux Date: Fri, 15 Sep 2023 08:44:44 -0700 Subject: [PATCH 2/6] Revert CMake changes (#4707) This was likely put back when #4292 was rebased. --- Builds/CMake/CMakeFuncs.cmake | 6 ++---- Builds/CMake/RippledRelease.cmake | 6 ------ 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/Builds/CMake/CMakeFuncs.cmake b/Builds/CMake/CMakeFuncs.cmake index fe51b3e320a..fb60fd9b4eb 100644 --- a/Builds/CMake/CMakeFuncs.cmake +++ b/Builds/CMake/CMakeFuncs.cmake @@ -18,10 +18,8 @@ macro(group_sources curdir) endmacro() macro (exclude_from_default target_) - if(target_) - set_target_properties (${target_} PROPERTIES EXCLUDE_FROM_ALL ON) - set_target_properties (${target_} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD ON) - endif() + set_target_properties (${target_} PROPERTIES EXCLUDE_FROM_ALL ON) + set_target_properties (${target_} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD ON) endmacro () macro (exclude_if_included target_) diff --git a/Builds/CMake/RippledRelease.cmake b/Builds/CMake/RippledRelease.cmake index 0e712d8a566..a0ad3696572 100644 --- a/Builds/CMake/RippledRelease.cmake +++ b/Builds/CMake/RippledRelease.cmake @@ -2,12 +2,6 @@ package/container targets - (optional) #]===================================================================] -# Early return if the `containers` directory is missing, -# e.g. when we are building a Conan package. -if(NOT EXISTS containers) - return() -endif() - if (is_root_project) if (NOT DOCKER) find_program (DOCKER docker) From 046d0c2f0af89067aea0d245da706a35c5f99046 Mon Sep 17 00:00:00 2001 From: Elliot Lee Date: Thu, 14 Sep 2023 13:11:28 -0700 Subject: [PATCH 3/6] Set version to 2.0.0-b1 --- src/ripple/protocol/impl/BuildInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ripple/protocol/impl/BuildInfo.cpp b/src/ripple/protocol/impl/BuildInfo.cpp index f6ca21e43e4..933cca3a7e9 100644 --- a/src/ripple/protocol/impl/BuildInfo.cpp +++ b/src/ripple/protocol/impl/BuildInfo.cpp @@ -33,7 +33,7 @@ namespace BuildInfo { // and follow the format described at http://semver.org/ //------------------------------------------------------------------------------ // clang-format off -char const* const versionString = "1.12.0" +char const* const versionString = "2.0.0-b1" // clang-format on #if defined(DEBUG) || defined(SANITIZER) From 3397922989018e3512a150eeb13aa53745c51cdf Mon Sep 17 00:00:00 2001 From: Elliot Lee Date: Fri, 15 Sep 2023 21:54:25 -0700 Subject: [PATCH 4/6] docs(BUILD): make it easier to find environment.md (#4507) Make the instructions a bit easier to follow. Users on different platforms can look for their platform name to find relevant information. --- BUILD.md | 111 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 69 insertions(+), 42 deletions(-) diff --git a/BUILD.md b/BUILD.md index 3d7223277b2..cc7e6f9318f 100644 --- a/BUILD.md +++ b/BUILD.md @@ -1,7 +1,7 @@ -> These instructions assume you have a C++ development environment ready -> with Git, Python, Conan, CMake, and a C++ compiler. For help setting one up -> on Linux, macOS, or Windows, see [our guide](./docs/build/environment.md). -> +| :warning: **WARNING** :warning: +|---| +| These instructions assume you have a C++ development environment ready with Git, Python, Conan, CMake, and a C++ compiler. For help setting one up on Linux, macOS, or Windows, [see this guide](./docs/build/environment.md). | + > These instructions also assume a basic familiarity with Conan and CMake. > If you are unfamiliar with Conan, > you can read our [crash course](./docs/build/conan.md) @@ -29,9 +29,12 @@ branch. git checkout develop ``` - ## Minimum Requirements +See [System Requirements](https://xrpl.org/system-requirements.html). + +Building rippled generally requires git, Python, Conan, CMake, and a C++ compiler. Some guidance on setting up such a [C++ development environment can be found here](./docs/build/environment.md). + - [Python 3.7](https://www.python.org/downloads/) - [Conan 1.55](https://conan.io/downloads.html) - [CMake 3.16](https://cmake.org/download/) @@ -46,82 +49,106 @@ The [minimum compiler versions][2] required are: | Apple Clang | 13.1.6 | | MSVC | 19.23 | -We don't recommend Windows for `rippled` production at this time. As of -January 2023, Ubuntu has the highest level of quality assurance, testing, -and support. +### Linux -Windows developers should use Visual Studio 2019. `rippled` isn't -compatible with [Boost](https://www.boost.org/) 1.78 or 1.79, and Conan -can't build earlier Boost versions. +The Ubuntu operating system has received the highest level of +quality assurance, testing, and support. -**Note:** 32-bit Windows development isn't supported. +Here are [sample instructions for setting up a C++ development environment on Linux](./docs/build/environment.md#linux). +### Mac -## Steps +Many rippled engineers use macOS for development. + +Here are [sample instructions for setting up a C++ development environment on macOS](./docs/build/environment.md#macos). +### Windows + +Windows is not recommended for production use at this time. + +- Additionally, 32-bit Windows development is not supported. +- Visual Studio 2022 is not yet supported. + - rippled generally requires [Boost][] 1.77, which Conan cannot build with VS 2022. + - Until rippled is updated for compatibility with later versions of Boost, Windows developers may need to use Visual Studio 2019. + +[Boost]: https://www.boost.org/ + +## Steps ### Set Up Conan -1. (Optional) If you've never used Conan, use autodetect to set up a default profile. +After you have a [C++ development environment](./docs/build/environment.md) ready with Git, Python, Conan, CMake, and a C++ compiler, you may need to set up your Conan profile. + +These instructions assume a basic familiarity with Conan and CMake. + +If you are unfamiliar with Conan, then please read [this crash course](./docs/build/conan.md) or the official [Getting Started][3] walkthrough. + +You'll need at least one Conan profile: ``` conan profile new default --detect ``` -2. Update the compiler settings. +Update the compiler settings: ``` conan profile update settings.compiler.cppstd=20 default ``` - Linux developers will commonly have a default Conan [profile][] that compiles - with GCC and links with libstdc++. - If you are linking with libstdc++ (see profile setting `compiler.libcxx`), - then you will need to choose the `libstdc++11` ABI. +**Linux** developers will commonly have a default Conan [profile][] that compiles +with GCC and links with libstdc++. +If you are linking with libstdc++ (see profile setting `compiler.libcxx`), +then you will need to choose the `libstdc++11` ABI: ``` conan profile update settings.compiler.libcxx=libstdc++11 default ``` - On Windows, you should use the x64 native build tools. - An easy way to do that is to run the shortcut "x64 Native Tools Command - Prompt" for the version of Visual Studio that you have installed. +**Windows** developers may need to use the x64 native build tools. +An easy way to do that is to run the shortcut "x64 Native Tools Command +Prompt" for the version of Visual Studio that you have installed. Windows developers must also build `rippled` and its dependencies for the x64 - architecture. + architecture: ``` conan profile update settings.arch=x86_64 default ``` -3. (Optional) If you have multiple compilers installed on your platform, - make sure that Conan and CMake select the one you want to use. - This setting will set the correct variables (`CMAKE__COMPILER`) - in the generated CMake toolchain file. +### Multiple compilers - ``` - conan profile update 'conf.tools.build:compiler_executables={"c": "", "cpp": ""}' default - ``` +When `/usr/bin/g++` exists on a platform, it is the default cpp compiler. This +default works for some users. - It should choose the compiler for dependencies as well, - but not all of them have a Conan recipe that respects this setting (yet). - For the rest, you can set these environment variables: +However, if this compiler cannot build rippled or its dependencies, then you can +install another compiler and set Conan and CMake to use it. +Update the `conf.tools.build:compiler_executables` setting in order to set the correct variables (`CMAKE__COMPILER`) in the +generated CMake toolchain file. +For example, on Ubuntu 20, you may have gcc at `/usr/bin/gcc` and g++ at `/usr/bin/g++`; if that is the case, you can select those compilers with: +``` +conan profile update 'conf.tools.build:compiler_executables={"c": "/usr/bin/gcc", "cpp": "/usr/bin/g++"}' default +``` - ``` - conan profile update env.CC= default - conan profile update env.CXX= default - ``` +Replace `/usr/bin/gcc` and `/usr/bin/g++` with paths to the desired compilers. + +It should choose the compiler for dependencies as well, +but not all of them have a Conan recipe that respects this setting (yet). +For the rest, you can set these environment variables. +Replace `` with paths to the desired compilers: + +- `conan profile update env.CC= default` +- `conan profile update env.CXX= default` -4. Export our [Conan recipe for Snappy](./external/snappy). - It doesn't explicitly link the C++ standard library, - which allows you to statically link it with GCC, if you want. +Export our [Conan recipe for Snappy](./external/snappy). +It does not explicitly link the C++ standard library, +which allows you to statically link it with GCC, if you want. ``` conan export external/snappy snappy/1.1.10@ ``` -5. Export our [Conan recipe for SOCI](./external/soci). - It patches their CMake to correctly import its dependencies. +Export our [Conan recipe for SOCI](./external/soci). +It patches their CMake to correctly import its dependencies. ``` conan export external/soci soci/4.0.3@ From 65df4bceaabddf79ac183024a4005b4bcf25731c Mon Sep 17 00:00:00 2001 From: Ed Hennis Date: Mon, 18 Sep 2023 11:38:51 -0400 Subject: [PATCH 5/6] fix: remove unused variable causing clang 14 build errors (#4672) Removed the unused variable `none` from `Writer.cpp` which was causing build errors on clang version 14. --- src/ripple/json/impl/Writer.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ripple/json/impl/Writer.cpp b/src/ripple/json/impl/Writer.cpp index 98c8debe96a..44d106aa336 100644 --- a/src/ripple/json/impl/Writer.cpp +++ b/src/ripple/json/impl/Writer.cpp @@ -47,8 +47,6 @@ const char openBrace = '{'; const char openBracket = '['; const char quote = '"'; -const std::string none; - static auto const integralFloatsBecomeInts = false; size_t From e86181c096958d3b9fc643ba6f3c03389eac55c6 Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S <21219765+ckeshava@users.noreply.github.com> Date: Mon, 18 Sep 2023 10:01:43 -0700 Subject: [PATCH 6/6] docs: fix comment for LedgerHistory::fixIndex return value (#4574) `LedgerHistory::fixIndex` returns `false` if a repair was performed. Fix #4572 --- src/ripple/app/ledger/LedgerHistory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ripple/app/ledger/LedgerHistory.h b/src/ripple/app/ledger/LedgerHistory.h index 5733ca76375..092ad7d8371 100644 --- a/src/ripple/app/ledger/LedgerHistory.h +++ b/src/ripple/app/ledger/LedgerHistory.h @@ -95,7 +95,7 @@ class LedgerHistory /** Repair a hash to index mapping @param ledgerIndex The index whose mapping is to be repaired @param ledgerHash The hash it is to be mapped to - @return `true` if the mapping was repaired + @return `false` if the mapping was repaired */ bool fixIndex(LedgerIndex ledgerIndex, LedgerHash const& ledgerHash);