googleapis / google-cloud-cpp

C++ Client Libraries for Google Cloud Services
https://cloud.google.com/
Apache License 2.0
551 stars 373 forks source link

Support bzlmod-based builds #11485

Open coryan opened 1 year ago

coryan commented 1 year ago

Bazel is adding a new (better) way to handle dependencies:

https://bazel.build/external/overview#bzlmod

This automatically handles recursive dependencies, resolves diamond dependencies, etc. And supports multiple registries of packages:

https://bazel.build/external/registry

With a default "global registry":

https://github.com/bazelbuild/bazel-central-registry

We need to figure out a number of things, and implement a number of things. This list is probably not exhaustive, it needs to be filled out:

coryan commented 1 year ago

Waiting for Bazel 7.0

alevenberg commented 11 months ago

I'll take a stab at some of the tasks this week.

alevenberg commented 11 months ago

The migration guide https://bazel.build/external/migration

alevenberg commented 11 months ago

I think we're gonna first just want to compile with bazel 7.0, and then we can tackle bazelmod.

Waiting to see if we can get that build working on Mac (https://github.com/bazelbuild/bazel/issues/20513) and Windows.

alevenberg commented 11 months ago

FYI timeline for support for Bazel 6 is until December 2025

coryan commented 11 months ago

Yes, but the support policy for the libraries is only 6 months:

https://opensource.google/documentation/policies/cplusplus-support#support_criteria_3

I will argue that we should only start the clock on Bazel 6 once Bazel 7 works.

scotthart commented 5 months ago

Add this to 2024 planning.

mering commented 2 months ago

As there is a working MODULE.bazel file already, I would appreciate this being available in BCR. The first uploads could be manually while future ones could be more automated. Do you plan on adding it yourself or should I go ahead an propose a first upload to BCR?

scotthart commented 2 months ago

We're still waiting on several of our dependencies to be added to BCR. The Bazel team is aware of this and is working on it.