googleapis / googleapis/google-cloud-cpp

Revert to `@com_google_protobuf` dependency name after `@bazel_tools` deprecation

Ouverte
#15,393 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
type: cleanup
Langage dominant
C++
Étoiles
659
Forks
462
Merge moyen
1 j 2 h
PR mergées (30 j)
89

Description

Introduced in #15362, we are using `@com_google_protobuf` as the repository name for the Protobuf dependency. This was a necessary workaround to support both bzlmod and traditional WORKSPACE-based builds.

The underlying issue is that the `@bazel_tools` repository, which is a "magic" repository built into Bazel, has an internal dependency on Protobuf using the name `@com_google_protobuf`. This reference cannot be overridden using `repo_mapping` in `MODULE.bazel`, forcing us to adopt the `@com_google_protobuf` name for consistency in our WORKSPACE setup.

The Bazel team has [indicated](https://github.com/bazelbuild/bazel/issues/4301#issuecomment-2456643183) that they plan to slowly deprecate `@bazel_tools` and are not planning to make improvements to it. Once `@bazel_tools` is deprecated and the repositories that rely on it have migrated, we should revert our Protobuf dependency to use the canonical `@protobuf` name, as used by bzlmod.

This change will simplify our build configuration and align our project with the broader Bazel ecosystem's conventions.

Reference:
```
diegomarquezp:google-cloud-cpp$ bazelisk query --google_default_credentials --noenable_bzlmod --enable_workspace 'somepath(//google/cloud/storage:google_cloud_cpp_storage_grpc, @com_google_protobuf//src/google/protobuf:arena)'
//google/cloud/storage:google_cloud_cpp_storage_grpc
@googleapis//google/storage/v2:storage_cc_proto
@bazel_tools//tools/proto:cc_toolchain
@com_google_protobuf//:cc_toolchain
@com_google_protobuf//src/google/protobuf:protobuf
@com_google_protobuf//src/google/protobuf:micro_string
@com_google_protobuf//src/google/protobuf:arena
```

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par la configuration des dépendances de WORKSPACE et MODULE.bazel décrite dans l’issue, puis exécutez la requête Bazel référencée afin d’inspecter les chemins actuels du dépôt. Ce travail est bloqué par la dépréciation et la migration prévues de @bazel_tools. Le travail est terminé lorsque la configuration peut utiliser le nom canonique @protobuf et que les deux modes de build pris en charge restent cohérents.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
cpp
Domaine
build-system
Type d'issue
Refactorisation
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.