-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Avoid cmake_external for likely transitive dependencies #8141
Comments
@troshko111 if an external dependency has a native Bazel build, we will use this directly. We explicitly are not in the business though of writing and maintaining BUILD files for external dependencies that don't have this, unless they are totally trivial (e.g. a simple header-only library). We also don't want to vendor/snapshot some random BUILD file, as that way lies bit rot and maintenance overhead. This was a project-level decision we made long ago. I think TensorFlow is an anti-pattern in this regard; it's hard to imagine a useful build tool that tells you that you need to go ahead and write a build system for every transitive dependency that you have. At the end of the day, we're in the business of building proxies, not writing and maintaining build systems for other projects. The issues around Please reach out to @irengrig at https://github.com/bazelbuild/bazel for further discussion. |
Taking this one step further, what if said dependency has its own Bazel-native dependency, already present in Envoy? Surely we'd want to reuse it making sure we don't compile independent version statically linked together. Precisely this situation has got me starting this conversation. I've been toying with a submoduled Envoy and some custom extensions which rely on first/third party Bazel-native dependencies, said dependencies have their own dependencies like So even though in this case a Bazel-native dependency was added, it only works as long as the common dependencies have matching names and is severely complicated if any non-Bazel-native ones are present (especially Example above would be something like: RootProject
I personally agree with you and this is not an issue with Envoy per se, it's really the build system shortcoming, I wonder why TF went this way but seems to be working fine for them so far. They would be better to talk to various pros/cons but it seemed to me they wanted more control over dependencies of their dependencies, like in #8140, if you add
Thanks I'll try to start a discussion at Bazel, I probably should have in the first place. |
Just |
@htuch feel free to close in favor of the linked issue, I'm still curios what you think of
Bind is basically getting deprecated is it not? Also AFAIK one cannot rebind a |
Right it is not recommended though no alternative yet (without nested workspace, etc). With bind you can reference using //external:dependency syntax unconditionally. |
@lizan yeah, but the issue is that this is viral IMHO; you basically force bind style on anyone who depends on the project. I think there is a major gap from a usability perspective unless the whole world adapts bind naming rather than direct repository naming. I think that if |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions. |
Title:
cmake_external
-style dependencies in Bazel universe are hard to consume transitively as they have a completely distinct reference style.Description: Even though
cmake_external
-style dependencies are very tempting, they are rather painful to use transitively, imagine Envoy itself is a submodule of projectParent
, sayParent
depends on another Bazel-nativeChild
library, sayChild
depends onc-ares
. Now since Envoy already has that, it'd make sense to use the same version when buildingChild
andEnvoy
. Issue is that Bazel-native andcmake_external
use different reference style (//external:<lib>
vs@<lib>
) so nowChild
needs to have something like:and do a conditional dependency
For every dependency basically. So not only we now need to support
But also Bazel config options for each on top of that so they can be used as a
cmake_external
dependency.Note that
omit_xxx
and the reverse FQDN dependency naming are not part of Bazel standard/conventions and are rather a best practice in the community / answer to aligning transitive dependency versions.Example of this is TensorFlow which uses locally-authored BUILD files for most dependencies https://github.com/tensorflow/tensorflow/tree/master/third_party.
The text was updated successfully, but these errors were encountered: