Skip to content

Commit 69314e6

Browse files
authored
refactor: Remove external libraries as they are hosted in our Conan Center Index fork (#5643)
This change: * Removes the patched Conan recipes from the `external/` directory. * Adds instructions for contributors how to obtain our patched recipes. * Updates the Conan remote name and remote URL (the underlying package repository isn't changed). * If the remote already exists, updates the URL instead of removing and re-adding. * This is not done for the libXRPL job as it still uses Conan 1. This job will be switched to Conan 2 soon. * Removes duplicate Conan remote CI pipeline steps. * Overwrites the existing global.conf on MacOS and Windows machines, as those do not run CI pipelines in isolation but all share the same Conan installation; appending the same config over and over bloats the file.
1 parent dbeb841 commit 69314e6

19 files changed

+41
-580
lines changed

.github/actions/dependencies/action.yml

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,17 @@ inputs:
66
runs:
77
using: composite
88
steps:
9-
- name: export custom recipes
10-
shell: bash
11-
run: |
12-
conan export --version 1.1.10 external/snappy
13-
conan export --version 4.0.3 external/soci
14-
- name: add Ripple Conan remote
9+
- name: add Conan remote
1510
if: env.CONAN_URL != ''
1611
shell: bash
1712
run: |
18-
if conan remote list | grep -q "ripple"; then
19-
conan remote remove ripple
20-
echo "Removed conan remote ripple"
13+
if conan remote list | grep -q 'xrplf'; then
14+
conan remote update --index 0 --url ${CONAN_URL} xrplf
15+
echo "Updated Conan remote 'xrplf' to ${CONAN_URL}."
16+
else
17+
conan remote add --index 0 xrplf ${CONAN_URL}
18+
echo "Added new conan remote 'xrplf' at ${CONAN_URL}."
2119
fi
22-
conan remote add --index 0 ripple "${CONAN_URL}"
23-
echo "Added conan remote ripple at ${CONAN_URL}"
24-
- name: try to authenticate to Ripple Conan remote
25-
if: env.CONAN_LOGIN_USERNAME_RIPPLE != '' && env.CONAN_PASSWORD_RIPPLE != ''
26-
id: remote
27-
shell: bash
28-
run: |
29-
echo "Authenticating to ripple remote..."
30-
conan remote auth ripple --force
31-
conan remote list-users
3220
- name: list missing binaries
3321
id: binaries
3422
shell: bash

.github/workflows/libxrpl.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Check libXRPL compatibility with Clio
22
env:
3-
CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/dev
4-
CONAN_LOGIN_USERNAME_RIPPLE: ${{ secrets.CONAN_USERNAME }}
5-
CONAN_PASSWORD_RIPPLE: ${{ secrets.CONAN_TOKEN }}
3+
CONAN_URL: https://conan.ripplex.io
4+
CONAN_LOGIN_USERNAME_XRPLF: ${{ secrets.CONAN_USERNAME }}
5+
CONAN_PASSWORD_XRPLF: ${{ secrets.CONAN_TOKEN }}
66
on:
77
pull_request:
88
paths:
@@ -43,28 +43,28 @@ jobs:
4343
shell: bash
4444
run: |
4545
conan export . ${{ steps.channel.outputs.channel }}
46-
- name: Add Ripple Conan remote
46+
- name: Add Conan remote
4747
shell: bash
4848
run: |
4949
conan remote list
50-
conan remote remove ripple || true
50+
conan remote remove xrplf || true
5151
# Do not quote the URL. An empty string will be accepted (with a non-fatal warning), but a missing argument will not.
52-
conan remote add ripple ${{ env.CONAN_URL }} --insert 0
52+
conan remote add xrplf ${{ env.CONAN_URL }} --insert 0
5353
- name: Parse new version
5454
id: version
5555
shell: bash
5656
run: |
5757
echo version="$(cat src/libxrpl/protocol/BuildInfo.cpp | grep "versionString =" \
5858
| awk -F '"' '{print $2}')" | tee ${GITHUB_OUTPUT}
59-
- name: Try to authenticate to Ripple Conan remote
59+
- name: Try to authenticate to Conan remote
6060
id: remote
6161
shell: bash
6262
run: |
6363
# `conan user` implicitly uses the environment variables CONAN_LOGIN_USERNAME_<REMOTE> and CONAN_PASSWORD_<REMOTE>.
6464
# https://docs.conan.io/1/reference/commands/misc/user.html#using-environment-variables
6565
# https://docs.conan.io/1/reference/env_vars.html#conan-login-username-conan-login-username-remote-name
6666
# https://docs.conan.io/1/reference/env_vars.html#conan-password-conan-password-remote-name
67-
echo outcome=$(conan user --remote ripple --password >&2 \
67+
echo outcome=$(conan user --remote xrplf --password >&2 \
6868
&& echo success || echo failure) | tee ${GITHUB_OUTPUT}
6969
- name: Upload new package
7070
id: upload

.github/workflows/macos.yml

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ concurrency:
1818
# This part of Conan configuration is specific to this workflow only; we do not want
1919
# to pollute conan/profiles directory with settings which might not work for others
2020
env:
21-
CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/dev
22-
CONAN_LOGIN_USERNAME_RIPPLE: ${{ secrets.CONAN_USERNAME }}
23-
CONAN_PASSWORD_RIPPLE: ${{ secrets.CONAN_TOKEN }}
21+
CONAN_URL: https://conan.ripplex.io
2422
CONAN_GLOBAL_CONF: |
2523
core.download:parallel={{os.cpu_count()}}
2624
core.upload:parallel={{os.cpu_count()}}
@@ -87,24 +85,9 @@ jobs:
8785
clang --version
8886
- name: configure Conan
8987
run : |
90-
echo "${CONAN_GLOBAL_CONF}" >> $(conan config home)/global.conf
88+
echo "${CONAN_GLOBAL_CONF}" > $(conan config home)/global.conf
9189
conan config install conan/profiles/ -tf $(conan config home)/profiles/
9290
conan profile show
93-
- name: export custom recipes
94-
shell: bash
95-
run: |
96-
conan export --version 1.1.10 external/snappy
97-
conan export --version 4.0.3 external/soci
98-
- name: add Ripple Conan remote
99-
if: env.CONAN_URL != ''
100-
shell: bash
101-
run: |
102-
if conan remote list | grep -q "ripple"; then
103-
conan remote remove ripple
104-
echo "Removed conan remote ripple"
105-
fi
106-
conan remote add --index 0 ripple "${CONAN_URL}"
107-
echo "Added conan remote ripple at ${CONAN_URL}"
10891
- name: build dependencies
10992
uses: ./.github/actions/dependencies
11093
with:

.github/workflows/nix.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ concurrency:
1919
# This part of Conan configuration is specific to this workflow only; we do not want
2020
# to pollute conan/profiles directory with settings which might not work for others
2121
env:
22-
CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/dev
23-
CONAN_LOGIN_USERNAME_RIPPLE: ${{ secrets.CONAN_USERNAME }}
24-
CONAN_PASSWORD_RIPPLE: ${{ secrets.CONAN_TOKEN }}
22+
CONAN_URL: https://conan.ripplex.io
2523
CONAN_GLOBAL_CONF: |
2624
core.download:parallel={{ os.cpu_count() }}
2725
core.upload:parallel={{ os.cpu_count() }}

.github/workflows/windows.yml

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ concurrency:
2121
# This part of Conan configuration is specific to this workflow only; we do not want
2222
# to pollute conan/profiles directory with settings which might not work for others
2323
env:
24-
CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/dev
25-
CONAN_LOGIN_USERNAME_RIPPLE: ${{ secrets.CONAN_USERNAME }}
26-
CONAN_PASSWORD_RIPPLE: ${{ secrets.CONAN_TOKEN }}
24+
CONAN_URL: https://conan.ripplex.io
2725
CONAN_GLOBAL_CONF: |
2826
core.download:parallel={{os.cpu_count()}}
2927
core.upload:parallel={{os.cpu_count()}}
@@ -82,24 +80,9 @@ jobs:
8280
- name: configure Conan
8381
shell: bash
8482
run: |
85-
echo "${CONAN_GLOBAL_CONF}" >> $(conan config home)/global.conf
83+
echo "${CONAN_GLOBAL_CONF}" > $(conan config home)/global.conf
8684
conan config install conan/profiles/ -tf $(conan config home)/profiles/
8785
conan profile show
88-
- name: export custom recipes
89-
shell: bash
90-
run: |
91-
conan export --version 1.1.10 external/snappy
92-
conan export --version 4.0.3 external/soci
93-
- name: add Ripple Conan remote
94-
if: env.CONAN_URL != ''
95-
shell: bash
96-
run: |
97-
if conan remote list | grep -q "ripple"; then
98-
conan remote remove ripple
99-
echo "Removed conan remote ripple"
100-
fi
101-
conan remote add --index 0 ripple "${CONAN_URL}"
102-
echo "Added conan remote ripple at ${CONAN_URL}"
10386
- name: build dependencies
10487
uses: ./.github/actions/dependencies
10588
with:

BUILD.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,28 @@ can do this by running:
132132
conan remote add --index 0 xrplf "https://conan.ripplex.io"
133133
```
134134

135-
Alternatively, you can use the `conan export` command to add the patched recipes
136-
that are also (for the time being) located in the `external/` directory to your
137-
local Conan cache:
135+
Alternatively, you can pull the patched recipes into the repository and use them
136+
locally:
138137

139138
```bash
140-
conan export --version 1.1.10 external/snappy
141-
conan export --version 4.0.3 external/soci
139+
cd external
140+
git init
141+
git remote add origin [email protected]:XRPLF/conan-center-index.git
142+
git sparse-checkout init
143+
git sparse-checkout set recipes/snappy
144+
git sparse-checkout add recipes/soci
145+
git fetch origin master
146+
git checkout master
147+
conan export --version 1.1.10 external/recipes/snappy
148+
conan export --version 4.0.3 external/recipes/soci
142149
```
143150

151+
In the case we switch to a newer version of a dependency that still requires a
152+
patch, it will be necessary for you to pull in the changes and re-export the
153+
updated dependencies with the newer version. However, if we switch to a newer
154+
version that no longer requires a patch, no action is required on your part, as
155+
the new recipe will be automatically pulled from the official Conan Center.
156+
144157
### Conan profile tweaks
145158

146159
#### Missing compiler version
@@ -525,7 +538,7 @@ After any updates or changes to dependencies, you may need to do the following:
525538
conan remove '*'
526539
```
527540

528-
3. Re-run [conan export](#export-updated-recipes)
541+
3. Re-run [conan export](#patched-recipes) if needed.
529542
4. Re-run [conan install](#build-and-test).
530543

531544
### `protobuf/port_def.inc` file not found

external/README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
# External Conan recipes
22

3-
The subdirectories in this directory contain either copies or Conan recipes
4-
of external libraries used by rippled.
5-
The Conan recipes include patches we have not yet pushed upstream.
3+
The subdirectories in this directory contain copies of external libraries used
4+
by rippled.
65

76
| Folder | Upstream | Description |
87
|:----------------|:---------------------------------------------|:------------|
98
| `antithesis-sdk`| [Project](https://github.com/antithesishq/antithesis-sdk-cpp/) | [Antithesis](https://antithesis.com/docs/using_antithesis/sdk/cpp/overview.html) SDK for C++ |
109
| `ed25519-donna` | [Project](https://github.com/floodyberry/ed25519-donna) | [Ed25519](http://ed25519.cr.yp.to/) digital signatures |
11-
| `rocksdb` | [Recipe](https://github.com/conan-io/conan-center-index/tree/master/recipes/rocksdb) | Fast key/value database. (Supports rotational disks better than NuDB.) |
1210
| `secp256k1` | [Project](https://github.com/bitcoin-core/secp256k1) | ECDSA digital signatures using the **secp256k1** curve |
13-
| `snappy` | [Recipe](https://github.com/conan-io/conan-center-index/tree/master/recipes/snappy) | "Snappy" lossless compression algorithm. |
14-
| `soci` | [Recipe](https://github.com/conan-io/conan-center-index/tree/master/recipes/soci) | Abstraction layer for database access. |

external/snappy/conandata.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

external/snappy/conanfile.py

Lines changed: 0 additions & 89 deletions
This file was deleted.

external/snappy/patches/1.1.10-0001-fix-inlining-failure.patch

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)