Skip to content

refactor(build): use conan to handle dependencies and vulnerability check#34489

Merged
guanshengliang merged 6 commits intomainfrom
refactor/use-conan
Feb 4, 2026
Merged

refactor(build): use conan to handle dependencies and vulnerability check#34489
guanshengliang merged 6 commits intomainfrom
refactor/use-conan

Conversation

@zitsen
Copy link
Copy Markdown
Contributor

@zitsen zitsen commented Feb 3, 2026

Description

Issue(s)

  • Close/close/Fix/fix/Resolve/resolve: Issue Link

Checklist

Please check the items in the checklist if applicable.

  • Is the user manual updated?
  • Are the test cases passed and automated?
  • Is there no significant decrease in test coverage?

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @zitsen, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the project's build system by introducing Conan as the primary dependency manager. The goal is to enhance build reproducibility, simplify dependency resolution, and improve the process for identifying and addressing vulnerabilities. It establishes a new, parallel build workflow that leverages Conan's capabilities while maintaining compatibility with the existing build mechanisms during this transition.

Highlights

  • Conan Integration: The build system has been refactored to integrate Conan for dependency management, allowing for more reproducible builds and streamlined dependency resolution.
  • New Build Workflow: New commands (conan-install, conan-gen, conan-bld, conan-build-all) have been added to build.sh to support a Conan-based build workflow, complementing the existing ExternalProject method.
  • CMake Compatibility Layer: A new cmake/conan.cmake file introduces a compatibility layer, enabling existing CMake DEP_ext_* macros to utilize dependencies provided by Conan.
  • Dependency Migration: Key dependencies such as cppstub, fast-lzma2, and avro-c have been migrated to Conan packages, with dedicated recipes and documentation added.
  • Centralized Dependency Management: A main conanfile.py has been added to declare and configure all project dependencies through Conan, facilitating better version control and vulnerability checks.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .gitignore
    • Added CMakeUserPresets.json to the ignore list, reflecting new CMake preset configurations.
  • CMakeLists.txt
    • Implemented conditional logic to switch between Conan and ExternalProject for dependency management based on the USE_CONAN option.
  • build.sh
    • Extended with new commands (conan-install, conan-gen, conan-bld, conan-build-all, conan-post-build) to orchestrate the Conan-based build process.
    • Updated help messages to clearly differentiate between traditional (ExternalProject) and new (Conan) build scenarios.
  • cmake/conan.cmake
    • New file created to provide a compatibility layer for Conan packages, including find_package calls for various dependencies and mapping them to existing DEP_ext_* macros.
  • cmake/options.cmake
    • Corrected a typo from USE_PRCE2 to USE_PCRE2 in the definition of build options.
  • conan/CMAKE_INTEGRATION.md
    • New documentation added, detailing the CMake integration for Conan packages, specifically for cppstub and fast-lzma2, including usage examples and troubleshooting.
  • conan/README.md
    • New overview document for Conan packages, describing fast-lzma2 and cppstub, their features, installation, and the benefits of Conan migration.
  • conan/avro-c/conanfile.py
    • New Conan recipe for the avro-c library, managing its dependencies (zlib, jansson, snappy) and build process.
  • conan/avro-c/test_package/CMakeLists.txt
    • New test package CMake configuration for the avro-c Conan recipe.
  • conan/avro-c/test_package/conanfile.py
    • New test package Conan recipe for avro-c.
  • conan/avro-c/test_package/test_package.c
    • New C source file for testing the avro-c Conan package.
  • conan/cppstub/README.md
    • New documentation for the cppstub Conan package.
  • conan/cppstub/SUMMARY.md
    • New summary document detailing the migration of the cppstub library to a Conan package.
  • conan/cppstub/conanfile.py
    • New Conan recipe for the header-only cppstub library, including logic for platform-specific header inclusion.
  • conan/cppstub/cppstub/LICENSE
    • Added MIT License file for the cppstub library.
  • conan/cppstub/cppstub/src/stub.h
    • Added the main stub.h header file for the cppstub library.
  • conan/cppstub/cppstub/src_darwin/addr_any.h
    • Added macOS-specific addr_any.h header for cppstub.
  • conan/cppstub/cppstub/src_win/addr_any.h
    • Added Windows-specific addr_any.h header for cppstub.
  • conan/cppstub/test_package/CMakeLists.txt
    • New test package CMake configuration for the cppstub Conan recipe.
  • conan/cppstub/test_package/conanfile.py
    • New test package Conan recipe for cppstub.
  • conan/cppstub/test_package/test_package.cpp
    • New C++ source file for testing the cppstub Conan package.
  • conan/fast-lzma2/README.md
    • New documentation for the fast-lzma2 Conan package.
  • conan/fast-lzma2/USAGE.md
    • New usage guide for the fast-lzma2 Conan package.
  • conan/fast-lzma2/conanfile.py
    • New Conan recipe for fast-lzma2, handling its build via make and packaging.
  • conan/fast-lzma2/fast-lzma2
    • Added a Git submodule reference for the fast-lzma2 library.
  • conan/fast-lzma2/test_package/CMakeLists.txt
    • New test package CMake configuration for the fast-lzma2 Conan recipe.
  • conan/fast-lzma2/test_package/conanfile.py
    • New test package Conan recipe for fast-lzma2.
  • conan/fast-lzma2/test_package/test_package.c
    • New C source file for testing the fast-lzma2 Conan package.
  • conanfile.py
    • New main Conan recipe for the project, declaring and configuring all external dependencies and their options.
  • include/util/tpcre2.h
    • Corrected a typo from USE_PRCE2 to USE_PCRE2 in the header guard and conditional compilation.
  • source/util/src/tpcre2.c
    • Corrected a typo from USE_PRCE2 to USE_PCRE2 in the conditional compilation.
  • tools/shell/CMakeLists.txt
    • Added a conditional check IF(TARGET ext_taosws) before adding ext_taosws as a dependency, improving build robustness.
  • tools/taos-tools/inc/bench.h
    • Wrapped #define CURL_STATICLIB in an #ifndef guard to prevent potential redefinition issues.
Activity
  • No specific human activity (comments, reviews, or progress updates) was provided in the context for this pull request.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces Conan for dependency management, which is a significant improvement for the build system's maintainability and reproducibility. The changes are well-structured, with new Conan recipes for dependencies, a compatibility layer in CMake, and updates to the build script. However, there are a few critical issues in the build.sh script, including duplicated functions and a bug in the purge command, that must be addressed. I've also pointed out some minor issues in the CMake scripts and a source file for better clarity and correctness.

@zitsen zitsen force-pushed the refactor/use-conan branch from 06d1d70 to 287437b Compare February 3, 2026 11:32
@guanshengliang guanshengliang merged commit f58bdb7 into main Feb 4, 2026
16 of 17 checks passed
@zitsen zitsen deleted the refactor/use-conan branch February 4, 2026 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants