-
Notifications
You must be signed in to change notification settings - Fork 980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] Using BazelDeps with conan center recipes #17112
Comments
Hi @BuildMonkey Thanks for your question. The files that So moving a package from a build system like CMake to Bazel requires both changing CMakeDeps->BazelDeps, but also to rewrite the build scripts for Bazel. So there is no other way than doing modifications to the current recipe and project, not only to change to Conan generator. |
Thanks for responding so quickly. If I understand your explanation correctly, it is not our intention to adjust the third-party dependencies, such as boost, to convert to bazel. We would like to use boost in our current project with bazel as the build system. It seems from the documentation (https://docs.conan.io/2/reference/tools/google/bazeldeps.html) we have to place BazelDeps in the boost recipe to generate the BUILD.bazel file. We would like to avoid this and continue to leverage the boost recipe in conan center. Is there a way to keep building boost through the conan center recipe while also having it generate a BUILD.bazel file for boost for us to use in our current project? |
Hi @BuildMonkey
You don't need to rewrite all the third-party dependencies to use BazelDeps or any other XXXDeps generator. Sorry if the documentation is not clear enough, but the documentation explains an example of a consumer using BazelDeps to bring all their dependencies. For instance, let's imagine that you want to see how looks like the boost BUILD.bazel file created by Conan (and all the other Conan files needed to consume it): $ conan install --requires=boost/1.86.0 -g BazelDeps -of my-folder --build=missing This command creates a local folder That would be mostly the same as creating a conanfile.txt [requires]
boost/1.86.0
[generators]
BazelDeps
BazelToolchain
[layout]
bazel_layout If you want to see a complete example of how to use Bazel in your local project:
|
The CLI option is great! This lets us continue to use the external recipe without customisations. I'll give this a try. Much appreciated. |
What is your question?
Hello,
I am looking at Bazel as a potential build system. We also use conan, with some of our packages coming from conan center. I noticed that conan can build the BUILD.bazel files for a conan package using BazelDeps, but it seems one has to adjust the conan recipe to include BazelDeps.
I was wondering if there is another alternative to generating the BUILD.bazel files without customising the recipes. This would allow us to continue to use the conan center recipes without having to keep local copies to include BazelDeps.
Thanks!
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: