Skip to content

Add support for bazel 9.x#26201

Closed
keith wants to merge 1 commit intoprotocolbuffers:mainfrom
keith:ks/add-support-for-bazel-9.x
Closed

Add support for bazel 9.x#26201
keith wants to merge 1 commit intoprotocolbuffers:mainfrom
keith:ks/add-support-for-bazel-9.x

Conversation

@keith
Copy link
Copy Markdown
Contributor

@keith keith commented Mar 3, 2026

This doesn't flip the default bazel version, but instead makes this repo
compatible with the current version and bazel 9.x. The primary changes
for 9.x support are adding new load statements for things that were
previously built in. This cascaded into a few dep updates to pull in
their missing load statement fixes.

@fmeum
Copy link
Copy Markdown
Contributor

fmeum commented Mar 4, 2026

@haberman

@haberman
Copy link
Copy Markdown
Member

haberman commented Mar 4, 2026

Thanks for the PR. We previously received #26173 but this PR looks more comprehensive.

@haberman haberman added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Mar 4, 2026
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Mar 4, 2026
@haberman
Copy link
Copy Markdown
Member

haberman commented Mar 4, 2026

Looks like there are some CI errors.

@keith keith force-pushed the ks/add-support-for-bazel-9.x branch from d1438b6 to d260da7 Compare March 4, 2026 16:10
@keith
Copy link
Copy Markdown
Contributor Author

keith commented Mar 4, 2026

@haberman fixed, can you rerun?

@haberman haberman added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Mar 4, 2026
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Mar 4, 2026
@haberman
Copy link
Copy Markdown
Member

haberman commented Mar 4, 2026

Looks like that fixed some of the tests, but not all.

@keith keith force-pushed the ks/add-support-for-bazel-9.x branch from d260da7 to e8192d8 Compare March 4, 2026 17:21
@keith
Copy link
Copy Markdown
Contributor Author

keith commented Mar 4, 2026

fixed that case which was caused by cmake attempting to fetch bcr tags which don't exist. Seems like the cmake build passes for me locally now so hopefully it passes this time!

@haberman haberman added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Mar 4, 2026
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Mar 4, 2026
@haberman haberman self-requested a review March 4, 2026 18:54
@haberman haberman removed the request for review from ericsalo March 4, 2026 18:56
matrix:
platform: ["debian10", "macos", "macos_arm64", "ubuntu2004", "windows"]
bazel: [8.x]
bazel: [8.x, 9.x]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should match /.bazelci/presubmit.yml to runs the same tests in CI instead of just BCR presubmit so we can catch issues ahead of release.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, updated

This doesn't flip the default bazel version, but instead makes this repo
compatible with the current version and bazel 9.x. The primary changes
for 9.x support are adding new load statements for things that were
previously built in. This cascaded into a few dep updates to pull in
their missing load statement fixes.
@keith keith force-pushed the ks/add-support-for-bazel-9.x branch from e8192d8 to 8a35249 Compare March 4, 2026 19:45
copybara-service bot pushed a commit that referenced this pull request Mar 4, 2026
This doesn't flip the default bazel version, but instead makes this repo
compatible with the current version and bazel 9.x. The primary changes
for 9.x support are adding new load statements for things that were
previously built in. This cascaded into a few dep updates to pull in
their missing load statement fixes.

Closes #26201

COPYBARA_INTEGRATE_REVIEW=#26201 from keith:ks/add-support-for-bazel-9.x e8192d8
FUTURE_COPYBARA_INTEGRATE_REVIEW=#26201 from keith:ks/add-support-for-bazel-9.x e8192d8
PiperOrigin-RevId: 878614534
@haberman
Copy link
Copy Markdown
Member

haberman commented Mar 4, 2026

How did you test the patch files for the compatibility tests? Were those changes needed to get the CI to pass?

copybara-service bot pushed a commit that referenced this pull request Mar 4, 2026
This doesn't flip the default bazel version, but instead makes this repo
compatible with the current version and bazel 9.x. The primary changes
for 9.x support are adding new load statements for things that were
previously built in. This cascaded into a few dep updates to pull in
their missing load statement fixes.

Closes #26201

COPYBARA_INTEGRATE_REVIEW=#26201 from keith:ks/add-support-for-bazel-9.x e8192d8
FUTURE_COPYBARA_INTEGRATE_REVIEW=#26201 from keith:ks/add-support-for-bazel-9.x e8192d8
PiperOrigin-RevId: 878614534
Copy link
Copy Markdown
Member

@zhangskz zhangskz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you identify / generate these patches? Its correct that protobuf_v25 / protobuf_v29 don't support Bazel 9 without patches, but did you actually hit build breakages in presubmits without them?

These deps are just for compatibility / breaking change tests that aren't user-facing so making them work in Bazel 9 now would be nice as well, but I expected we should only need to patch parts of v25/v29 to make these work.

@keith
Copy link
Copy Markdown
Contributor Author

keith commented Mar 4, 2026

The added patches there were the minimal set required to get bazel build ... working in the root of the repo. There are many more issues in those deps but my changes only fixed the ones that actually seemed to be referenced

@copybara-service copybara-service bot closed this in f08d703 Mar 4, 2026
protobuf-team-bot added a commit that referenced this pull request Mar 4, 2026
haberman pushed a commit that referenced this pull request Mar 12, 2026
This doesn't flip the default bazel version, but instead makes this repo
compatible with the current version and bazel 9.x. The primary changes
for 9.x support are adding new load statements for things that were
previously built in. This cascaded into a few dep updates to pull in
their missing load statement fixes.

Closes #26201

COPYBARA_INTEGRATE_REVIEW=#26201 from keith:ks/add-support-for-bazel-9.x e8192d8
PiperOrigin-RevId: 878654773
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants