Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into action
Browse files Browse the repository at this point in the history
* upstream/develop:
  docs: fix comment for LedgerHistory::fixIndex return value (4574)
  fix: remove unused variable causing clang 14 build errors (4672)
  docs(BUILD): make it easier to find environment.md (4507)
  Set version to 2.0.0-b1
  Revert CMake changes (4707)
  Change `XChainBridge` amendment to `Supported::yes` (4709)
  • Loading branch information
ximinez committed Sep 18, 2023
2 parents efd32a6 + e86181c commit 0fecaf7
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 58 deletions.
111 changes: 69 additions & 42 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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/)
Expand All @@ -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_<LANG>_COMPILER`)
in the generated CMake toolchain file.
### Multiple compilers

```
conan profile update 'conf.tools.build:compiler_executables={"c": "<path>", "cpp": "<path>"}' 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_<LANG>_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=<path> default
conan profile update env.CXX=<path> 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 `<path>` with paths to the desired compilers:

- `conan profile update env.CC=<path> default`
- `conan profile update env.CXX=<path> 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@
Expand Down
6 changes: 2 additions & 4 deletions Builds/CMake/CMakeFuncs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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_)
Expand Down
6 changes: 0 additions & 6 deletions Builds/CMake/RippledRelease.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/ripple/app/ledger/LedgerHistory.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/ripple/json/impl/Writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ const char openBrace = '{';
const char openBracket = '[';
const char quote = '"';

const std::string none;

static auto const integralFloatsBecomeInts = false;

size_t
Expand Down
2 changes: 1 addition & 1 deletion src/ripple/protocol/impl/BuildInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/ripple/protocol/impl/Feature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/test/app/XChain_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down

0 comments on commit 0fecaf7

Please sign in to comment.