Skip to content
Javier G. Sogo edited this page Sep 2, 2019 · 26 revisions

Conan Center Index Repository

IMPORTANT: The conan-center-index is in private Beta stage, your Github username needs to be whitelisted in the system, otherwise the PR won't build the packages. You can request access to the public Beta opening an issue.

The conan-center-index (this repository) contains recipes for the conan-center repository.

To contribute with a Conan recipe into the conan-center repository you can submit a Pull Request to the master branch of this repository. The connected continuous integration system will generate the binary packages automatically.

The CI system will also report with messages in the PR any error in the process, even linking to the logs to see more details and debug.

Currently, the Bintray conan-center repository, contains recipes and packages contributed using the inclusion request mechanism of the Bintray platform. All the package recipes will be adapted and migrated to this new flow based on a Pull Request.

The references of the recipes won't contain the user/channel part. You will be able to install them specifying only library_name/version as a requirement, omitting the @user/channel part. (Conan >= 1.18).

This process of contributing to the conan central repository is much easier for the community, previously it was needed to set up the CI services like Travis, Appveyor or Azure to contribute on Bintray with the binary packages, now, the connected CI system will do all the work out of the box. You only need to open a pull request with a recipe following some simple rules.

How to submit a Pull Request

Requirements

Make sure you are using the latest Conan client version, the recipes might evolve introducing features of the newer Conan releases.

Quick way

The easier way is to install the conan-index-tools package that will create for us the needed files and folders for the new recipe.

  1. Fork this repository on github
  2. Install the conan-index-tools:
pip install conan-index-tools
  1. Create a clean branch:
    • git checkout -b feature/my_recipe
    • Note: You can submit only 1 recipe per pull request.
  2. Create a new recipe or a version:
    • Run cit new . and follow the wizard. (The "." is the folder with the checkout of the fork)
    • Edit or create the conanfile.py and a test_package folder for the recipe. Remember to adjust the source() method to get the download URL from the self.conan_data:
def source(self):
    tools.get(**self.conan_data["sources"][self.version])
  1. Test the recipe locally:

    • Install the conan-center hook:

    $ cit setup (You can disable it later with cit setup --clean)

    • To create a package for your default configuration:

    $ cit run . lib/1.0

    • To create a package for another configuration:

    $ cit run . lib/1.0 --profile path/to/profile

  2. Submitting a Pull Request to the master branch. You will receive some messages from the CI system about errors or success. Once the build is green, the Pull Request will be reviewed, feedback provided and eventually merged.

Sometimes the CI will post a message reporting that some of the configurations failed, for example, a build on Linux x86. You will find a link to the profile that failed. You can use the cit run . lib/1.0 --profile_url xxx.

   `$ cit run . lib/1.0` --profile_url https://xxxx 

Manual way

You can do all the process manually, without any tool, take a look at the Index folder structure page to know the needed files in a Pull Request.

To try your recipe locally you can:

  • Install the hook manually:
    $ conan config install https://github.com/conan-io/hooks.git -sf hooks -tf hooks
    $ conan config set hooks.conan-center
  • Export the env var CONAN_HOOK_ERROR_LEVEL=40 in order to fail if an error from the hook is reported.
  • Call conan create lib/1.0@cbot/stable in the folder of the recipe using the profile you want to test.

Debugging failed builds

Go to the Error Knowledge Base page to know more.

Clone this wiki locally