Skip to content

Commit 1d101b7

Browse files
committed
Use the Conan package manager
Use the Conan package manager (#4367) Introduces a conanfile.py (and a Conan recipe for RocksDB) to enable building the package with Conan, choosing more recent default versions of dependencies. It removes almost all of the CMake build files related to dependencies, and the configurations for Travis CI and GitLab CI. A new set of cross-platform build instructions are written in BUILD.md. Includes example GitHub Actions workflow for each of Linux, macOS, Windows. * Test on macos-12 We use the <concepts> library which was not added to Apple Clang until version 13.1.6. The default Clang on macos-11 (the sometimes current version of macos-latest) is 13.0.0, and the default Clang on macos-12 is 14.0.0. Closes #4223. dump remove to string fix assert [do not merge] ignore build error [do not merge] ignore build error Revert "[do not merge] ignore build error" This reverts commit 576e05a. Revert "[do not merge] ignore build error" This reverts commit 29975ec.
1 parent 84eee58 commit 1d101b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1499
-4400
lines changed

.github/workflows/nix.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: nix
2+
on: [push, pull_request]
3+
4+
jobs:
5+
6+
test:
7+
strategy:
8+
matrix:
9+
platform:
10+
- ubuntu-latest
11+
- macos-12
12+
generator:
13+
- Ninja
14+
configuration:
15+
- Release
16+
runs-on: ${{ matrix.platform }}
17+
env:
18+
build_dir: .build
19+
steps:
20+
- name: checkout
21+
uses: actions/checkout@v3
22+
- name: install Ninja on Linux
23+
if: matrix.generator == 'Ninja' && runner.os == 'Linux'
24+
run: sudo apt install ninja-build
25+
- name: install Ninja on OSX
26+
if: matrix.generator == 'Ninja' && runner.os == 'macOS'
27+
run: brew install ninja
28+
- name: install nproc on OSX
29+
if: runner.os == 'macOS'
30+
run: brew install coreutils
31+
- name: choose Python
32+
uses: actions/setup-python@v3
33+
with:
34+
python-version: 3.9
35+
- name: learn Python cache directory
36+
id: pip-cache
37+
run: |
38+
sudo pip install --upgrade pip
39+
echo "::set-output name=dir::$(pip cache dir)"
40+
- name: restore Python cache directory
41+
uses: actions/cache@v2
42+
with:
43+
path: ${{ steps.pip-cache.outputs.dir }}
44+
key: ${{ runner.os }}-${{ hashFiles('.github/workflows/nix.yml') }}
45+
- name: install Conan
46+
run: pip install wheel 'conan>=1.52.0'
47+
- name: check environment
48+
run: |
49+
echo ${PATH} | tr ':' '\n'
50+
python --version
51+
conan --version
52+
cmake --version
53+
env
54+
- name: configure Conan
55+
run: |
56+
conan profile new default --detect
57+
conan profile update settings.compiler.cppstd=20 default
58+
- name: configure Conan on Linux
59+
if: runner.os == 'Linux'
60+
run: |
61+
conan profile update settings.compiler.libcxx=libstdc++11 default
62+
- name: learn Conan cache directory
63+
id: conan-cache
64+
run: |
65+
echo "::set-output name=dir::$(conan config get storage.path)"
66+
- name: restore Conan cache directory
67+
uses: actions/cache@v2
68+
with:
69+
path: ${{ steps.conan-cache.outputs.dir }}
70+
key: ${{ hashFiles('~/.conan/profiles/default', 'conanfile.py', 'external/rocksdb/*', '.github/workflows/nix.yml') }}
71+
- name: export RocksDB
72+
run: conan export external/rocksdb
73+
- name: install dependencies
74+
run: |
75+
mkdir ${build_dir}
76+
cd ${build_dir}
77+
conan install .. --build missing --settings build_type=${{ matrix.configuration }} --profile:build default --profile:host default
78+
- name: configure
79+
run: |
80+
cd ${build_dir}
81+
cmake \
82+
-G ${{ matrix.generator }} \
83+
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
84+
-DCMAKE_BUILD_TYPE=${{ matrix.configuration }} \
85+
-Dassert=ON \
86+
-Dcoverage=OFF \
87+
-Dreporting=OFF \
88+
-Dunity=OFF \
89+
..
90+
- name: build
91+
run: |
92+
cmake --build ${build_dir} --target rippled --parallel $(nproc)
93+
- name: test
94+
run: |
95+
${build_dir}/rippled --unittest --unittest-jobs $(nproc)

.github/workflows/windows.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: windows
2+
# We have disabled this workflow because it fails in our CI Windows
3+
# environment, but we cannot replicate the failure in our personal Windows
4+
# test environments, nor have we gone through the trouble of setting up an
5+
# interactive CI Windows environment.
6+
# We welcome contributions to diagnose or debug the problems on Windows. Until
7+
# then, we leave this tombstone as a reminder that we have tried (but failed)
8+
# to write a reliable test for Windows.
9+
# on: [push, pull_request]
10+
11+
jobs:
12+
13+
test:
14+
strategy:
15+
matrix:
16+
generator:
17+
- Visual Studio 16 2019
18+
configuration:
19+
- Release
20+
runs-on: windows-2019
21+
env:
22+
build_dir: .build
23+
steps:
24+
- name: checkout
25+
uses: actions/checkout@v3
26+
- name: choose Python
27+
uses: actions/setup-python@v3
28+
with:
29+
python-version: 3.9
30+
- name: learn Python cache directory
31+
id: pip-cache
32+
run: |
33+
pip install --upgrade pip
34+
echo "::set-output name=dir::$(pip cache dir)"
35+
- name: restore Python cache directory
36+
uses: actions/cache@v2
37+
with:
38+
path: ${{ steps.pip-cache.outputs.dir }}
39+
key: ${{ runner.os }}-${{ hashFiles('.github/workflows/windows.yml') }}
40+
- name: install Conan
41+
run: pip install wheel 'conan>=1.52.0'
42+
- name: check environment
43+
run: |
44+
$env:PATH -split ';'
45+
python --version
46+
conan --version
47+
cmake --version
48+
dir env:
49+
- name: configure Conan
50+
run: |
51+
conan profile new default --detect
52+
conan profile update settings.compiler.cppstd=20 default
53+
conan profile update settings.compiler.runtime=MT default
54+
conan profile update settings.compiler.toolset=v141 default
55+
- name: learn Conan cache directory
56+
id: conan-cache
57+
run: |
58+
echo "::set-output name=dir::$(conan config get storage.path)"
59+
- name: restore Conan cache directory
60+
uses: actions/cache@v2
61+
with:
62+
path: ${{ steps.conan-cache.outputs.dir }}
63+
key: ${{ hashFiles('~/.conan/profiles/default', 'conanfile.py', 'external/rocksdb/*', '.github/workflows/windows.yml') }}
64+
- name: export RocksDB
65+
run: conan export external/rocksdb
66+
- name: install dependencies
67+
run: |
68+
mkdir $env:build_dir
69+
cd $env:build_dir
70+
conan install .. --build missing --settings build_type=${{ matrix.configuration }}
71+
- name: configure
72+
run: |
73+
$env:build_dir
74+
cd $env:build_dir
75+
pwd
76+
ls
77+
cmake `
78+
-G "${{ matrix.generator }}" `
79+
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake `
80+
-Dassert=ON `
81+
-Dreporting=OFF `
82+
-Dunity=OFF `
83+
..
84+
- name: build
85+
run: |
86+
cmake --build $env:build_dir --target rippled --config ${{ matrix.configuration }} --parallel $env:NUMBER_OF_PROCESSORS
87+
- name: test
88+
run: |
89+
& "$env:build_dir\${{ matrix.configuration }}\rippled.exe" --unittest

0 commit comments

Comments
 (0)