conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
8.29k stars 982 forks source link

[feature] Directly using Git repository to import dependencies #17327

Closed WangZhongDian closed 5 days ago

WangZhongDian commented 5 days ago

What is your suggestion?

Directly using a Git repository to import dependencies, if the repository itself is a conan package, then direct dependencies can be made

[requires]
git:https://github.com/xxxx/xxxx/xxx

[tool_requires]
cmake/3.22.6

[generators]
CMakeDeps
CMakeToolchain

Similar to conanfile.py

    def source(self):
        # Please, be aware that using the head of the branch instead of an immutable tag
        # or commit is a bad practice and not allowed by Conan
        get(self, "https://github.com/conan-io/libhello/archive/refs/heads/main.zip",
                  strip_root=True)

But it's not about creating packages, it's about consuming

Have you read the CONTRIBUTING guide?

memsharded commented 5 days ago

HI @WangZhongDian

Thanks for your suggestion.

This has been discussed a few times, there are too many limitations of this approach to be useful and maintainable in practice, so this is not planned.

The closest to what you are suggesting is the local-recipes-index, which allow to have recipes in a certain layout in a git repo and use them from there. See https://docs.conan.io/2/devops/devops_local_recipes_index.html

Closing as unplanned, thanks for your feedback.