Conan

Disclaimer: C++ package management is hard and luckily I rarely build for Windows.

Thougths

  1. conan was created for those who think they need cross platform builds. Not some time in the future, but right away. The problem is: if you don’t need this from day one, there is a good chance that this day will never come. And when it comes, conan is not going to solve all your issues.

  2. conan says that you should fix everything in a single descriptor file. Is this even a good idea, mixing up all platform specific settings?

  3. conan was also created for those who don’t like containers, but wanted a tool to solve the problems that containers do: inconsistency across environments, dependency management. Maybe it’s just my impression, but I noticed that some people think that a package manager can replace containers.

Unless cross platform building is the number one priority in your project, my question to you: why introduce another fairly complex tool, if you can use the OS package manager and containers? Why don’t we indentify the problem first, then come up with a solution. Instead of saying: let’s just use this tool, it will solve everything, trust me.

CMake support and “backward” compatibility

Conan, software package manager for C and C++ developers

Conan is marketed as a C++ package manager. It’s 2024 now, most people say that cmake is the build system that you should use for modern C++ projects. Conan, the C++ package manager supports cmake, right? Of course, there is cmake integration as expected.

You start using that, but at some point Conan starts to complain that you’re using a deprecated feature, and you should use to the new cmake integration. It’s a completely different API, so now it’s time to refactor your conanfiles and hope the best. Ok, you get the idea: Conan devs are not afraid to break things.

You do this on one package, and notice that packages with old cmake integration can’t link to the ones using the new. Why it’s not compatible anymore?

If you are using the cmake build helper or the AutotoolsBuildEnvironment build helper Conan will automatically adjust the _GLIBCXX_USE_CXX11_ABI flag to manage the ABI. - link

What about the old cmake integration?

When Conan creates the default profile the first time it runs, it adjusts the compiler.libcxx setting to libstdc++ for backwards compatibility.

And now the confusion. They decided to introduce a whole new API, but in the name of “backward” compatibility, you cannot update your packages step by step.

GCC has a default setting for this flag. Your distro’s developers can leave it as is, or modify it, but either way you will have a sane default that works for the whole system. Now comes conan and they decided to automatically add the _GLIBCXX_USE_CXX11_ABI flag to all your gcc invocations, if you use the default profile and the new cmake integration.

I have absolutely no idea what they mean by backward compatibility.

Read about Conan

#build #cpp