{"action":"created","issue":{"url":"https://api.github.com/repos/conan-io/conan/issues/543","repository_url":"https://api.github.com/repos/conan-io/conan","labels_url":"https://api.github.com/repos/conan-io/conan/issues/543/labels{/name}","comments_url":"https://api.github.com/repos/conan-io/conan/issues/543/comments","events_url":"https://api.github.com/repos/conan-io/conan/issues/543/events","html_url":"https://github.com/conan-io/conan/issues/543","id":181628089,"number":543,"title":"Using Conan to deploy compiler toolchains?","user":{"login":"BlamKiwi","id":1551722,"avatar_url":"https://avatars.githubusercontent.com/u/1551722?v=3","gravatar_id":"","url":"https://api.github.com/users/BlamKiwi","html_url":"https://github.com/BlamKiwi","followers_url":"https://api.github.com/users/BlamKiwi/followers","following_url":"https://api.github.com/users/BlamKiwi/following{/other_user}","gists_url":"https://api.github.com/users/BlamKiwi/gists{/gist_id}","starred_url":"https://api.github.com/users/BlamKiwi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlamKiwi/subscriptions","organizations_url":"https://api.github.com/users/BlamKiwi/orgs","repos_url":"https://api.github.com/users/BlamKiwi/repos","events_url":"https://api.github.com/users/BlamKiwi/events{/privacy}","received_events_url":"https://api.github.com/users/BlamKiwi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-07T09:53:09Z","updated_at":"2016-10-07T10:14:01Z","closed_at":null,"body":"With Conan its possible to create packages that contain libraries, headers and executables. It would be a desirable feature to be able to use this to deploy a particular compiler toolchain (such as LLVM or GCC) from a package and use it as the compiler for a CMake project. This would allow developers to test their code with different compilers and not have to affect their regular build chain. We can successfully package LLVM and have it downloaded by conan as a regular package. The package even works, using the compiler binary directly to build projects. \r\n\r\nIf there was a way for conan to be able to apply the package concept to compilers, and have it be automatically integrated into CMake (or other tools), this would make conan a very invaluable tool. \r\n\r\nThis is a summary of what we have been able to do so far:\r\n\r\n- Add a toolchain package to our conan server, and update our conan file for the desired buildchain as a dependency. \r\n- Manually set CMAKE_CXX_COMPILER/CMAKE_C_COMPILER to point to the binary in the conan package. \r\n- Conan automatically picks up the standard library implementation as part of the lib filter for the package. \r\n- Add the standard library header locations as SYSTEM headers in CMake. \r\n\r\nThe only issue we are stuck on is getting conan to be able to pick the compiler for CMake. Obviously you cannot run the conan step of CMake without first setting the compiler. So the compiler picking step would probably need to be supported by the conan tool itself. If conan was able to have a package aware version of the \"system-alternatives\" system in linux, this would work quite well. \r\n\r\nI could imagine a system working something like this:\r\n\r\n- Binaries in conan packages can be anonated to declare that they are a \"c compiler\" or \"c++ compiler\".\r\n- Conan exposes conanc and conan++ as executable smlinks in the filesystem.  \r\n- Conan is extended with the ability to update this smlink `conan update-alternatives conanc++ LLVM-4.0`\r\n- Conan downloads the package if required to the usual place.\r\n- Conan updates the symlink to point to the new package binary. \r\n\r\nConan has already helped us greatly by making our build process become more independent of distro repositories. The compiler itself is kind of the last step for self hosting conan build system. "},"comment":{"url":"https://api.github.com/repos/conan-io/conan/issues/comments/252206727","html_url":"https://github.com/conan-io/conan/issues/543#issuecomment-252206727","issue_url":"https://api.github.com/repos/conan-io/conan/issues/543","id":252206727,"user":{"login":"memsharded","id":15367152,"avatar_url":"https://avatars.githubusercontent.com/u/15367152?v=3","gravatar_id":"","url":"https://api.github.com/users/memsharded","html_url":"https://github.com/memsharded","followers_url":"https://api.github.com/users/memsharded/followers","following_url":"https://api.github.com/users/memsharded/following{/other_user}","gists_url":"https://api.github.com/users/memsharded/gists{/gist_id}","starred_url":"https://api.github.com/users/memsharded/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/memsharded/subscriptions","organizations_url":"https://api.github.com/users/memsharded/orgs","repos_url":"https://api.github.com/users/memsharded/repos","events_url":"https://api.github.com/users/memsharded/events{/privacy}","received_events_url":"https://api.github.com/users/memsharded/received_events","type":"User","site_admin":false},"created_at":"2016-10-07T10:14:01Z","updated_at":"2016-10-07T10:14:01Z","body":"Hi @BlamKiwi ,\r\n\r\nThanks for your feeback, very glad that conan helped you in your build process!\r\n\r\nYes, that is true, the progress so far is that of packaging the tool, like MinGW for Win: http://docs.conan.io/en/latest/howtos/create_installer_packages.html\r\n\r\nThe feature that is missing would be the integration of the compiler, so far has been done with env variables CC, CXX,  manually by the user, but there are feature requests to integrate that too: \r\n\r\n- Profiles: https://github.com/conan-io/conan/issues/524 (those will include paths to compilers, which is related).\r\n- Setting the compiler from settings: https://github.com/conan-io/conan/issues/271\r\n- https://github.com/conan-io/conan/issues/199\r\n\r\nI agree that is a desirable and requested feature. Will try to finish a little nightmare we have right now with Windows builds using ``ConfigureEnvironment`` (damn Win command line and batch syntax), and probably will be the first feature to address for next iteration. Thanks for your feedback!\r\n\r\n\r\n"}}
{"actor":{"display_login":"memsharded"}}