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.
- Clone your fork
- Setup your environment
- Basic Commands
- Debugging Failed Builds
- Running the Python Linters
- Running the YAML Linters
- Testing the different
test__package
- Testing more environments
- Follow the GitHub UI to fork this repository
- Clone your fork
- Install a C++ development toolchain - ConanCenter's build images are available
- Install the Conan client - make sure to keep it up to date!
- 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
.
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
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"
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.
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
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:
- Creating a new profile.
- You can also download them from CCI build summary
- 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
The Conan Center Index uses Conan Docker Tools to build packages in a variety of environments. All images are hosted in Docker Hub.