Conan - The open-source C/C++ package manager

Logo

Conan

Decentralized, open-source (MIT), C/C++ package manager.

Conan is a package manager for C and C++ developers:

  • It is fully decentralized. Users can host their packages on their servers, privately. Integrates with Artifactory and Bintray.
  • Portable. Works across all platforms, including Linux, OSX, Windows (with native and first-class support, WSL, MinGW), Solaris, FreeBSD, embedded and cross-compiling, docker, WSL
  • Manage binaries. It can create, upload and download binaries for any configuration and platform, even cross-compiling, saving lots of time in development and continuous integration. The binary compatibility can be configured and customized. Manage all your artifacts in the same way on all platforms.
  • Integrates with any build system, including any proprietary and custom one. Provides tested support for major build systems (CMake, MSBuild, Makefiles, Meson, etc).
  • Extensible: Its python based recipes, together with extensions points allows for great power and flexibility.
  • Large and active community, especially in Github (https://github.com/conan-io/conan) and Slack (https://cpplang-inviter.cppalliance.org/ #conan channel). This community also creates and maintains packages in ConanCenter and Bincrafters repositories in Bintray.
  • Stable. Used in production by many companies, since 1.0 there is a commitment not to break package recipes and documented behavior.
develop Code Climate
Build Status Develop Develop climate

Setup

Please read https://docs.conan.io/en/latest/installation.html to know how to install and start using Conan. TL;DR:

$ pip install conan

Install a development version

You can run Conan client and server in Windows, MacOS, and Linux.

  • Install pip following pip docs.

  • Clone Conan repository:

    $ git clone https://github.com/conan-io/conan.git conan-io
NOTE: repository directory name matters, some directories are known to be problematic to run tests (e.g. conan). conan-io directory name was tested and guaranteed to be working.
  • Install in editable mode

    $ cd conan-io && sudo pip install -e .

    If you are in Windows, using sudo is not required.

  • You are ready, try to run Conan:

    $ conan --help
    
    Consumer commands
      install    Installs the requirements specified in a conanfile (.py or .txt).
      config     Manages configuration. Edits the conan.conf or installs config files.
      get        Gets a file or list a directory of a given reference or package.
      info       Gets information about the dependency graph of a recipe.
      search     Searches package recipes and binaries in the local cache or in a remote.
    Creator commands
      new        Creates a new package recipe template with a 'conanfile.py'.
      create     Builds a binary package for a recipe (conanfile.py) located in the current dir.
      upload     Uploads a recipe and binary packages to a remote.
      export     Copies the recipe (conanfile.py & associated files) to your local cache.
      export-pkg Exports a recipe & creates a package with given files calling 'package'.
      test       Test a package, consuming it with a conanfile recipe with a test() method.
    Package development commands
      source     Calls your local conanfile.py 'source()' method.
      build      Calls your local conanfile.py 'build()' method.
      package    Calls your local conanfile.py 'package()' method.
    Misc commands
      profile    Lists profiles in the '.conan/profiles' folder, or shows profile details.
      remote     Manages the remote list and the package recipes associated with a remote.
      user       Authenticates against a remote with user/pass, caching the auth token.
      imports    Calls your local conanfile.py or conanfile.txt 'imports' method.
      copy       Copies conan recipes and packages to another user/channel.
      remove     Removes packages or binaries matching pattern from local cache or remote.
      alias      Creates and exports an 'alias recipe'.
      download   Downloads recipe and binaries to the local cache, without using settings.
    
    Conan commands. Type "conan  -h" for help
    

Contributing to the project

Feedback and contribution are always welcome in this project. Please read our contributing guide. Also, if you plan to contribute, please add some testing for your changes. You can read the Conan tests guidelines section for some advise on how to write tests for Conan.

Running the tests

Using tox

$ python -m tox

It will install the needed requirements and launch pytest skipping some heavy and slow tests. If you want to run the full test suite:

$ python -m tox -e full

Without tox

Install python requirements

$ python -m pip install -r conans/requirements.txt
$ python -m pip install -r conans/requirements_server.txt
$ python -m pip install -r conans/requirements_dev.txt

If you are not Windows and you are not using a python virtual environment, you will need to run these commands using sudo.

Before you can run the tests, you need to set a few environment variables first.

$ export PYTHONPATH=$PYTHONPATH:$(pwd)

On Windows it would be (while being in the Conan root directory):

$ set PYTHONPATH=.

Ensure that your cmake has version 2.8 or later. You can see the version with the following command:

$ cmake --version

The appropriate values of CONAN_COMPILER and CONAN_COMPILER_VERSION depend on your operating system and your requirements.

These should work for the GCC from build-essential on Ubuntu 14.04:

$ export CONAN_COMPILER=gcc
$ export CONAN_COMPILER_VERSION=4.8

These should work for OS X:

$ export CONAN_COMPILER=clang
$ export CONAN_COMPILER_VERSION=3.5

You can run the actual tests like this:

$ python -m pytest .

There are a couple of test attributes defined, as slow that you can use to filter the tests, and do not execute them:

$ python -m pytest . -m "not slow"

A few minutes later it should print OK:

............................................................................................
----------------------------------------------------------------------
Ran 146 tests in 50.993s

OK

To run specific tests, you can specify the test name too, something like:

$ python -m pytest conans/test/unittests/client/cmd/export_test.py::ExportTest::test_export_warning -s

The -s argument can be useful to see some output that otherwise is captured by pytest.

Also, you can run tests against an instance of Artifactory. Those tests should add the attribute artifactory_ready.

$ python -m pytest . -m artifactory_ready

Some environment variables have to be defined to run them. For example, for an Artifactory instance that is running on the localhost with default user and password configured, the variables could take the values:

$ export CONAN_TEST_WITH_ARTIFACTORY=1
$ export ARTIFACTORY_DEFAULT_URL=http://localhost:8081/artifactory
$ export ARTIFACTORY_DEFAULT_USER=admin
$ export ARTIFACTORY_DEFAULT_PASSWORD=password

ARTIFACTORY_DEFAULT_URL is the base url for the Artifactory repo, not one for a specific repository. Running the tests with a real Artifactory instance will create repos on the fly so please use a separate server for testing purposes.

License

MIT LICENSE

Owner
Conan.io
Conan Package and Dependency Manager
Conan.io
Comments
  • Package revisions

    Package revisions

    Most package managers have a concept of package revision, i.e. additional version number that reflects changes in packaging scripts or applied patches when "main" version number of packaged software remains the same.

    It would be great if Conan added support for revisions too. This will make package updates more trasparent ("updated from vX.Y.Z-r1 to vX.Y.Z-r2"). Also there could be a policy that "stable" channel can never change conanfile and binaries without bumping revision, to prevent accidental changes in packages used in CI with manifest verification.

    It would be great if it was possible to keep binary packages for previous revisions so that CI system with manifests checking does not get broken in case new revision is uploaded without committing new reference manifests.

    It was previously briefly discussed at https://github.com/conan-io/conan/issues/480#issuecomment-247545547

  • Warning in CMake file created by conan

    Warning in CMake file created by conan

    Hi guys,

    This is not causing me any problems as such, but I thought I'd let you guys know. Noticed this on my build[1]:

    CMake Warning (dev) in build/output/conanbuildinfo.cmake:
      Syntax Warning in cmake code at
        /home/travis/build/DomainDrivenConsulting/dogen/build/output/conanbuildinfo.cmake:142:88
      Argument not separated from preceding token by whitespace.
    Call Stack (most recent call first):
      CMakeLists.txt:30 (include)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    

    Presumably conanbuildinfo.cmake is generated by Conan. Worth clearing up that warning...

    Cheers

    [1] https://travis-ci.org/DomainDrivenConsulting/dogen/jobs/107194308

  • "Please log in to "conan-center" to perform this action." for several packages

    To help us debug your issue please explain:

    • [x ] I've read the CONTRIBUTING guide.
    • [x ] I've specified the Conan version, operating system version and any tool that can be relevant.
    • [x ] I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.

    Windows 10 amd64, Python 3.7.4, Conan 1.18.4 from pip within virtualenv

    I am working within conan-libpq-stable-11.4 directory, which is extracted libpq/11.4 from https://github.com/bincrafters/conan-libpq.

    My env:

    >echo %CONAN%
    C:\Users\Vincas\code\cpp\branches\upgrade\\3rdparty\Conan\_python_3.7.4_venv_conan_1.18.4\Scripts\conan.exe
    
    >%CONAN% --version
    Conan version 1.18.4
    

    I have conan_profile_windows.txt like this (for building libpq on Windows using CMake):

    include(default)
    [build_requires]
    cmake_installer/[email protected]/stable
    

    I run development flow commands:

    >%CONAN% source . -sf src
    
    >%CONAN% install . -if install -s "compiler=Visual Studio" -s compiler.version=14 -s arch=x86 -s arch_build=x86 --build=missing -p conan_profile_windows.txt
    

    But since I've added conan_installer as build depends, I get this output:

    >%CONAN% install . -if install -s "compiler=Visual Studio" -s compiler.version=14 -s arch=x86 -s arch_build=x86 --build=missing -p conan_profile_windows.txt
    Configuration:
    [settings]
    arch=x86
    arch_build=x86
    build_type=Release
    compiler=Visual Studio
    compiler.runtime=MD
    compiler.version=14
    os=Windows
    os_build=Windows
    [options]
    [build_requires]
    *: cmake_installer/[email protected]/stable
    [env]
    
    cmake_installer/[email protected]/stable: WARN: Package is corrupted, removing folder: C:\Users\Vincas\.conan\data\cmake_installer\3.15.3\conan\stable\package\60b04a80ac4dd5c23f1acffacc679e9902e636e5
    conanfile.py (libpq/11.4): Installing package
    Requirements
        zlib/[email protected]/stable from 'conan-center' - Cache
    Packages
        zlib/[email protected]/stable:1299b26cefc5e04411a3481abe1c8b63227e2896 - Cache
    Build requirements
        cmake_installer/[email protected]/stable from 'conan-center' - Cache
    Build requirements packages
        cmake_installer/[email protected]/stable:60b04a80ac4dd5c23f1acffacc679e9902e636e5 - Download
    
    cmake_installer/[email protected]/stable: Retrieving package 60b04a80ac4dd5c23f1acffacc679e9902e636e5 from remote 'conan-center'
    Please log in to "conan-center" to perform this action. Execute "conan user" command.
    If you don't have an account sign up here: https://bintray.com/signup/oss
    Remote 'conan-center' username:
    

    I assume it should work without accounts for fetching recipes..?

  • "Case insensitive filesystem can't manage this"

    I tried to install OpenCV3 as a dependency and found OpenCV/[email protected]/stable, which I added to my requires section.

    There was no package available for my platform (Windows 10, Visual C++ 2015 32-bit), so I went with --build missing. The build seems to have run to completion, but right at the end, I got:

    ERROR: Requested 'OpenCV/[email protected]/stable' but found case incompatible 'opencv'
    Case insensitive filesystem can't manage this
    

    (I tried other OpenCV packages, but they all had problems of one sort or another. I think this one is the most promising, if I can find a solution to the above problem.)

  • [bug] conan.bintray.com has invalid/no certificate and fails in redirection loop

    [bug] conan.bintray.com has invalid/no certificate and fails in redirection loop

    Steps to reproduce (Include if Applicable)

    Since this morning (12.04.2021) I can't connect to https://conan.bintray.com/ successfully. One problem is that it seems there is no valid server certificate on the server side. After disabling verify_ssl in the remotes there will be an exception because of too many redirects:

    ERROR: Exceeded 30 redirects.. [Remote: conan-center]
    

    Same error can be reproduced by open the URL via the webbrowser of your choice.

    Is this because of the shutdown for bintray? Isn't this dated to 1st May?

  • Feature/environment propagate

    Feature/environment propagate

    Changelog: Feature: New environment management, with correct value capturing and restoring on deactivate Docs: https://github.com/conan-io/docs/pull/2060

    New approach to environment (env-vars) management:

    VirtualEnv

    • New generator that will generate buildenv.xxx and runenv.xxx
    • Collects info from dependencies visiting the graph, not by the accumulated deps_env_info
    • It also collects information from profiles
    • It automatically collects runtime information based on cpp_info definition: exes, bin-paths, lib_paths to define PATH, LD_LIBRARY_PATH, DYLD_LIBRARY_PATH envvars

    ConanfileDependencies

    • Entry point in each recipe to visit its dependencies
    • Access to dependencies conanfiles is restricted by a "read-only" conanfilewrapper

    CMakeGen

    • Proof of concept of an aggregated meta-generator that includes CMakeToolchain, CMakeDeps and VirtualEnv
    • CMake build helper will integrate calls to VirtualEnv generated files
  • Incorrect handling of MSVC versions

    Incorrect handling of MSVC versions

    I am using Conan v1.7.4.

    I've created a static library Conan package using VS 2017 15.7 and updated my Visual Studio to 15.8. After the update, Conan failed to detect a change in the compiler version and did not perform recompilation of the static library. Instead, it just downloaded the same package that was built with VS 2017 15.7. However, when linking to that package from VS 2017 15.8, I am getting following linker error:

    LINK : fatal error C1047: The object or library file 'C:\Users\dodo\.conan\data\LogAndTimer\1.0.1\microblink\stable\package\8b2772668ccbf879d34a70a9d54c78ce70f38a1b\lib\LogAndTimer.lib' was created with an older compiler than other objects; rebuild old objects and libraries
    2>LINK : fatal error LNK1257: code generation failed
    

    However, the debug build does work (details how to reproduce are below).

    I think the problem is in how Conan handles MSVC versions - instead of using the actual compiler version (CMake detects MSVC 19.14.26431.0 in VS 2017 15.7 and MSVC 19.15.26729.0 in VS 2017 15.8), it uses the version of Visual Studio (VS 2017 is compiler version 15, according to Conan).

    I suggest that Conan should use the MSVC compiler version under compiler.version setting and additionally have compiler.vs_version for Visual Studio version. The reason for that is that sometimes libraries built with one version of MSVC are not compatible with later versions of MSVC, especially if you use link time code generation flag (/LTCG link flag and /GL compile flag).

    How to reproduce

    • Install Visual Studio 2017, but not the latest update (at the time of writing, this is 15.8.4). For example, use VS 2017 15.7.x or 15.6.x.
    • Create a conan package that contains a single static library. Make sure that Release build type of that package is compiled with /GL compile flag.
    • Create an application that consumes that static library and make sure it works in Release build type (the app should be linked with /LTCG linker flag).
    • Update Visual Studio 2017 to the latest version (15.8.4 at the time of writing).
    • Build your application

    Expected behaviour

    • conan install after updating the VS should calculate different hash for the library and should rebuild it, thus making sure application linking will succeed

    Actual behaviour

    • Conan does not detect version change in the MSVC compiler and uses the incompatible binary, thus causing linker error described above.

    Now, the main question is - could this be fixed without breaking existing conan VS packages, or we need to wait for Conan 2.0 (and disable LTCG until this issue gets fixed).

    Also, as a side question, is there a possibility to configure Conan to trigger rebuild of libraries even when a minor/bugfix version of the compiler changes, regardless of the compiler being used (e.g. if we update GCC from 8.1.0 to 8.1.1, we would like to rebuild all our binaries, even though they are link-compatible). This would get us the benefits of always having binaries built with the latest compiler to get the latest bugfixes and performance improvements - this benefit is also mentioned in conan documentation:

    What happens if we have a library that we can be built with GCC 4.8 and will preserve the ABI compatibility with GCC 4.9? (This kind of compatibility is easier to achieve for example for pure C libraries).

    Although it could be argued that it is worth rebuilding with 4.9 too -to get fixes and performance improvements-. Let’s suppose that we don’t want to create 2 different binaries, but just a single built with GCC 4.8 which also needs to be compatible for GCC 4.9 installations.

  • Better Python code reuse

    Better Python code reuse

    Currently, it is possible to reuse Python code by requiring it and tools.pythonpath. This is a bit limited because it's not possible to import the module before the ConanFile is loaded, which makes it impossible to do some things (such as subclassing ConanFile). I tried with a profile as well:

    [build_requires]
    mypymodule/[email protected]/stable
    

    .. but this doesn't work either. Maybe it would make sense for build_requires in profiles to be parsed before the conanfile is loaded. Or a separate, special section just for python deps of the conanfile. Is there a better way? What are your thoughts?

  • pkg-config for dependency detection

    pkg-config for dependency detection

    While working on some packages I have run into a problem with some configure scripts that relies only on pkg-config to find it's dependencies (i.e. just setting CFLAGS doesn't help it find the dependency). I started by hacking in support for setting PKG_CONFIG_PATH in ConfigureEnvironment like:

    diff --git a/conans/client/configure_environment.py b/conans/client/configure_environment.py
    index cc67480..84953e3 100644
    --- a/conans/client/configure_environment.py
    +++ b/conans/client/configure_environment.py
    @@ -27,6 +27,7 @@ class ConfigureEnvironment(object):
             """
             command = ""
             if self.os == "Linux" or self.os == "Macos":
    +            pkgconfigpath = 'PKG_CONFIG_PATH="%s"' % ":".join(self._deps_cpp_info.lib_paths)
                 libs = 'LIBS="%s"' % " ".join(["-l%s" % lib for lib in self._deps_cpp_info.libs])
                 archflag = "-m32" if self.arch == "x86" else ""
                 ldflags = 'LDFLAGS="%s %s"' % (" ".join(["-L%s" % lib
    @@ -55,7 +56,7 @@ class ConfigureEnvironment(object):
                                                         debug, include_flags)
                 include_paths = ":".join(['"%s"' % lib for lib in self._deps_cpp_info.include_paths])
                 headers_flags = 'C_INCLUDE_PATH=%s CPP_INCLUDE_PATH=%s' % (include_paths, include_paths)
    -            command = "env %s %s %s %s %s" % (libs, ldflags, cflags, cpp_flags, headers_flags)
    +            command = "env %s %s %s %s %s %s" % (libs, ldflags, cflags, cpp_flags, headers_flags, pkgconfigpath)
             elif self.os == "Windows" and self.compiler == "Visual Studio":
                 cl_args = " ".join(['/I"%s"' % lib for lib in self._deps_cpp_info.include_paths])
                 lib_paths = ";".join(['"%s"' % lib for lib in self._deps_cpp_info.lib_paths])
    

    and then making sure that I copied the .pc files into to the lib directory. This worked fine and the packages was now found. The problem is that the .pc file "lies" and doesn't point to the $HOME/.conan/data/[dependency]... path but rather to /usr/local or whatever the default prefix is. This lead to another problem where it picked up the wrong library (on in /usr/local instead of ~/.conan).

    So now I wonder if this can be done even better. Since we have information in package_info about what to link and the include directories etc we could write our own .pc file and point it to the right directory and we could add it to ~/.conan/data/pkg-config or something and it could have a .pc file for all installed packages.

    Is this something we want to do? And in that case where should this code be added, it has to be done somewhere where the final package path is resolved and that the pc file is regenerated if we get a new path.

  • Issues with proxies

    Issues with proxies

    I've started Conan server in my organization's local network. For external sites (like github) proxy must be used, but not for computers in local network. So, I have there env variables:

    HTTP_PROXY=http://proxy.domain:3128
    HTTP_PROXY=https://proxy.domain:3128
    NO_PROXY=localhost,127.0.0.1,*.domain,192.168.*
    

    With these variables I can create packages with recipes in my local cache (and this recipes can download external sources), but cannot download recipes and prebuilt packages from organization's Conan server.

    I've tried to set same settings in conan.conf, but had no luck. Also I've tried to use Conan server domain name and/or IP address in NO_PROXY with same result:

    > conan search -r <remotename> "OpenCV*"
    ERROR: Permission denied for user: '<username>'. [Remote: <remotename>]
    

    But if I disable all proxies (comment in conan.conf and unset env variables), it works just fine:

    Existing package recipes:
    
    OpenCV/[email protected]/testing
    

    Conan v. 1.0.1, OS: Arch Linux, CentOS 6, Windows 10.

  • [bug] cmake generator does not write build requirements info when using dual profiles

    [bug] cmake generator does not write build requirements info when using dual profiles

    Environment Details (include every applicable attribute)

    • Operating System+version: macOS Big Sur
    • Conan version: develop (1.33.0-dev)
    • Python version: 3.8.5

    Steps to reproduce (Include if Applicable)

    With this conanfile.py:

    from conans import ConanFile, CMake, tools
    
    
    class BugConan(ConanFile):
        name = "bug"
        version = "0.1"
        license = "<Put the package license here>"
        author = "<Put your name here> <And your email here>"
        url = "<Package recipe repository url here, for issues about the package>"
        description = "<Description of Bug here>"
        topics = ("<Put some tag here>", "<here>", "<and here>")
        settings = "os", "compiler", "build_type", "arch"
        options = {"shared": [True, False], "fPIC": [True, False]}
        default_options = {"shared": False, "fPIC": True}
        generators = "cmake"
    
        def config_options(self):
            if self.settings.os == "Windows":
                del self.options.fPIC
    
        def build_requirements(self):
            self.build_requires("doctest/2.3.8")
    
        def source(self):
            pass
    
        def build(self):
            pass
    
        def package(self):
            pass
    
        def package_info(self):
            pass
    

    Run conan install . --profile:host=default --profile:build=default

    The generated conanbuildinfo.cmake does not contain doctest targets, but it does when conan install . --profile=default is used.

  • Fixing cmake_layout single config

    Fixing cmake_layout single config

    Changelog: Bugfix: Make cmake_layout to use single-config folder for generated files Docs: https://github.com/conan-io/docs/pull/XXXX

    Close https://github.com/conan-io/conan/issues/12827

  • Feature/develop2 restapi parallel download

    Feature/develop2 restapi parallel download

    • Follow-up from https://github.com/conan-io/conan/pull/5502, trying to speed up installation of dependencies with threads (measured in my machine speed-up of 20-30%)
    • Minor cleanings of some traces and output, for example, not printing "Downloading xxx" for every file, even small ones, only for those > 1Mb
  • [bug] conan_toolchain.cmake is shared by both build_types

    [bug] conan_toolchain.cmake is shared by both build_types

    Environment details

    • Operating System+version: Linux 6.1.1-1-MANJARO
    • Compiler+version: N/A
    • Conan version: 1.56
    • Python version: 3.10.8
    • CMake 3.24.2

    Steps to reproduce

    1. create a CMakeLists.txt with an option
    2. enable that option based on build_type in the conanfile
    3. run the conan install for both buildtypes conan install ... && conan install ... -s build_type=Debug
    4. Spend half an hour wondering why the cmake expression generator which is assigned to that option keeps on having the same value.
    5. Observe the CMakePresets.json and notice that the conan_toolchain.cmake is used by both ConfigurePresets.
    6. Observe the value of the option specified in the CMakeLists.txt haveing that same value.

    Logs

    No response

  • [bug] PATH inconsistent in test package method between one and two profiles

    [bug] PATH inconsistent in test package method between one and two profiles

    Environment details

    • Conan version: 1.56.0

    I am trying to migrate to two profiles, and facing problems with our test packages in the process. Paths set with self.env_info.PATH are not set in the test() method of the test package any more.

    conanfile.py

    from conans import ConanFile
    import os
    
    class TestConan(ConanFile):
        name = "testtest"
        version = "latest"
    
        def package_info(self):
            self.env_info.PATH.append(os.path.join(self.package_folder, "test", "bin"))
    

    test_package/conanfile.py

    from conans import ConanFile
    import os
    
    class TestTestConan(ConanFile):
        def test(self):
            print(os.environ['PATH'])
    

    Steps to reproduce

    Create a new Conan package with the given test package, and call conan create just with a single profile, then repeat the process with two profiles.

    Logs

    conan create conanfile.py -pr=default
    ...
    testtest/latest (test package): Running test()
    D:\Conan\Cache2profiles\testtest\latest\_\_\package\4068d26db0f235082dbcdd6f303d1cbf4d149cf1\test\bin;C:\Program Files\Eclipse Foundation\jdk-8.0.302.8-hotspot\bin;...
    

    While with two profiles, it is not part of the printed PATH.

    conan create conanfile.py -pr:b=default -pr:h=default
    ...
    testtest/latest (test package): Running test()
    C:\Program Files\Eclipse Foundation\jdk-8.0.302.8-hotspot\bin;...
    
  • [bug] tool_requires not captured in lockfile with `--reference` argument

    [bug] tool_requires not captured in lockfile with `--reference` argument

    Environment details

    • Conan version: 1.56.0

    It seems that conan lock create does not capture info about the build context if a --reference is given instead of a path to a Conan file. I'd expect the output of the lockfiles to be completely identical. But maybe this is not a bug, but my expectation is completely wrong.

    I have this simple testcase:

    import json
    import os
    
    from conans.model.graph_lock import GraphLockFile
    from conans.test.utils.tools import TestClient, GenConanfile
    
    profile = """
    [tool_requires]
    tool:pkga/[email protected]
    """ 
    
    def test_regular_package():
        client = TestClient()
        # TODO: This is hardcoded
        client.run("config set general.revisions_enabled=1")
        client.save({"pkga/conanfile.py":     GenConanfile(),
                     "tool/conanfile.py":    GenConanfile().with_requires("pkga/[>=1.0.0]"),
                     "app/conanfile.py":      GenConanfile().with_require("pkga/1.0.0").with_build_requires("tool/1.0.0"),
                     "myprofile": profile})    # version range in app
       
       
        # export different version from the libs to the cache         
        client.run("export pkga pkga/[email protected]")
        client.run("export tool tool/[email protected]") 
        client.run("export app  app/[email protected]")
    
        client.run("lock create --reference app/[email protected] --lockfile-out app-ref.lock  --profile=myprofile --profile:build=myprofile")
        client.run("lock create app/conanfile.py       --lockfile-out app-path.lock --profile=myprofile --profile:build=myprofile")
    

    Output app-ref.lock:

    {
     "graph_lock": {
      "nodes": {
       "1": {
        "ref": "app/1.0.0#1060c73d1197f6b245cef3cd7c87ac71",
        "options": "",
        "package_id": "7a295e38f67ab11f20e4d00c956ccbf105042b5d",
        "requires": [
         "2"
        ],
        "context": "host"
       },
       "2": {
        "ref": "pkga/1.0.0#f3367e0e7d170aa12abccb175fee5f97",
        "options": "",
        "package_id": "5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9",
        "context": "host"
       }
      },
      "revisions_enabled": true
     },
     "version": "0.4",
     "profile_host": "[settings]\n[options]\n[build_requires]\ntool: pkga/1.0.0\n[env]\n",
     "profile_build": "[settings]\n[options]\n[build_requires]\ntool: pkga/1.0.0\n[env]\n"
    }
    

    Output app-path.lock

    {
    "graph_lock": {
     "nodes": {
      "0": {
       "options": "",
       "requires": [
        "1"
       ],
       "build_requires": [
        "2"
       ],
       "path": "C:\\Users\\AppData\\Local\\Temp\\tmpenp7pbyzconans\\path with spaces\\app\\conanfile.py",
       "context": "host"
      },
      "1": {
       "ref": "pkga/1.0.0#f3367e0e7d170aa12abccb175fee5f97",
       "options": "",
       "package_id": "5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9",
       "context": "host"
      },
      "2": {
       "ref": "tool/1.0.0#a04bd171e1fdb2dfdd736aad73aedf92",
       "options": "",
       "package_id": "7a295e38f67ab11f20e4d00c956ccbf105042b5d",
       "requires": [
        "3"
       ],
       "context": "build"
      },
      "3": {
       "ref": "pkga/1.0.0#f3367e0e7d170aa12abccb175fee5f97",
       "options": "",
       "package_id": "5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9",
       "context": "build"
      }
     },
     "revisions_enabled": true
    },
    "version": "0.4",
    "profile_host": "[settings]\n[options]\n[build_requires]\ntool: pkga/1.0.0\n[env]\n",
    "profile_build": "[settings]\n[options]\n[build_requires]\ntool: pkga/1.0.0\n[env]\n"
    }
    

    Steps to reproduce

    No response

    Logs

    No response

  • [bug] cmake_generator configuration is not respected

    [bug] cmake_generator configuration is not respected

    Environment details

    • Operating System+version: Microsoft Windows 10 Pro 10.0.19045 Build 19045
    • Compiler+version: clang 15
    • Conan version: 1.56.0
    • Python version: 3.8.6

    Steps to reproduce

    1. Set cmake_generator
    conan config set general.cmake_generator=Ninja
    
    1. Run
    conan workspace install /path/to/conan-workspace.yml --build=missing --profile "/path/to/conan-clang-profile"
    

    For the bzip2/1.0.8 package, which is a dependency, I get the error

    CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
    

    I was expecting that everything will be build with Ninja as a CMake generator instead of MinGW Makefiles.

    In C:\Users\sogartary\.conan\data\bzip2\1.0.8\_\_\build\664a290ff8a4232d40ea8d66ae4e20ff2cb6ef7b\build\generators\CMakePresets.json the wrong generator is specified.

    Logs

    conan workspace install ../conan-workspace.yml --build=missing --profile ../conan-clang-debug-profile
    
    Configuration:
    [settings]
    arch=x86_64
    arch_build=x86_64
    build_type=Debug
    compiler=clang
    compiler.cppstd=20
    compiler.version=15
    os=Windows
    os_build=Windows
    [options]
    [build_requires]
    [env]
    CONAN_CMAKE_GENERATOR=Ninja
    boost/1.81.0: Not found in local cache, looking in remotes...
    boost/1.81.0: Trying with 'conancenter'...
    Downloading conanmanifest.txt completed [0.35k]
    Downloading conanfile.py completed [79.68k]
    Downloading conan_export.tgz completed [1.37k]
    Decompressing conan_export.tgz completed [0.00k]
    boost/1.81.0: Downloaded recipe revision 0
    zlib/1.2.13: Not found in local cache, looking in remotes...
    zlib/1.2.13: Trying with 'conancenter'...
    Downloading conanmanifest.txt completed [0.28k]
    Downloading conanfile.py completed [4.04k]
    Downloading conan_export.tgz completed [0.29k]
    Decompressing conan_export.tgz completed [0.00k]
    zlib/1.2.13: Downloaded recipe revision 0
    bzip2/1.0.8: Not found in local cache, looking in remotes...
    bzip2/1.0.8: Trying with 'conancenter'...
    Downloading conanmanifest.txt completed [0.17k]
    Downloading conanfile.py completed [4.26k]
    Downloading conan_export.tgz completed [0.24k]
    Decompressing conan_export.tgz completed [0.00k]
    bzip2/1.0.8: Downloaded recipe revision 0
    eigen/3.4.0: Not found in local cache, looking in remotes...
    eigen/3.4.0: Trying with 'conancenter'...
    Downloading conanmanifest.txt completed [0.10k]
    Downloading conanfile.py completed [3.20k]
    Downloading conan_export.tgz completed [0.25k]
    Decompressing conan_export.tgz completed [0.00k]
    eigen/3.4.0: Downloaded recipe revision 0
    nlohmann_json/3.11.2: Not found in local cache, looking in remotes...
    nlohmann_json/3.11.2: Trying with 'conancenter'...
    Downloading conanmanifest.txt completed [0.10k]
    Downloading conanfile.py completed [1.64k]
    Downloading conan_export.tgz completed [0.24k]
    Decompressing conan_export.tgz completed [0.00k]
    nlohmann_json/3.11.2: Downloaded recipe revision 0
    polymorphic_value/1.3.0: Not found in local cache, looking in remotes...
    polymorphic_value/1.3.0: Trying with 'conancenter'...
    Downloading conanmanifest.txt completed [0.10k]
    Downloading conanfile.py completed [2.73k]
    Downloading conan_export.tgz completed [0.26k]
    Decompressing conan_export.tgz completed [0.00k]
    polymorphic_value/1.3.0: Downloaded recipe revision 0
    b2/4.9.2: Not found in local cache, looking in remotes...
    b2/4.9.2: Trying with 'conancenter'...
    Downloading conanmanifest.txt completed [0.10k]
    Downloading conanfile.py completed [6.99k]
    Downloading conan_export.tgz completed [0.24k]
    Decompressing conan_export.tgz completed [0.00k]
    b2/4.9.2: Downloaded recipe revision 0
    Requirements
        boost/1.81.0 from 'conancenter' - Downloaded
        bzip2/1.0.8 from 'conancenter' - Downloaded
        eigen/3.4.0 from 'conancenter' - Downloaded
        nlohmann_json/3.11.2 from 'conancenter' - Downloaded
        polymorphic_value/1.3.0 from 'conancenter' - Downloaded
        zlib/1.2.13 from 'conancenter' - Downloaded
        modscheme_lib/0.1 from user folder - Editable
        modscheme_server/0.1 from user folder - Editable
    Packages
        boost/1.81.0:62c93f29b9f76c328a46007549cc459447eeb77b - Build
        bzip2/1.0.8:664a290ff8a4232d40ea8d66ae4e20ff2cb6ef7b - Build
        eigen/3.4.0:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Download
        nlohmann_json/3.11.2:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Download
        polymorphic_value/1.3.0:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Download
        zlib/1.2.13:01822c8126f3805e61534fa72215516497c36eb2 - Build
        modscheme_lib/0.1:27e502d47a8725d19299a32b559b4f6dd00ec394 - Editable
        modscheme_server/0.1:1a022cf2f8fb5768319a46ddef85fc367f8c90bd - Editable
    Build requirements
        b2/4.9.2 from 'conancenter' - Downloaded
    Build requirements packages
        b2/4.9.2:ca33edce272a279b24f87dc0d4cf5bbdcffbc187 - Download
    
    Installing (downloading, building) binaries...
    b2/4.9.2: Retrieving package ca33edce272a279b24f87dc0d4cf5bbdcffbc187 from remote 'conancenter'
    Downloading conanmanifest.txt completed [14.27k]
    Downloading conaninfo.txt completed [0.24k]
    Downloading conan_package.tgz completed [505.57k]
    Decompressing conan_package.tgz completed [0.00k]
    b2/4.9.2: Package installed ca33edce272a279b24f87dc0d4cf5bbdcffbc187
    b2/4.9.2: Downloaded package revision 0
    eigen/3.4.0: Retrieving package 5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 from remote 'conancenter'
    Downloading conanmanifest.txt completed [47.09k]
    Downloading conaninfo.txt completed [0.29k]
    Downloading conan_package.tgz completed [1433.41k]
    Decompressing conan_package.tgz completed [0.00k]
    eigen/3.4.0: Package installed 5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9
    eigen/3.4.0: Downloaded package revision 0
    nlohmann_json/3.11.2: Retrieving package 5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 from remote 'conancenter'
    Downloading conanmanifest.txt completed [3.73k]
    Downloading conaninfo.txt completed [0.27k]
    Downloading conan_package.tgz completed [148.87k]
    Decompressing conan_package.tgz completed [0.00k]
    nlohmann_json/3.11.2: Package installed 5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9
    nlohmann_json/3.11.2: Downloaded package revision 0
    polymorphic_value/1.3.0: Retrieving package 5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 from remote 'conancenter'
    Downloading conanmanifest.txt completed [0.24k]
    Downloading conaninfo.txt completed [0.27k]
    Downloading conan_package.tgz completed [2.76k]
    Decompressing conan_package.tgz completed [0.00k]
    polymorphic_value/1.3.0: Package installed 5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9
    polymorphic_value/1.3.0: Downloaded package revision 0
    Downloading conan_sources.tgz completed [0.59k]
    Decompressing conan_sources.tgz completed [0.00k]
    bzip2/1.0.8: Configuring sources in C:\Users\sogartary\.conan\data\bzip2\1.0.8\_\_\source\src
    Downloading bzip2-1.0.8.tar.gz completed [791.04k]                                       bzip2/1.0.8: 0.8:
    bzip2/1.0.8:
    bzip2/1.0.8: Copying sources to build folder
    bzip2/1.0.8: Building your package in C:\Users\sogartary\.conan\data\bzip2\1.0.8\_\_\build\664a290ff8a4232d40ea8d66ae4e20ff2cb6ef7b
    bzip2/1.0.8: Generator txt created conanbuildinfo.txt
    bzip2/1.0.8: Calling generate()
    bzip2/1.0.8: WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
    bzip2/1.0.8: Preset 'debug' added to CMakePresets.json. Invoke it manually using 'cmake --preset debug'
    bzip2/1.0.8: If your CMake version is not compatible with CMakePresets (<3.19) call cmake like: 'cmake <path> -G "MinGW Makefiles" -DCMAKE_TOOLCHAIN_FILE=C:\Users\sogartary\.conan\data\bzip2\1.0.8\_\_\build\664a290ff8a4232d40ea8d66ae4e20ff2cb6ef7b\build\generators\conan_toolchain.cmake -DCMAKE_SH=CMAKE_SH-NOTFOUND -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Debug'
    bzip2/1.0.8: Aggregating env generators
    bzip2/1.0.8: Calling build()
    bzip2/1.0.8: apply_conandata_patches(): No patches defined in conandata
    bzip2/1.0.8: CMake command: cmake -G "MinGW Makefiles" -DCMAKE_TOOLCHAIN_FILE="C:/Users/sogartary/.conan/data/bzip2/1.0.8/_/_/build/664a290ff8a4232d40ea8d66ae4e20ff2cb6ef7b/build/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="C:/Users/sogartary/.conan/data/bzip2/1.0.8/_/_/package/664a290ff8a4232d40ea8d66ae4e20ff2cb6ef7b" -DCMAKE_SH="CMAKE_SH-NOTFOUND" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Debug" "C:\Users\sogartary\.conan\data\bzip2\1.0.8\_\_\build\664a290ff8a4232d40ea8d66ae4e20ff2cb6ef7b\src\.."
    CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
    CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
    CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
    -- Configuring incomplete, errors occurred!
    bzip2/1.0.8:
    bzip2/1.0.8: ERROR: Package '664a290ff8a4232d40ea8d66ae4e20ff2cb6ef7b' build failed
    bzip2/1.0.8: WARN: Build folder C:\Users\sogartary\.conan\data\bzip2\1.0.8\_\_\build\664a290ff8a4232d40ea8d66ae4e20ff2cb6ef7b\build\Debug
    ERROR: bzip2/1.0.8: Error in build() method, line 72
            cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir))
            ConanException: Error 1 while executing cmake -G "MinGW Makefiles" -DCMAKE_TOOLCHAIN_FILE="C:/Users/sogartary/.conan/data/bzip2/1.0.8/_/_/build/664a290ff8a4232d40ea8d66ae4e20ff2cb6ef7b/build/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="C:/Users/sogartary/.conan/data/bzip2/1.0.8/_/_/package/664a290ff8a4232d40ea8d66ae4e20ff2cb6ef7b" -DCMAKE_SH="CMAKE_SH-NOTFOUND" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Debug" "C:\Users\sogartary\.conan\data\bzip2\1.0.8\_\_\build\664a290ff8a4232d40ea8d66ae4e20ff2cb6ef7b\src\.."
    
Spack is a package manager, and package managers should be trivial to install.

?? Spack with batteries included (linux/x86_64) Spack is a package manager, and package managers should be trivial to install. This repo offers a sing

Dec 1, 2022
BakePKG is a package archive that can install itself without without a package manager.

BakePKG A bad way of packaging applications. Introduction BakePKG is a package archive that can install itself without without a package manager. The

Sep 3, 2022
The decentralized package manager for C++ and friends 🏝️
The decentralized package manager for C++ and friends 🏝️

Buckaroo The decentralized package manager for C++ and friends. Why Buckaroo? Package managers like Yarn and Cargo have shown how productive developer

Jan 6, 2023
📦 CMake's missing package manager. A small CMake script for setup-free, cross-platform, reproducible dependency management.
📦 CMake's missing package manager. A small CMake script for setup-free, cross-platform, reproducible dependency management.

Setup-free CMake dependency management CPM.cmake is a CMake script that adds dependency management capabilities to CMake. It's built as a thin wrapper

Jan 9, 2023
CMake driven cross-platform package manager for C/C++.

Hunter CMake driven cross-platform package manager for C/C++. Linux, Windows, macOS, iOS, Android, Raspberry Pi, etc. Documentation: https://hunter.re

Jan 3, 2023
C++ Library Manager for Windows, Linux, and MacOS

Vcpkg: Overview 中文总览 Español 한국어 Français Vcpkg helps you manage C and C++ libraries on Windows, Linux and MacOS. This tool and ecosystem are constant

Jan 4, 2023
C++ package retrieval

cget Cmake package retrieval. This can be used to download and install cmake packages. The advantages of using cget are: Non-intrusive: There is no ne

Jan 3, 2023
✔️The smallest header-only GUI library(4 KLOC) for all platforms
✔️The smallest header-only GUI library(4 KLOC) for all platforms

Welcome to GUI-lite The smallest header-only GUI library (4 KLOC) for all platforms. 中文 Lightweight ✂️ Small: 4,000+ lines of C++ code, zero dependenc

Jan 8, 2023
PMM - The C++ Package Manager Manager

PMM - The Package Manager Manager PMM is a module for CMake that manages... package managers. Wha- Why? People hate installing new software. Especiall

Dec 14, 2022
Spack is a package manager, and package managers should be trivial to install.

?? Spack with batteries included (linux/x86_64) Spack is a package manager, and package managers should be trivial to install. This repo offers a sing

Dec 1, 2022
BakePKG is a package archive that can install itself without without a package manager.

BakePKG A bad way of packaging applications. Introduction BakePKG is a package archive that can install itself without without a package manager. The

Sep 3, 2022
"Sigma File Manager" is a free, open-source, quickly evolving, modern file manager (explorer / finder) app for Windows, MacOS, and Linux.

"Sigma File Manager" is a free, open-source, quickly evolving, modern file manager (explorer / finder) app for Windows, MacOS, and Linux.

Dec 31, 2022
gloom game, built with conan
gloom game, built with conan

gloom game, built with conan

Oct 14, 2022
Conan recipe for Irrlicht library

conan-irrlicht conan-mpusz package for Irrlicht library. The package generated with this conanfile can be found at conan-mpusz. conan client can be do

Oct 12, 2020
Conan recipe for Google Benchmark library

DEPRECATED Please note that as Google Benchmark now has an official Conan support this repository should be considered deprecated. Please download the

Jan 17, 2022
C package manager-ish
C package manager-ish

clib(1) Package manager for the C programming language. Installation Expects libcurl to be installed and linkable. With homebrew: $ brew install clib

Jan 6, 2023
C++ Package Manager
C++ Package Manager

CPM Note CPM is not being actively maintained. I plan on keeping the website active but don't plan on making further modifications to the codebase. If

Dec 18, 2022
The decentralized package manager for C++ and friends 🏝️
The decentralized package manager for C++ and friends 🏝️

Buckaroo The decentralized package manager for C++ and friends. Why Buckaroo? Package managers like Yarn and Cargo have shown how productive developer

Jan 6, 2023
📦 CMake's missing package manager. A small CMake script for setup-free, cross-platform, reproducible dependency management.
📦 CMake's missing package manager. A small CMake script for setup-free, cross-platform, reproducible dependency management.

Setup-free CMake dependency management CPM.cmake is a CMake script that adds dependency management capabilities to CMake. It's built as a thin wrapper

Jan 9, 2023
CMake driven cross-platform package manager for C/C++.

Hunter CMake driven cross-platform package manager for C/C++. Linux, Windows, macOS, iOS, Android, Raspberry Pi, etc. Documentation: https://hunter.re

Jan 3, 2023