Skip to content

Latest commit

 

History

History
98 lines (63 loc) · 4.74 KB

developing_recipes_locally.md

File metadata and controls

98 lines (63 loc) · 4.74 KB

Developing Recipes Locally

Before you can contribute any code changes, you'll need to make sure you are familiar with the Conan client and have an environment that is conducive to developing recipes.

This file is intended to provide all the commands you need to run in order to be an expert ConanCenterIndex contributor.

Contents

Clone your fork

  1. Follow the GitHub UI to fork this repository
  2. Clone your fork

Setup your environment

  1. Install a C++ development toolchain - ConanCenter's build images are available
  2. Install the Conan client - make sure to keep it up to date!
  3. Install CMake - this is the only tool which is assumed to be present see FAQ for details.

Note: It's recommended to use a dedicated Python virtualenv when installing with pip.

Basic Commands

We recommend working from the recipes/project folder itself. You can learn about the recipe file structure to understand the folder and files located there.

Note: You can only change one recipe per pull request, and working from the recipe folder will help prevent making a few mistakes. The default for this folder is all, follow the link above to learn more.

The entire workflow of a recipe can be executed with the conan create. This should look like:

  • conan create all/conanfile.py --version=0.1.0

Try it yourself

For instance you can create packages for fmt in various supported configurations by running:

cd recipes/fmt
conan create all/conanfile.py --version=9.0.0
conan create all/conanfile.py --version=9.0.0 -o "&:header_only=True"
conan create all/conanfile.py --version=9.0.0 -s build_type=Debug -o "*/*:shared=True"

Debugging Failed Builds

Some common errors related to Conan can be found on troubleshooting section.

Instructions for using these images can be found in Testing more environments section.

In ConanCenterIndex, the most common failure point is upstream build scripts tailored to their specific use cases. It's not uncommon to patch build scripts but make sure to read the patch policy. You are encouraged first to submit pull requests upstream.

Testing

This can be selected when calling conan create or separately with conan test

# Passing test package's conanfile directly (make sure to export first)
conan test recipes/fmt/all/test_package/conanfile.py fmt/9.0.0

Testing more environments

This can be difficult for some platforms given virtualization support.

For Windows and MacOS users, you can test the Linux build environments with the Docker build images.

Assuming you've already tested it locally and it's been successfully exported to your cache, you can:

  1. Creating a new profile.
    • You can also download them from CCI build summary
  2. Build missing packages

Please, read how to create Conan package using a Docker runner.

Note: If you are running on Mac M1, the follow Docker argument is required: --platform=linux/amd64

If you are working with packages that have system dependencies that are managed by Conan

Docker build images used by ConanCenterIndex

The Conan Center Index uses Conan Docker Tools to build packages in a variety of environments. All images are hosted in Docker Hub.