Skip to content

Commit d13bb4b

Browse files
authored
chore: migrate to conan 2 (#440)
* chore: bump to conan2 * gha: fix conan-cache-action * chore: run python formatting * chore: more formatting fixes * chore: fix compilation warnings * gha: fix conan caching * chore: bump protobuf version * ci: run dev.conan to generate the generators * fix(dist-test): build conan first * fix(gha): temporarily disable TSAN and ASAN * fix: use different conan profiles for sanitisers * fix: run cpp formatting * fix(conan): update conan-release.lock * fix(ci): add conan toolchain to example's build * fix(gha): don't force --clean on the conan-cache step
1 parent 99c0a1b commit d13bb4b

24 files changed

+250
-132
lines changed

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FAABRIC_VERSION=0.21.0
2-
FAABRIC_CLI_IMAGE=ghcr.io/faasm/faabric:0.21.0
1+
FAABRIC_VERSION=0.22.0
2+
FAABRIC_CLI_IMAGE=ghcr.io/faasm/faabric:0.22.0
33
COMPOSE_PROJECT_NAME=faabric-dev
44
CONAN_CACHE_MOUNT_SOURCE=./conan-cache/

.github/workflows/tests.yml

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,26 @@ jobs:
2020
if: github.event.pull_request.draft == false
2121
runs-on: ubuntu-latest
2222
container:
23-
image: ghcr.io/faasm/faabric:0.21.0
23+
image: ghcr.io/faasm/faabric:0.22.0
2424
env:
2525
DEPLOYMENT_TYPE: gha-ci
2626
steps:
2727
- name: "Check-out code"
2828
uses: actions/checkout@v4
29-
- uses: faasm/conan-cache-action@v3
30-
- name: "Build Conan CMake deps to be shared by all runs"
31-
run: ./bin/inv_wrapper.sh dev.cmake --build Debug --clean
29+
- uses: faasm/conan-cache-action@main
30+
with:
31+
build-type: Debug
32+
from: faabric
33+
- name: "Build Conan deps to be shared by all runs"
34+
run: |
35+
./bin/inv_wrapper.sh dev.conan --build Debug
36+
./bin/inv_wrapper.sh dev.conan --build Release
3237
3338
docs:
3439
if: github.event.pull_request.draft == false
3540
runs-on: ubuntu-latest
3641
container:
37-
image: ghcr.io/faasm/faabric:0.21.0
42+
image: ghcr.io/faasm/faabric:0.22.0
3843
steps:
3944
- name: "Check out code"
4045
uses: actions/checkout@v4
@@ -45,7 +50,7 @@ jobs:
4550
if: github.event.pull_request.draft == false
4651
runs-on: ubuntu-latest
4752
container:
48-
image: ghcr.io/faasm/faabric:0.21.0
53+
image: ghcr.io/faasm/faabric:0.22.0
4954
steps:
5055
- name: "Check out code"
5156
uses: actions/checkout@v4
@@ -65,17 +70,22 @@ jobs:
6570
REDIS_QUEUE_HOST: redis
6671
REDIS_STATE_HOST: redis
6772
container:
68-
image: ghcr.io/faasm/faabric:0.21.0
73+
image: ghcr.io/faasm/faabric:0.22.0
6974
options: --privileged
7075
services:
7176
redis:
7277
image: redis
7378
steps:
7479
- name: "Check-out code"
7580
uses: actions/checkout@v4
76-
- uses: faasm/conan-cache-action@v3
81+
- uses: faasm/conan-cache-action@main
82+
with:
83+
build-type: Debug
84+
from: faabric
7785
- name: "Ping redis"
7886
run: redis-cli -h redis ping
87+
- name: "Run conan"
88+
run: ./bin/inv_wrapper.sh dev.conan --build=Debug
7989
- name: "Run cmake for tests"
8090
run: ./bin/inv_wrapper.sh dev.cmake --clean --build=Debug --coverage
8191
- name: "Build tests"
@@ -98,23 +108,35 @@ jobs:
98108
strategy:
99109
fail-fast: false
100110
matrix:
101-
sanitiser: [None, Address, Thread, Undefined]
111+
sanitiser: [None, Thread, Address, Undefined]
102112
env:
103113
DEPLOYMENT_TYPE: gha-ci
104114
REDIS_QUEUE_HOST: redis
105115
REDIS_STATE_HOST: redis
106116
container:
107-
image: ghcr.io/faasm/faabric:0.21.0
117+
image: ghcr.io/faasm/faabric:0.22.0
108118
options: --privileged
109119
services:
110120
redis:
111121
image: redis
112122
steps:
113123
- name: "Check-out code"
114124
uses: actions/checkout@v4
115-
- uses: faasm/conan-cache-action@v3
125+
- uses: faasm/conan-cache-action@main
126+
with:
127+
build-type: Debug
128+
from: faabric
116129
- name: "Ping redis"
117130
run: redis-cli -h redis ping
131+
# For sanitised builds, we need to also re-build all Conan dependencies
132+
# so that they are also sanitized. Otherwise this causes unexpected
133+
# crashes.
134+
- name: "Re-build conan deps"
135+
if: ${{ matrix.sanitiser != 'None' }}
136+
run: ./bin/inv_wrapper.sh dev.conan --clean --build=Debug --sanitiser ${{ matrix.sanitiser }}
137+
- name: "Run conan"
138+
if: ${{ matrix.sanitiser == 'None' }}
139+
run: ./bin/inv_wrapper.sh dev.conan --build=Debug --sanitiser ${{ matrix.sanitiser }}
118140
- name: "Run cmake for tests"
119141
run: ./bin/inv_wrapper.sh dev.cmake --clean --build=Debug --sanitiser ${{ matrix.sanitiser }}
120142
- name: "Build tests"
@@ -133,8 +155,10 @@ jobs:
133155
# --- Code update ---
134156
- name: "Check out code"
135157
uses: actions/checkout@v4
136-
- name: "Conan cache"
137-
uses: faasm/conan-cache-action@v3
158+
- uses: faasm/conan-cache-action@main
159+
with:
160+
build-type: Debug
161+
from: faabric
138162
- name: "Build distributed tests"
139163
run: ./dist-test/build.sh
140164
- name: "Run the distributed tests"
@@ -156,22 +180,27 @@ jobs:
156180
REDIS_QUEUE_HOST: redis
157181
REDIS_STATE_HOST: redis
158182
container:
159-
image: ghcr.io/faasm/faabric:0.21.0
183+
image: ghcr.io/faasm/faabric:0.22.0
160184
services:
161185
redis:
162186
image: redis
163187
steps:
164188
- name: "Check-out code"
165189
uses: actions/checkout@v4
166-
- uses: faasm/conan-cache-action@v3
190+
- uses: faasm/conan-cache-action@main
167191
with:
168-
build-type: "release"
192+
build-type: Release
193+
from: faabric
194+
- name: "Run conan"
195+
run: ./bin/inv_wrapper.sh dev.conan --build=Release
169196
- name: "Run cmake shared"
170197
run: ./bin/inv_wrapper.sh dev.cmake --clean --shared --build=Release
171198
- name: "Build Faabric shared library"
172199
run: ./bin/inv_wrapper.sh dev.cc faabric --shared
173200
- name: "Install Faabric shared library"
174201
run: ./bin/inv_wrapper.sh dev.install faabric --shared
202+
- name: "Re-run conan (needed for examples)"
203+
run: ./bin/inv_wrapper.sh dev.conan --build=Release
175204
- name: "Build examples"
176205
run: ./bin/inv_wrapper.sh examples
177206
- name: "Run example to check"

.ycm_extra_conf.py

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

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.21.0
1+
0.22.0

cmake/ExternalProjects.cmake

Lines changed: 9 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -4,86 +4,18 @@ include (ExternalProject)
44
include (FetchContent)
55
find_package (Threads REQUIRED)
66

7-
# Find conan-generated package descriptions
7+
# Find conan-generated package descriptions.
88
list(PREPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_BINARY_DIR})
99
list(PREPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_BINARY_DIR})
1010

