Skip to main content

conan-quickstart

Last updated on

Prerequisites

  • Ensure you have the Conan CLI (conan) installed on your local machine.
  • Access to a Harness account with appropriate permissions to create registries and connectors.

Create a Conan artifact registry

private registry

This registry will serve as your private Conan registry within Harness.


Configure an Upstream Proxy (Optional)

An upstream proxy allows your registry to fetch Conan packages from external sources if they are not available locally.

Create an upstream proxy


Configure the upstream proxy in your registry

upstream proxy caching

If a Conan package is not found in your Harness registry, the upstream proxy can fetch it from an external source like Conan Center, helping to reduce duplication and ensure reliable access to public packages.


Conan packages use the recipe reference name/version@user/channel (for example <ARTIFACT_NAME>/<VERSION>@<USER>/<CHANNEL>). Drill down in this order:

  1. Registry → Packages: open a package from the list.
  2. Versions: each row is a version and user/channel pair. Expand a row to list recipe revisions (RREV), then open one to reach Artifact Details.
  3. Artifact Details: use the header dropdowns to switch version, channel, or recipe revision.

Files vs Packages

Conan stores files and binaries for each recipe revision. Harness shows them on separate tabs in Artifact Details:

Files (recipe revision): The recipe and exported sources for name/version@user/channel#rrev. This tab answers "what is the recipe?"

  • conanfile.py: the Conan recipe that defines build steps and dependencies.
  • conan_sources.tgz: source files exported with the recipe.
  • conanmanifest.txt: checksum manifest for the recipe files.

Copy MD5, SHA1, SHA256, or SHA512 checksums, or download individual recipe files from this tab.

Packages (binary packages): Prebuilt binaries for that recipe revision. This tab answers "which builds exist for this recipe?"

Each row is a package ID: one binary for a specific settings profile (OS, compiler, architecture, build type) and options (such as shared and fPIC). The latest PREV column shows the latest package revision for that binary.

TabConan termWhat you see
FilesRecipe revision (RREV)Recipe, sources, and manifest
PackagesPackage ID and package revision (PREV)Built binaries per configuration

Full binary reference format:

<ARTIFACT_NAME>/<VERSION>@<USER>/<CHANNEL>#<RREV>:<PACKAGE_ID>#<PREV>

Readme and Dependencies show readme content and the dependency graph for the selected recipe revision when available.

Go to Artifact management to download at the package, version, or file level.


Publish & Install Conan Packages

Configure authentication

An identity token serves as the password for the Conan remote.

  1. In your Harness Conan Artifact Registry, click Set Up Client and generate an identity token.
  2. Add the registry as a Conan remote:
conan remote add <REMOTE_NAME> https://pkg.harness.io/pkg/<ACCOUNT_ID>/<REGISTRY_NAME>/conan
  1. Authenticate with your identity token:
conan remote login <REMOTE_NAME> <your-email@harness.io> -p <TOKEN>

Publish a package

Build the package locally:

conan create .

Upload it to the registry. Include the user and channel from your conanfile.py:

conan upload <ARTIFACT_NAME>/<VERSION>@<USER>/<CHANNEL> -r <REMOTE_NAME> --confirm

Install a package

Install a package from the registry:

conan install --requires=<ARTIFACT_NAME>/<VERSION>@<USER>/<CHANNEL> -r <REMOTE_NAME>