This presentation by Conan co-founder Daryl details the significant updates and new features in Conan 2.0, a major release driven by five years of extensive user feedback from a large C++ community. The talk is structured around five key lessons learned, each addressing a major pain point from Conan 1.x.
Key improvements include a sophisticated dependency graph model using "traits" to correctly handle linkage requirements for static and shared libraries, and a new hybrid binary compatibility model that more accurately reflects C++'s native compilation behavior, leading to more efficient rebuilds. The introduction of "deployers" provides a flexible way for DevOps teams to extract and repackage artifacts. Furthermore, the lockfile system has been completely redesigned to be simpler and more powerful, enabling reproducible builds and complex CI/CD workflows at scale. Finally, Conan 2.0 evolves from a tool into an extensible framework with custom user commands and a public Python API for deep integration and automation.
Key Features and Lessons Learned in Conan 2.0
0:00:02 A Major Overhaul: Conan 2.0 is a near-total rewrite, with 80% of the codebase being new. This major release is the result of five years of extensive user feedback from a community of thousands of teams, reflected in over 600,000 monthly downloads and thousands of annual GitHub contributions.
0:03:08 Lesson 1: Advanced Dependency Modeling: Conan 1.0's simple requires model struggled with the nuances of C++ linkage. Conan 2.0 introduces dependency "traits" (e.g., headers=True, libs=False, transitive_libs=False) to precisely define how dependencies are consumed. This allows Conan to correctly determine header visibility and linkage requirements, especially when mixing static and shared libraries.
0:10:28 Demo - Correct Linkage: The new model correctly generates build system files (e.g., for CMake) that either include or exclude transitive dependencies based on the linkage type. For example, a consumer of a shared library will no longer be forced to link against that library's private static dependencies.
0:14:47 Lesson 2: A Smarter Binary Compatibility Model: The SemVer-based package ID model in Conan 1.0 was a poor fit for C++'s native compilation model, where static libraries are "embedded" into their consumers. Conan 2.0 introduces a new hybrid model that differentiates between:
Embed mode: Any change in a dependency (e.g., a static library) forces a rebuild of the consumer.
Non-embed mode: Only minor or major version bumps in a dependency (e.g., a shared library) force a rebuild, while patch changes do not.
0:21:21 Demo - Optimized Rebuilds: The conan graph build-order command demonstrates how this new model intelligently identifies the minimum set of packages that need to be rebuilt after a dependency changes, significantly optimizing CI pipelines for large projects.
0:25:55 Lesson 3: Beyond the Developer with 'Deployers': To serve the needs of DevOps and release engineers, Conan 2.0 introduces deployers. These are external Python scripts that can extract artifacts from Conan packages and place them in user-defined locations or formats (e.g., a local project folder, a shippable zip archive, or a Debian package).
0:30:32 Demo - Creating a Shippable Bundle: A custom deployer script is shown to iterate through dependencies, collect all necessary executables and DLLs, and package them into a single runtime.zip file, ready for distribution to customers.
0:32:29 Lesson 4: Reproducible Builds at Scale with Lockfiles: While Conan 1.0 had lockfiles, they were complex and required one file per configuration. Conan 2.0 introduces a vastly simplified and more powerful lockfile system. A single lockfile, which is just a simple list of package versions, works across all configurations and enables robust, reproducible builds.
0:40:11 Demo - Advanced CI Workflows: The new lockfiles enable complex CI scenarios, such as updating a single dependency to a new version while keeping all other transitive dependencies locked to their previously resolved versions. This allows for isolated testing of changes in large, fast-moving projects.
0:45:18 Lesson 5: From Tool to Framework via Custom Commands: Recognizing that many teams build automation on top of Conan, version 2.0 provides a first-class framework for extensibility. Users can now create their own custom commands, complete with arguments and help text, using a new, powerful, and documented public Python API.
0:50:47 Demo - Extending Conan: A custom multi-export command is created in just a few lines of Python. This command iterates through a repository of Conan recipes and exports them all, demonstrating how easily teams can add their own bespoke workflows directly into the Conan CLI.
0:52:23 Conclusion and Call to Action: Conan 2.0 is a game-changer for C++ development, addressing core challenges in dependency modeling, binary management, reproducibility, and automation. The speaker encourages both new and existing users to start using the Conan 2.0 beta to take advantage of these significant improvements.