11-
if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/conan.cmake")
12-
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
13-
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/0.18.1/conan.cmake"
14-
"${CMAKE_CURRENT_BINARY_DIR}/conan.cmake"
15-
TLS_VERIFY ON)
16-
endif()
17-
18-
set(CONAN_CMAKE_SILENT_OUTPUT ON CACHE INTERNAL "")
19-
include(${CMAKE_CURRENT_BINARY_DIR}/conan.cmake)
20-
21-
conan_check(VERSION 1.63.0 REQUIRED)
22-
23-
# Enable revisions in the conan config
24-
execute_process(COMMAND ${CONAN_CMD} config set general.revisions_enabled=1
25-
RESULT_VARIABLE RET_CODE)
26-
if(NOT "${RET_CODE}" STREQUAL "0")
27-
message(FATAL_ERROR "Error setting revisions for Conan: '${RET_CODE}'")
28-
endif()
29-
30-
# --------------------------------
31-
# Conan dependencies
32-
# --------------------------------
33-
34-
conan_cmake_configure(
35-
REQUIRES
36-
"abseil/20220623.0@#732381dc99db29b4cfd293684891da56"
37-
"boost/1.84.0@#7604ce1e7485780469dffb6430f232ea"
38-
"catch2/2.13.9@#8793d3e6287d3684201418de556d98fe"
39-
"flatbuffers/23.5.26@#b153646f6546daab4c7326970b6cd89c"
40-
"hiredis/1.0.2@#370dad964286cadb1f15dc90252e8ef3"
41-
"openssl/3.0.2@#269fa93e5afe8c34bd9a0030d2b8f0fe"
42-
"protobuf/3.20.0@#8e4de7081bea093469c9e6076149b2b4"
43-
"readerwriterqueue/1.0.6@#a95c8da3d68822dec4d4c13fff4b5c96"
44-
"spdlog/1.10.0@#6406c337028e15e56cd6a070cbac54c4"
45-
"zlib/1.2.12@#3b9e037ae1c615d045a06c67d88491ae"
46-
GENERATORS
47-
cmake_find_package
48-
cmake_paths
49-
OPTIONS
50-
boost:error_code_header_only=True
51-
boost:system_no_deprecated=True
52-
boost:zlib=False
53-
boost:bzip2=False
54-
boost:lzma=False
55-
boost:zstd=False
56-
boost:without_locale=True
57-
boost:without_log=True
58-
boost:without_mpi=True
59-
boost:without_python=True
60-
boost:without_test=True
61-
boost:without_wave=True
62-
)
63-
64-
conan_cmake_autodetect(FAABRIC_CONAN_SETTINGS)
65-
66-
conan_cmake_install(PATH_OR_REFERENCE .
67-
BUILD outdated
68-
UPDATE
69-
REMOTE conancenter
70-
PROFILE_HOST ${CMAKE_CURRENT_LIST_DIR}/../conan-profile.txt
71-
PROFILE_BUILD ${CMAKE_CURRENT_LIST_DIR}/../conan-profile.txt
72-
SETTINGS ${FAABRIC_CONAN_SETTINGS}
73-
)
74-
75-
include(${CMAKE_CURRENT_BINARY_DIR}/conan_paths.cmake)
76-
7711
find_package(absl QUIET REQUIRED)
78-
find_package(Boost 1.80.0 QUIET REQUIRED)
12+
find_package(Boost 1.84.0 QUIET REQUIRED COMPONENTS filesystem program_options system)
7913
find_package(Catch2 QUIET REQUIRED)
80-
find_package(flatbuffers QUIET REQUIRED)
14+
find_package(flatbuffers CONFIG QUIET REQUIRED)
8115
find_package(fmt QUIET REQUIRED)
8216
find_package(hiredis QUIET REQUIRED)
83-
# 27/01/2023 - Pin OpenSSL to a specific version to avoid incompatibilities
84-
# with the system's (i.e. Ubuntu 22.04) OpenSSL
85-
find_package(OpenSSL 3.0.2 QUIET REQUIRED)
86-
find_package(Protobuf 3.20.0 QUIET REQUIRED)
17+
find_package(OpenSSL 3.6.0 QUIET REQUIRED)
18+
find_package(Protobuf 6.30.1 QUIET REQUIRED)
8719
find_package(readerwriterqueue QUIET REQUIRED)
8820
find_package(spdlog QUIET REQUIRED)
8921
find_package(ZLIB QUIET REQUIRED)
@@ -121,7 +53,7 @@ FetchContent_Declare(nng_ext
12153
)
12254
FetchContent_Declare(zstd_ext
12355
GIT_REPOSITORY "https://github.com/facebook/zstd"
124-
GIT_TAG "v1.5.2"
56+
GIT_TAG "v1.5.7"
12557
SOURCE_SUBDIR "build/cmake"
12658
)
12759

@@ -150,7 +82,9 @@ target_link_libraries(faabric_common_dependencies INTERFACE
15082
absl::flat_hash_map
15183
absl::strings
15284
atomic_queue::atomic_queue
153-
Boost::Boost
85+
Boost::headers
86+
Boost::filesystem
87+
Boost::program_options
15488
Boost::system
15589
flatbuffers::flatbuffers
15690
hiredis::hiredis

conan-debug.lock

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"version": "0.5",
3+
"requires": [
4+
"zlib/1.2.12#2ea72a0bae8b680f8a282e103e0a6880%1743582313.324",
5+
"spdlog/1.10.0#5aed29a37b544d0eb5812b8be74cd7a4%1731353179.805",
6+
"readerwriterqueue/1.0.6#aaa5ff6fac60c2aee591e9e51b063b83%1679587692.891",
7+
"protobuf/6.30.1#97bae23ef6d7f9fcfdb4ded9468ad6de%1747665968.233",
8+
"openssl/3.6.0#89e8af1d4a21afcac0557079d23d8890%1759746682.365",
9+
"libbacktrace/cci.20210118#a7691bfccd8caaf66309df196790a5a1%1722218217.276",
10+
"hiredis/1.0.2#6001a683c04da07565e97e76d0d841bd%1744279494.11",
11+
"fmt/8.1.1#d66420384a943dbf1f292d34ef34c11c%1735899179.969",
12+
"flatbuffers/23.5.26#0290575326fe9b2c39a0236ea81d8c30%1743154511.803",
13+
"catch2/2.13.9#17ac9b0b78c63353e304c5744e862a77%1678135818.816",
14+
"boost/1.84.0#40dd9fecacce0ef109851d0e38727fd0%1759416424.265",
15+
"abseil/20250127.0#faefa3bbf31b5c32933e328d72e42cfe%1754142622.985"
16+
],
17+
"build_requires": [
18+
"cmake/3.31.9#2032c6471fe4f5a3e17f65fed518d545%1758832282.188",
19+
"b2/5.3.3#107c15377719889654eb9a162a673975%1750340310.079"
20+
],
21+
"python_requires": [],
22+
"config_requires": []
23+
}

