Skip to content

Migrate from Conan 1 to Conan 2#8

Merged
joamag merged 4 commits intomasterfrom
feat/conan-2
Feb 7, 2026
Merged

Migrate from Conan 1 to Conan 2#8
joamag merged 4 commits intomasterfrom
feat/conan-2

Conversation

@joamag
Copy link
Contributor

@joamag joamag commented Feb 7, 2026

Summary

  • Migrated build system from Conan 1 to Conan 2
  • Updated conanfile.txt generators: make/cmakeCMakeToolchain/CMakeDeps/MakeDeps
  • Modernized CMakeLists.txt: replaced conan_basic_setup() with find_package() and CMake targets (PNG::PNG, ZLIB::ZLIB)
  • Updated Makefile to include conandeps.mak (Conan 2) instead of conanbuildinfo.mak (Conan 1)
  • Updated all CI workflows to use Conan 2 CLI (conan profile detect, conan install --build=missing, CMAKE_TOOLCHAIN_FILE)

Test plan

  • Verify Linux GCC CMake builds pass
  • Verify Windows CMake build passes
  • Verify macOS CMake build passes
  • Verify plain Make builds (GCC/Clang) still work (no Conan changes)
  • Verify Python extension builds are unaffected

🤖 Generated with Claude Code

Update build system to use Conan 2 generators (CMakeToolchain, CMakeDeps,
MakeDeps), modern CMake find_package pattern, and Conan 2 CLI commands
across all CI workflows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 7, 2026 13:01
@coderabbitai
Copy link

coderabbitai bot commented Feb 7, 2026

Warning

Rate limit exceeded

@joamag has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 15 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/conan-2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@joamag joamag self-assigned this Feb 7, 2026
@joamag joamag added the enhancement New feature or request label Feb 7, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the project’s dependency/build integration from Conan 1 to Conan 2 by switching to Conan 2 generators and updating the CMake/Make/CI wiring accordingly.

Changes:

  • Updated conanfile.txt generators to Conan 2 (CMakeToolchain, CMakeDeps, MakeDeps).
  • Modernized CMakeLists.txt to use find_package() + imported targets instead of conan_basic_setup().
  • Updated CI workflows to use Conan 2 CLI (conan profile detect, conan install --build=missing, toolchain file).

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
conanfile.txt Switches to Conan 2 generators for CMake and Make integration.
Makefile Attempts to consume Conan 2 make deps via conandeps.mak.
CMakeLists.txt Replaces Conan 1 CMake integration with find_package() and target-based linking.
CHANGELOG.md Notes Conan 2 migration in changelog.
.github/workflows/main.yml Updates CI to install/use Conan 2 and pass the generated CMake toolchain.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +11 to +12
find_package(PNG REQUIRED)
find_package(ZLIB REQUIRED)
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

find_package(PNG)/find_package(ZLIB) without CONFIG will prefer CMake’s built-in Find modules when available, which can cause the build to link against system libraries instead of the Conan-resolved ones. To ensure Conan’s CMakeDeps packages are used consistently, use find_package(PNG CONFIG REQUIRED) and find_package(ZLIB CONFIG REQUIRED) (or set CMAKE_FIND_PACKAGE_PREFER_CONFIG=ON).

Suggested change
find_package(PNG REQUIRED)
find_package(ZLIB REQUIRED)
find_package(PNG CONFIG REQUIRED)
find_package(ZLIB CONFIG REQUIRED)

Copilot uses AI. Check for mistakes.
Comment on lines 70 to +74
apt-get update && apt-get install -y -q wget python3 python3-dev libpng-dev
wget https://bootstrap.pypa.io/pip/get-pip.py && PIP_BREAK_SYSTEM_PACKAGES=1 python3 get-pip.py
pip3 install --break-system-packages --upgrade "conan<2" urllib3
conan install . --build
pip3 install --break-system-packages --upgrade "conan>=2,<3" urllib3
conan profile detect --force
conan install . --build=missing
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This job installs libpng-dev while also using Conan + CMakeDeps. Combined with find_package(PNG) (module mode), this can cause CMake to resolve PNG from the system rather than Conan, undermining the Conan 2 migration and risking mismatched dependency versions. Consider removing libpng-dev here (and relying on Conan), or force config-mode find_package(... CONFIG ...) so Conan’s packages win.

Copilot uses AI. Check for mistakes.
@@ -1,4 +1,4 @@
-include conanbuildinfo.mak
-include conandeps.mak
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Makefile now includes conandeps.mak, but the rest of the Makefile still consumes legacy Conan 1 CONAN_* variables (CONAN_CFLAGS, CONAN_INCLUDE_DIRS, CONAN_LIBS, etc.). Conan 2’s MakeDeps generator emits a different set of variables, so simply swapping the included filename is unlikely to make Conan-based make builds pick up the right flags/paths. Update the Makefile to use the variables produced by MakeDeps (or switch generators to match the existing CONAN_* usage).

Copilot uses AI. Check for mistakes.
joamag and others added 2 commits February 7, 2026 13:04
Conan 2's CMakeDeps generator requires CMAKE_BUILD_TYPE to be set
when using single-config generators (Make).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Only link against Python when PythonLibs is found, preventing
NOTFOUND errors on environments without Python dev headers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@joamag joamag merged commit e5a7789 into master Feb 7, 2026
27 checks passed
@joamag joamag deleted the feat/conan-2 branch February 7, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants