Conan (C++)
Conan is a binary management system for C++ that allows retrieval of precompiled binaries usable by different compilers and platforms, as well as the ability to build from sources when a precompiled binary is not available.
While Conan does not have self-describing package files like most packaging systems, its recipes are roughly analogous to packages in ProGet.
A Conan feed in ProGet acts like a private Conan repository where you can store your own recipes/packages. You can also create connectors to Conan Center and other Conan V2 repositories that let you use third-party recipes through your Conan feed and create a curated list of approved packages.
Conan feeds are available in ProGet 2024.22+.
Prerequisites: Build Profile
Before installing packages you will need to configure a build profile. You can create a default profile with the conan profile detect
command or specify your own profile with --profile:build=«myprofile»
Adding a Conan feed as a Remote
Before installing or publishing a recipe to your ProGet Conan feed, you will need to add your feed as a remote:
$ conan remote add «remote-name» https://«proget-server»/conan/«feed-name»/
If you are using a self-signed certificate with ProGet, you will also need to add the --insecure
argument:
$ conan remote add «remote-name» https://«proget-server»/conan/«feed-name»/ --insecure
Proxy All Conan Requests Through ProGet
When you add another remote to Conan, it will still use Conan Center unless you explicitly disable it. This would allow developers to still install packages directly from Conan Center. To make sure all requests are made to your ProGet feed instead, disable Conan Center:
$ conan remote disable conancenter
Authenticated Feeds
If your require authentication, Conan will prompt for login credentials, or you can explicitly log in using the conan remote auth
command.
When prompted for a user name and password, it's possible to use your ProGet username and password for authentication. However we highly recommend Creating a ProGet API Key for authentication purposes, using api
as the username and the API key as the password.
Creating and Publishing Packages
Unlike many other packaging system, Conan does not have self-contained archive files. Instead, you use Conan to create a package in your local cache, and then you publish that recipe to an external repository like ProGet.
Creating and publishing Conan packages to ProGet is covered in HOWTO: Create and Publish Conan Packages to a Private Repository in ProGet. You can also follow the Creating Packages tutorial in the official documentation for more detail.
Publishing Packages to ProGet
Once you have created a package in your local cache, you can publish it to ProGet using the conan upload
command:
$ conan upload -r «remote-name» «package-name»
Due to the complexity of the Conan package model, you cannot use any other tools to upload packages, only the Conan CLI.
Installing Packages from a ProGet Feed
To install packages from a Conan feed created in ProGet, use the install
command:
$ conan install --requires=«package-name»/«version» -r=«remote-name»
Technical Limitations
- ProGet only implements the Conan V2 API. Conan V1 has been deprecated for some time and is no longer supported by the Conan CLI. If V1 is something you would be interested in seeing implemented, we'd love to hear your feedback on our Community Forums
- The Conan API does not have the capability to list metadata remotely, so ProGet does not show connector results while browsing Conan feeds in the ProGet UI. However, connectors fully support proxying or caching, so if you have your feed configured to cache connector packages, they will be added to your feed as they are used.
- Since Conan doesn't exactly have package files, the drop path import function only works with files stored in a very specific directory structure that mimics how ProGet stores Conan files - this allows you to import from another ProGet feed or instance if necessary.