google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://ai.google.dev/edge/mediapipe
Apache License 2.0
27.42k stars 5.15k forks source link

Provide bzlmod support #5605

Open Algomorph opened 2 months ago

Algomorph commented 2 months ago

MediaPipe Solution (you are using)

N/A

Programming language

C++

Are you willing to contribute it

No

Describe the feature and the current behaviour/state

bzlmod is not supported throughout dependency tree.

Will this change the current API? How?

No.

Who will benefit with this feature?

Anyone using MediaPipe code in a Bazel project. MediaPipe developers themselves.

Please specify the use cases for this feature

Import MediaPipe in 3rd party Bazel project, enjoy a much more subdued dependency hell.

Any Other info

Lack of TensorFlow bzlmod support (and outdated protbuf, gRPC) are probably holding this back. Need to first fix those deps. Related issues: https://github.com/tensorflow/tensorflow/issues/62598, https://github.com/tensorflow/tensorflow/issues/62599

Algomorph commented 2 months ago

Side comment: this, among a few other things, will be critical to whether we (at my company) continue using MediaPipe in the long term or gradually phase it out, along with TensorFlow and Bazel.

kuaashish commented 1 month ago

Hi @Algomorph,

Could you please provide more details on this feature to help us better understand it?

Thank you!!

Algomorph commented 1 month ago

@kuaashish Bzlmod is the new dependency system for Bazel that addresses the shortcomings of WORKSPACE files, which are due to be removed w/ Bazel 9. You can read more about the migration process here.

Again, it is my understanding that the sole reason MediaPipe doesn't use Bzlmod right now is because TensorFlow is still using old versions of things that predate Bzlmod support (see "Other Info" in issue description above for relevant links). It may make sense to assist the TensorFlow maintainers with this issue, since support is appears to be behind the curb on those issues.

kuaashish commented 1 month ago

Hi @Algomorph,

Thank you for providing additional details. We are marking this as a feature request and will share it with our team. However, we cannot provide a timeline or confirm if it will be supported, as it will depend on further demand and discussions.

udaya2899 commented 1 month ago

I just want to add that the current WORKSPACE support will be disabled by default in Bazel 8, and removed in Bazel 9, per: https://blog.bazel.build/2023/12/11/bazel-7-release.html#bzlmod

Once bzlmod support is added and also this repository added to github.com/bazelbuild/bazel-central-registry, mediapipe will show up in registry.bazel.build and users can simply do

bazel_dep(name = "mediapipe", version = "123")

and use it directly without having to manually install transitive dependencies or clashing toolchains.

Algomorph commented 4 weeks ago

@kuaashish or @schmidt-sebastian do you have any updates for the community on this issue?