Skip to content

Commit 43b7230

Browse files
authored
Merge pull request #756 from vsbogd/conan2
Migrate to Conan2
2 parents d40a62b + e2d0c83 commit 43b7230

17 files changed

+726
-55
lines changed

.github/workflows/ci-auto.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ jobs:
1414
with:
1515
python-version: "3.7"
1616
os: "ubuntu-20.04"
17-
cmake-version: "3.19.x"
17+
cmake-version: "3.24.x"

.github/workflows/ci-manual.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ on:
2121
cmake-version:
2222
description: 'JSON array of CMake versions to be checked'
2323
required: true
24-
default: "[\"3.19.x\"]"
24+
default: "[\"3.24.x\"]"
2525
type: string
2626

2727
jobs:

.github/workflows/common.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ on:
2121
type: string
2222
cmake-version:
2323
description: "CMake version to use"
24-
default: "3.19.x"
24+
default: "3.24.x"
2525
required: false
2626
type: string
2727

@@ -69,11 +69,11 @@ jobs:
6969
- name: Install Conan
7070
uses: turtlebrowser/[email protected]
7171
with:
72-
version: "1.64"
72+
version: "2.5.0"
7373

7474
- name: Setup Conan profile
7575
run: |
76-
conan profile new --detect default
76+
conan profile detect --force
7777
7878
- name: Print environment
7979
run: |
@@ -97,8 +97,8 @@ jobs:
9797
echo "conan Python: $conan_python"
9898
echo -n "conan Python platform: "
9999
$conan_python -c "import platform; print(platform.platform())"
100-
echo "conan profile show default"
101-
conan profile show default
100+
echo "conan profile show"
101+
conan profile show
102102
echo "gcc --version"
103103
gcc --version
104104
echo "g++ --version"

.github/workflows/old_interpreter.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@ jobs:
5454
- name: Install CMake
5555
uses: jwlawson/[email protected]
5656
with:
57-
cmake-version: "3.19.x"
57+
cmake-version: "3.24.x"
5858

5959
- name: Install Conan
6060
uses: turtlebrowser/[email protected]
6161
with:
62-
version: "1.64"
62+
version: "2.5.0"
6363

6464
- name: Setup Conan profile
6565
run: |
66-
conan profile new --detect default
66+
conan profile detect --force
6767
6868
- name: Print environment
6969
run: |
@@ -87,8 +87,8 @@ jobs:
8787
echo "conan Python: $conan_python"
8888
echo -n "conan Python platform: "
8989
$conan_python -c "import platform; print(platform.platform())"
90-
echo "conan profile show default"
91-
conan profile show default
90+
echo "conan profile show"
91+
conan profile show
9292
echo "gcc --version"
9393
gcc --version
9494
echo "g++ --version"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Cargo.lock
1010
.vscode
1111
.aider*
1212
__pycache__
13+
CMakeUserPresets.json
1314
/build
1415
/python/hyperon.egg-info
1516
/python/dist

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Minimal version supported by hyperonc
2-
cmake_minimum_required(VERSION 3.19)
2+
cmake_minimum_required(VERSION 3.24)
33

44
project(hyperon)
55

@@ -22,6 +22,7 @@ ExternalProject_Add(
2222
"-DCMAKE_INSTALL_PREFIX=${HYPERONC_INSTALL_PREFIX}"
2323
"-DCMAKE_BUILD_TYPE=${BUILD_CONFIGURATION}"
2424
"-DCARGO_ARGS=${CARGO_ARGS}"
25+
"-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=${CMAKE_CURRENT_SOURCE_DIR}/conan_provider.cmake"
2526
)
2627

2728
ExternalProject_Get_Property(hyperonc BINARY_DIR)
@@ -38,6 +39,7 @@ ExternalProject_Add(
3839
"-DHYPERONC_INSTALL_PREFIX=${HYPERONC_INSTALL_PREFIX}"
3940
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=${CMAKE_CURRENT_SOURCE_DIR}/python"
4041
"-DCMAKE_BUILD_TYPE=${BUILD_CONFIGURATION}"
42+
"-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=${CMAKE_CURRENT_SOURCE_DIR}/conan_provider.cmake"
4143
INSTALL_COMMAND cmake -E echo "Skipping install step."
4244
)
4345

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ RUN sh /tmp/rustup.sh -y && rm /tmp/rustup.sh
2121
ENV PATH="${PATH}:${HOME}/.cargo/bin"
2222
RUN cargo install cbindgen
2323

24-
RUN python3 -m pip install conan==1.64 pip==23.1.2
24+
RUN python3 -m pip install conan==2.5.0 pip==23.1.2
2525
ENV PATH="${PATH}:${HOME}/.local/bin"
26-
RUN conan profile new --detect default
26+
RUN conan profile detect --force
2727

2828
ADD --chown=user:users . ${HOME}/hyperon-experimental
2929

README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Rust (see the Notes at the installation page).
8686
* Python3 and Python3-dev (3.7 or later)
8787
* Pip (23.1.2 or later)
8888
* GCC (7.5 or later)
89-
* CMake (3.19 or later)
89+
* CMake (3.24 or later)
9090

9191
To support Git based modules (enabled by default):
9292
* OpenSSL library
@@ -99,8 +99,8 @@ cargo install --force cbindgen
9999

100100
* Install Conan and make default Conan profile:
101101
```
102-
python3 -m pip install conan==1.64
103-
conan profile new --detect default
102+
python3 -m pip install conan==2.5.0
103+
conan profile detect --force
104104
```
105105

106106
* Upgrade Pip to the required version:
@@ -233,21 +233,19 @@ If you see the following `cmake` output:
233233
```
234234
ERROR: Not able to automatically detect '/usr/bin/cc' version
235235
ERROR: Unable to find a working compiler
236-
WARN: Remotes registry file missing, creating default one in /root/.conan/remotes.json
237-
ERROR: libcheck/0.15.2: 'settings.compiler' value not defined
238236
```
239237
Try to create the default Conan profile manually:
240238
```
241-
conan profile new --detect default
239+
conan profile detect --force
242240
```
243241
If it doesn't help, then try to manually add `compiler`, `compiler.version` and
244242
`compiler.libcxx` values in the default Conan profile
245-
(`~/.conan/profiles/default`).
243+
(`~/.conan2/profiles/default`).
246244
For example:
247245
```
248-
conan profile update settings.compiler=gcc default
249-
conan profile update settings.compiler.version=7 default
250-
conan profile update settings.compiler.libcxx=libstdc++ default
246+
compiler=gcc
247+
compiler.version=7
248+
compiler.libcxx=libstdc++
251249
```
252250

253251
### Rust compiler shows errors

c/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ enable_testing()
88
option(BUILD_SHARED_LIBS "Build shared library" ON)
99
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure)
1010

11-
execute_process(
12-
# --build is required to build dependencies from source under cibuildwheel
13-
# environment
14-
COMMAND cmake -E env CC= CXX= conan install --build -pr:b default -pr:h default -- ${CMAKE_CURRENT_SOURCE_DIR}
15-
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
16-
include(${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake)
17-
conan_basic_setup(TARGETS)
18-
1911
# HYPERONC_TARGET_DIR is used as a target dir for cargo. Cargo automatically adds
2012
# `debug/release` suffix to the value of --target-dir argument so we need to
2113
# calculate actual path to compiled library using $<CONFIG:...> cmake generator

c/conanfile.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
libcheck/0.15.2
33

44
[generators]
5-
cmake
5+
CMakeDeps
6+
CMakeToolchain
67

78
[options]
8-
libcheck:with_subunit=False
9+
libcheck/*:with_subunit=False

0 commit comments

Comments
 (0)