DEV Community

Cover image for Cloudsmith Now Supports Conan!
Kyle Harrison for Cloudsmith

Posted on • Originally published at cloudsmith.com

Cloudsmith Now Supports Conan!

We’re delighted to announce that Cloudsmith now supports Conan!

As most of your know, Cloudsmith is universal. It is our aim to support all the languages and package formats our customers and prospective customers use. We think any organization benefits from being able to store, secure, manage and distribute ALL of their software assets in a single consistent manner.

That doesn’t necessarily mean multi-format repositories, but rather every member of the team knowing where to find the packages they need and being able to integrate them into build and deployment processes in the same way - no matter what format.

Of course, there are a lot of formats and languages out there. So we never stop working to ensure that we cover as many as possible. We listen and respond to our customers, all with the intention of building the only truly universal cloud-native package management platform.

Hence our support for Conan. Now on with the detail...

Introducing Conan

Conan is an open-source package manager for C/C++, including everything from its client to server implementation and even documentation.

It is actively developed on GitHub by an awesome community of contributors and a team of engineers working full time on the project. C++ and C popularity continues to hold a steady spot at 9th and 11th place in the "most popular programming, scripting and mark up languages" category of the 2019 Stack Overflow developer survey. Additionally, they hold the 6th and 9th place in the most popular programming languages on Github for 2019, demonstrating the C/C++ community's longevity.

Conan is an excellent choice as a package manager. It provides the flexibility developers crave in a developer tool. It uses Python-based package recipes for extensibility, customization and integration with other systems.

It also works on a multitude of systems; including Windows, Linux (Ubuntu, Debian, RedHat, ArchLinux, Raspbian), OSX, FreeBSD, and SunOS. It can target any existing platform, from bare metal to desktop, mobile, embedded, servers, cross-building and works with a range of build systems (Visual Studio MSBuild, CMake, Makefiles, SCons, etc), with extensibility to use any build system. When combined, these aspects of Conan make it an excellent choice as a multi-platform package manager.

Using Conan with Cloudsmith allows development teams to:

  • Develop packages internally and share them privately with other teams.
  • Distribute and deploy your packages in a pipeline at your organization.
  • Distribute packages as commercial software.
  • Make modifications to public packages, choosing how you wish to republish (open-source, public, private).
  • Capture the exact state of your dependencies at a particular version, release, user, and channel.
  • Control (allow list/deny list) at an organization, repository, and package level
  • In short, all the benefits of using Cloudsmith that are already enjoyed by development teams all over the world today, are now available for Conan.

See also:

Getting Started

Getting started with Cloudsmith and Conan couldn't be simpler. First, you'll need a Cloudsmith account and a repository to which you can upload your packages. If you need to install Conan you can find instructions on the Conan website.

Cloudsmith should work with all supported versions of Conan, but we recommend using at least Version 1.25.2 or later for the best experience. You can check your local version like so:

$ conan --version

Conan version 1.25.2
Enter fullscreen mode Exit fullscreen mode

Creating a Conan Package

For the purpose of this demonstration, we will create a Conan package containing a single function that prints "Hello World" using the official example. Running the following example will create a new package called "hello" at version "0.0.1" without the optional user/channel.

The Conan create command is equivalent to running export, install, and test.

$ mkdir mypkg && cd mypkg

$ conan new hello/0.0.1 -t

$ conan create .
Enter fullscreen mode Exit fullscreen mode

The conanfile.py generated as part of the above command will be used to by Conan to build packages however it will also be used by Cloudsmith to retrieve metadata related to a package such as the package name, version, license, etc which can be used for advanced filtering using the UI and Cloudsmith CLI.

If you wish to learn more about how Conan creates the Package Recipe and Test Packages, the official documentation provides a detailed breakdown for each command. You're now ready to upload your package to Cloudsmith.

Uploading your Conan Package

First, you need to add a remote for a specific namespace/repository to the list of Conan remotes. The below example uses Cloudsmith as the namespace but this could be your namespace or one of an organization in which you are a member.

$ conan remote add cloudsmith-testing-public
Enter fullscreen mode Exit fullscreen mode

https://conan.cloudsmith.io/cloudsmith/testing-public/
Once a remote has been added, a user can then be configured using your Cloudsmith username and password in place of the substituted values:

$ conan user -p PASSWORD -r cloudsmith-testing-public USERNAME
Enter fullscreen mode Exit fullscreen mode

Once you're remote and user has been configured within Conan your token will be cached in the client until it expires or becomes invalid. You're now ready to upload your package:

conan upload hello/0.0.1 --all -r cloudsmith-testing-public
Enter fullscreen mode Exit fullscreen mode

Once uploaded, you can view your package in Cloudsmith.

Conan Package in Cloudsimth repo

It's that simple to get started with Conan on Cloudsmith

In Conclusion

Cloudsmith provides fully featured Conan package repositories on all plans, flexible enough for use whether you’re hosting public packages for a public or open-source project, or private packages for your company’s internal needs. We're extremely proud to be able to support the C/C++ ecosystem with this tooling.

You can find further, context-specific information, including detailed setup and integration instructions inside each Cloudsmith repository.

Why wait? Get your public and private Conan package repository hosting at Cloudsmith now.

Top comments (0)