Skip to content

Conan 2 updates #2062

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions .github/actions/build_docker_image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ inputs:
runs:
using: composite
steps:
- name: Login to DockerHub
if: ${{ inputs.push_image == 'true' }}
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 #v3.4.0
with:
username: ${{ env.DOCKERHUB_USER }}
password: ${{ env.DOCKERHUB_PW }}
# - name: Login to DockerHub
# if: ${{ inputs.push_image == 'true' }}
# uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 #v3.4.0
# with:
# username: ${{ env.DOCKERHUB_USER }}
# password: ${{ env.DOCKERHUB_PW }}

- name: Login to GitHub Container Registry
if: ${{ inputs.push_image == 'true' }}
Expand All @@ -54,13 +54,12 @@ runs:
push: ${{ inputs.push_image == 'true' }}
tags: ${{ steps.meta.outputs.tags }}

- name: Update DockerHub description
if: ${{ inputs.push_image == 'true' }}
uses: peter-evans/dockerhub-description@432a30c9e07499fd01da9f8a49f0faf9e0ca5b77 #v4.0.2
with:
username: ${{ env.DOCKERHUB_USER }}
password: ${{ env.DOCKERHUB_PW }}
repository: ${{ inputs.image_name }}
short-description: ${{ inputs.description }}
readme-filepath: ${{ inputs.directory }}/README.md

# - name: Update DockerHub description
# if: ${{ inputs.push_image == 'true' }}
# uses: peter-evans/dockerhub-description@432a30c9e07499fd01da9f8a49f0faf9e0ca5b77 #v4.0.2
# with:
# username: ${{ env.DOCKERHUB_USER }}
# password: ${{ env.DOCKERHUB_PW }}
# repository: ${{ inputs.image_name }}
# short-description: ${{ inputs.description }}
# readme-filepath: ${{ inputs.directory }}/README.md
4 changes: 1 addition & 3 deletions .github/actions/setup_conan/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ runs:
run: |
if [[ -z $(conan remote list | grep conan-non-prod) ]]; then
echo "Adding conan-non-prod"
conan remote add --insert 0 conan-non-prod http://18.143.149.228:8081/artifactory/api/conan/conan-non-prod
conan remote add --index 0 ripple http://18.143.149.228:8081/artifactory/api/conan/stage
else
echo "Conan-non-prod is available"
fi


7 changes: 4 additions & 3 deletions .github/workflows/build_clio_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,12 @@ jobs:
- name: Build Docker image
uses: ./.github/actions/build_docker_image
env:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_PW: ${{ secrets.DOCKERHUB_PW }}
# DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
# DOCKERHUB_PW: ${{ secrets.DOCKERHUB_PW }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
image_name: rippleci/clio
image_name: ghcr.io/legleux/clio_ci
# image_name: rippleci/clio
push_image: ${{ inputs.publish_image }}
directory: docker/clio
tags: ${{ inputs.tags }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build_impl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ on:
jobs:
build:
name: Build ${{ inputs.container != '' && 'in container' || 'natively' }}
runs-on: ${{ inputs.runs_on }}
runs-on: ${{ inputs.runs_on }}
container: ${{ inputs.container != '' && fromJson(inputs.container) || null }}

steps:
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
uses: ./.github/actions/restore_cache
id: restore_cache
with:
conan_dir: ${{ env.CONAN_USER_HOME }}/.conan
conan_dir: ${{ env.CONAN_HOME }}
conan_profile: ${{ steps.conan.outputs.conan_profile }}
ccache_dir: ${{ env.CCACHE_DIR }}
build_type: ${{ inputs.build_type }}
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
- name: Strip unit_tests
if: ${{ inputs.unit_tests && !inputs.code_coverage && inputs.sanitizer == 'false' }}
run: strip build/clio_tests

- name: Strip integration_tests
if: ${{ inputs.integration_tests && !inputs.code_coverage }}
run: strip build/clio_integration_tests
Expand All @@ -148,14 +148,14 @@ jobs:
with:
name: clio_server_${{ runner.os }}_${{ inputs.build_type }}_${{ steps.conan.outputs.conan_profile }}
path: build/clio_server

- name: Upload clio_tests
if: ${{ inputs.unit_tests && !inputs.code_coverage }}
uses: actions/upload-artifact@v4
with:
name: clio_tests_${{ runner.os }}_${{ inputs.build_type }}_${{ steps.conan.outputs.conan_profile }}
path: build/clio_tests

- name: Upload clio_integration_tests
if: ${{ inputs.integration_tests && !inputs.code_coverage }}
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:
uses: ./.github/actions/code_coverage

upload_coverage_report:
if: ${{ inputs.code_coverage }}
if: ${{ inputs.code_coverage }}
name: Codecov
needs: build
uses: ./.github/workflows/upload_coverage_report.yml
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/update_docker_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/build_docker_image
env:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_PW: ${{ secrets.DOCKERHUB_PW }}
# DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
# DOCKERHUB_PW: ${{ secrets.DOCKERHUB_PW }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
image_name: rippleci/clio_ci
image_name: ghcr.io/legleux/clio_ci
push_image: ${{ github.event_name != 'pull_request' }}
directory: docker/ci
tags: |
Expand Down
39 changes: 24 additions & 15 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from conan import ConanFile
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout

class Clio(ConanFile):
class ClioConan(ConanFile):
name = 'clio'
license = 'ISC'
author = 'Alex Kremer <akremer@ripple.com>, John Freeman <jfreeman@ripple.com>'
url = 'https://github.com/xrplf/clio'
description = 'Clio RPC server'

settings = 'os', 'compiler', 'build_type', 'arch'
options = {
'static': [True, False], # static linkage
Expand All @@ -26,7 +26,7 @@ class Clio(ConanFile):
'boost/1.83.0',
'cassandra-cpp-driver/2.17.0',
'fmt/10.1.1',
'protobuf/3.21.9',
'protobuf/3.21.12',
'grpc/1.50.1',
'openssl/1.1.1v',
'xrpl/2.4.0',
Expand All @@ -46,7 +46,9 @@ class Clio(ConanFile):
'lint': False,
'docs': False,
'snapshot': False,

}
# check that these can all be defined in build_options
build_options = {
'xrpl/*:tests': False,
'xrpl/*:rocksdb': False,
'cassandra-cpp-driver/*:shared': False,
Expand Down Expand Up @@ -78,23 +80,30 @@ def configure(self):

def layout(self):
cmake_layout(self)
# Fix this setting to follow the default introduced in Conan 1.48
# Fix this setting to follow the default introduced in Conan 1.48
# to align with our build instructions.
self.folders.generators = 'build/generators'

generators = 'CMakeDeps'
def generate(self):
tc = CMakeToolchain(self)
tc.variables['verbose'] = self.options.verbose
tc.variables['static'] = self.options.static
tc.variables['tests'] = self.options.tests
tc.variables['integration_tests'] = self.options.integration_tests
tc.variables['coverage'] = self.options.coverage
tc.variables['lint'] = self.options.lint
tc.variables['docs'] = self.options.docs
tc.variables['packaging'] = self.options.packaging
tc.variables['benchmark'] = self.options.benchmark
tc.variables['snapshot'] = self.options.snapshot
for opt in [
"benchmark",
"coverage",
"docs",
"integration_tests",
"lint",
"packaging",
"snapshot",
"static",
"tests",
"verbose",
]:
tc.variables[opt] = getattr(self.options, opt)

if self.settings.compiler == 'clang' and self.settings.compiler.version == 16:
tc.extra_cxxflags = ["-DBOOST_ASIO_DISABLE_CONCEPTS"]

tc.generate()

def build(self):
Expand Down
21 changes: 15 additions & 6 deletions docker/ci/conan/clang.asan
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
include(clang)
{% set compiler, sanitizer = profile_name.split('.') %}
{% if sanitizer == asan %}
{% set sani = address %}
{% elif sanitizer == tsan %}
{% set sani = thread %}
{% elif sanitizer == ubsan %}
{% set sani = undefined %}
{% endif %}

include({{ compiler }})

[options]
boost:extra_b2_flags="cxxflags=\"-fsanitize=address\" linkflags=\"-fsanitize=address\""
boost:without_stacktrace=True
boost:extra_b2_flags="cxxflags=\"-fsanitize={{ sani }}\" linkflags=\"-fsanitize={{ sani }}\""
boost:without_stacktrace=True
[env]
CFLAGS="-fsanitize=address"
CXXFLAGS="-fsanitize=address"
LDFLAGS="-fsanitize=address"
CFLAGS="-fsanitize={{ sani }}"
CXXFLAGS="-fsanitize={{ sani }}"
LDFLAGS="-fsanitize={{ sani }}"
21 changes: 15 additions & 6 deletions docker/ci/conan/clang.tsan
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
include(clang)
{% set compiler, sanitizer = profile_name.split('.') %}
{% if sanitizer == asan %}
{% set sani = address %}
{% elif sanitizer == tsan %}
{% set sani = thread %}
{% elif sanitizer == ubsan %}
{% set sani = undefined %}
{% endif %}

include({{ compiler }})

[options]
boost:extra_b2_flags="cxxflags=\"-fsanitize=thread\" linkflags=\"-fsanitize=thread\""
boost:without_stacktrace=True
boost:extra_b2_flags="cxxflags=\"-fsanitize={{ sani }}\" linkflags=\"-fsanitize={{ sani }}\""
boost:without_stacktrace=True
[env]
CFLAGS="-fsanitize=thread"
CXXFLAGS="-fsanitize=thread"
LDFLAGS="-fsanitize=thread"
CFLAGS="-fsanitize={{ sani }}"
CXXFLAGS="-fsanitize={{ sani }}"
LDFLAGS="-fsanitize={{ sani }}"
21 changes: 15 additions & 6 deletions docker/ci/conan/clang.ubsan
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
include(clang)
{% set compiler, sanitizer = profile_name.split('.') %}
{% if sanitizer == asan %}
{% set sani = address %}
{% elif sanitizer == tsan %}
{% set sani = thread %}
{% elif sanitizer == ubsan %}
{% set sani = undefined %}
{% endif %}

include({{ compiler }})

[options]
boost:extra_b2_flags="cxxflags=\"-fsanitize=undefined\" linkflags=\"-fsanitize=undefined\""
boost:without_stacktrace=True
boost:extra_b2_flags="cxxflags=\"-fsanitize={{ sani }}\" linkflags=\"-fsanitize={{ sani }}\""
boost:without_stacktrace=True
[env]
CFLAGS="-fsanitize=undefined"
CXXFLAGS="-fsanitize=undefined"
LDFLAGS="-fsanitize=undefined"
CFLAGS="-fsanitize={{ sani }}"
CXXFLAGS="-fsanitize={{ sani }}"
LDFLAGS="-fsanitize={{ sani }}"
21 changes: 15 additions & 6 deletions docker/ci/conan/gcc.asan
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
include(gcc)
{% set compiler, sanitizer = profile_name.split('.') %}
{% if sanitizer == asan %}
{% set sani = address %}
{% elif sanitizer == tsan %}
{% set sani = thread %}
{% elif sanitizer == ubsan %}
{% set sani = undefined %}
{% endif %}

include({{ compiler }})

[options]
boost:extra_b2_flags="cxxflags=\"-fsanitize=address\" linkflags=\"-fsanitize=address\""
boost:without_stacktrace=True
boost:extra_b2_flags="cxxflags=\"-fsanitize={{ sani }}\" linkflags=\"-fsanitize={{ sani }}\""
boost:without_stacktrace=True
[env]
CFLAGS="-fsanitize=address"
CXXFLAGS="-fsanitize=address"
LDFLAGS="-fsanitize=address"
CFLAGS="-fsanitize={{ sani }}"
CXXFLAGS="-fsanitize={{ sani }}"
LDFLAGS="-fsanitize={{ sani }}"
21 changes: 15 additions & 6 deletions docker/ci/conan/gcc.tsan
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
include(gcc)
{% set compiler, sanitizer = profile_name.split('.') %}
{% if sanitizer == asan %}
{% set sani = address %}
{% elif sanitizer == tsan %}
{% set sani = thread %}
{% elif sanitizer == ubsan %}
{% set sani = undefined %}
{% endif %}

include({{ compiler }})

[options]
boost:extra_b2_flags="cxxflags=\"-fsanitize=thread\" linkflags=\"-fsanitize=thread\""
boost:without_stacktrace=True
boost:extra_b2_flags="cxxflags=\"-fsanitize={{ sani }}\" linkflags=\"-fsanitize={{ sani }}\""
boost:without_stacktrace=True
[env]
CFLAGS="-fsanitize=thread"
CXXFLAGS="-fsanitize=thread"
LDFLAGS="-fsanitize=thread"
CFLAGS="-fsanitize={{ sani }}"
CXXFLAGS="-fsanitize={{ sani }}"
LDFLAGS="-fsanitize={{ sani }}"
21 changes: 15 additions & 6 deletions docker/ci/conan/gcc.ubsan
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
include(gcc)
{% set compiler, sanitizer = profile_name.split('.') %}
{% if sanitizer == asan %}
{% set sani = address %}
{% elif sanitizer == tsan %}
{% set sani = thread %}
{% elif sanitizer == ubsan %}
{% set sani = undefined %}
{% endif %}

include({{ compiler }})

[options]
boost:extra_b2_flags="cxxflags=\"-fsanitize=undefined\" linkflags=\"-fsanitize=undefined\""
boost:without_stacktrace=True
boost:extra_b2_flags="cxxflags=\"-fsanitize={{ sani }}\" linkflags=\"-fsanitize={{ sani }}\""
boost:without_stacktrace=True
[env]
CFLAGS="-fsanitize=undefined"
CXXFLAGS="-fsanitize=undefined"
LDFLAGS="-fsanitize=undefined"
CFLAGS="-fsanitize={{ sani }}"
CXXFLAGS="-fsanitize={{ sani }}"
LDFLAGS="-fsanitize={{ sani }}"
Loading