conan-profiles/asan.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[settings]
2+
os=Linux
3+
arch=x86_64
4+
compiler=clang
5+
compiler.version=17
6+
compiler.libcxx=libstdc++11
7+
compiler.cppstd=20
8+
build_type=RelWithDebInfo
9+
10+
[conf]
11+
tools.build:compiler_executables={"c": "/usr/bin/clang-17", "cpp": "/usr/bin/clang++-17"}
12+
tools.build:cflags=["-fsanitize=address","-fno-omit-frame-pointer","-g","-O1"]
13+
tools.build:cxxflags=["-fsanitize=address","-fno-omit-frame-pointer","-g","-O1"]
14+
tools.build:sharedlinkflags=["-fsanitize=address"]
15+
tools.build:exelinkflags=["-fsanitize=address"]
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
[settings]
22
os=Linux
3-
os_build=Linux
43
arch=x86_64
5-
arch_build=x86_64
64
compiler=clang
75
compiler.version=17
86
compiler.libcxx=libstdc++11
97
compiler.cppstd=20
108
build_type=Release
11-
[options]
12-
[build_requires]
13-
[env]
14-
CC=/usr/bin/clang-17
15-
CXX=/usr/bin/clang++-17
9+
10+
[conf]
11+
tools.build:compiler_executables={"c": "/usr/bin/clang-17", "cpp": "/usr/bin/clang++-17"}

conan-profiles/tsan.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[settings]
2+
os=Linux
3+
arch=x86_64
4+
compiler=clang
5+
compiler.version=17
6+
compiler.libcxx=libstdc++11
7+
compiler.cppstd=20
8+
build_type=RelWithDebInfo
9+
10+
[conf]
11+
tools.build:compiler_executables={"c": "/usr/bin/clang-17", "cpp": "/usr/bin/clang++-17"}
12+
tools.build:cxxflags=["-fsanitize=thread","-fno-omit-frame-pointer","-g"]
13+
tools.build:cflags=["-fsanitize=thread","-fno-omit-frame-pointer","-g"]
14+
tools.build:sharedlinkflags=["-fsanitize=thread"]
15+
tools.build:exelinkflags=["-fsanitize=thread"]

conan-release.lock

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"version": "0.5",
3+
"requires": [
4+
"zlib/1.2.12#2ea72a0bae8b680f8a282e103e0a6880%1743582313.324",
5+
"spdlog/1.10.0#5aed29a37b544d0eb5812b8be74cd7a4%1731353179.805",
6+
"readerwriterqueue/1.0.6#aaa5ff6fac60c2aee591e9e51b063b83%1679587692.891",
7+
"protobuf/6.30.1#97bae23ef6d7f9fcfdb4ded9468ad6de%1747665968.233",
8+
"openssl/3.6.0#89e8af1d4a21afcac0557079d23d8890%1759746682.365",
9+
"libbacktrace/cci.20210118#a7691bfccd8caaf66309df196790a5a1%1722218217.276",
10+
"hiredis/1.0.2#6001a683c04da07565e97e76d0d841bd%1744279494.11",
11+
"fmt/8.1.1#d66420384a943dbf1f292d34ef34c11c%1735899179.969",
12+
"flatbuffers/23.5.26#0290575326fe9b2c39a0236ea81d8c30%1743154511.803",
13+
"catch2/2.13.9#17ac9b0b78c63353e304c5744e862a77%1678135818.816",
14+
"boost/1.84.0#40dd9fecacce0ef109851d0e38727fd0%1759416424.265",
15+
"abseil/20250127.0#faefa3bbf31b5c32933e328d72e42cfe%1754142622.985"
16+
],
17+
"build_requires": [
18+
"cmake/3.31.9#2032c6471fe4f5a3e17f65fed518d545%1758832282.188",
19+
"b2/5.3.3#107c15377719889654eb9a162a673975%1750340310.079"
20+
],
21+
"python_requires": [],
22+
"config_requires": []
23+
}

0 commit comments

Comments
 (0)