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...
Conan is an open-source package manager for C/C++ including everything from its client to server implementation and even its documentation. It is actively developed on GitHub by an awesome community of contributors and a team of engineers working full time on it.
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 populate programming languages on Github for 2019, demonstrating the C/C++ community's longevity.
Conan is an excellent choice as a package manager as it provides the flexibility developers crave in a developer tool. It uses Python based package recipes for extensibility, customisation and integration with other systems. It 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 to other teams.
- Distribute and deploy your packages in a pipeline at your organisation
- 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 organisation, 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.
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](https://docs.conan.io/en/latest/installation.html#) 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
If you see something like the above, you're ready to go!
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 .
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 organisation in which you are a member.
$ conan remote add cloudsmith-testing-public 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
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 not ready to upload your package:
conan upload hello/0.0.1 --all -r cloudsmith-testing-public
Once uploaded, you can view your package in Cloudsmith.
It's that simple to get started with Conan on Cloudsmith.
Find our official guide to setting up a Conan repository on Cloudsmith.
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.
Liked this article? Don\'t be selfish (:-), share with others: Tweet