-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Home
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.
Make sure you are using the latest Conan client version, the recipes might evolve introducing features of the newer Conan releases.
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.
- Fork this repository on github
- Install the
conan-index-tools
:
pip install conan-index-tools
- Create a clean branch:
git checkout -b feature/my_recipe
- Note: You can submit only 1 recipe per pull request.
- 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 atest_package
folder for the recipe. Remember to adjust thesource()
method to get the download URL from the self.conan_data:
- Run
def source(self):
tools.get(**self.conan_data["sources"][self.version])
-
Test the recipe locally:
- Install the
conan-center
hook:
$ cit setup
(You can disable it later withcit 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
- Install the
-
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
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 -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.
Go to the Error Knowledge Base page to know more.