Skip to content
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

[29.x] Add missing java load #19016

Merged
merged 2 commits into from
Oct 29, 2024
Merged

Conversation

ted-xie
Copy link
Contributor

@ted-xie ted-xie commented Oct 28, 2024

(cherry-pick of 89533c7)

For most native loads of Java rules (e.g. java_library), these can be automatically handled by Bazel 8's autoload feature.

However, this is not the case when the main repository (IOW, the repository currently being built) is a rule repo itself. In those cases, module dependencies are not automatically loaded.

This PR fixes a compatibility issue of OSS protobuf Bazel rules with other Bazel rule repositories such as bazelbuild/rules_android.

Without this PR, builds within rules repositories with Bazel 8 will fail like so:

external/protobuf+/java/core/BUILD.bazel:142:13: @@protobuf+//java/core:lite: no such attribute 'srcs' in 'java_library' rule

PiperOrigin-RevId: 690735533

@ted-xie ted-xie requested a review from a team as a code owner October 28, 2024 20:55
@ted-xie ted-xie requested review from deannagarcia and removed request for a team October 28, 2024 20:55
@ted-xie ted-xie changed the title Add missing java load [29.x] Add missing java load Oct 28, 2024
@ted-xie ted-xie mentioned this pull request Oct 28, 2024
@zhangskz zhangskz added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Oct 28, 2024
@zhangskz zhangskz enabled auto-merge (squash) October 28, 2024 21:05
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Oct 28, 2024
@ted-xie
Copy link
Contributor Author

ted-xie commented Oct 29, 2024

The failures in presubmit seem unrelated to this PR:

From upb/MacOS:

Error in fail: whl_library pip_deps_numpy failed: Collecting numpy<=1.26.1 (from -r /var/folders/nj/wh528zms06j9t8y7bmlvpmjm0000gn/T/tmpg2bt878l (line 1))

From Annotations/All Blocking Tests:

Run false
  false
  shell: /usr/bin/bash -e {0}
Error: Process completed with exit code 1.

It looks like the first one is some kind of python toolchain error, and the second is a test set up specifically to fail?

For most _native_ loads of Java rules (e.g. java_library), these can be automatically handled by Bazel 8's autoload feature.

However, this is not the case when the main repository (IOW, the repository currently being built) is a rule repo itself. In those cases, module dependencies are not automatically loaded.

This PR fixes a compatibility issue of OSS protobuf Bazel rules with other Bazel rule repositories such as bazelbuild/rules_android.

Without this PR, builds within rules repositories with Bazel 8 will fail like so:

```
external/protobuf+/java/core/BUILD.bazel:142:13: @@protobuf+//java/core:lite: no such attribute 'srcs' in 'java_library' rule
```

PiperOrigin-RevId: 690735533
auto-merge was automatically disabled October 29, 2024 13:33

Head branch was pushed to by a user without write access

@zhangskz zhangskz added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Oct 29, 2024
@zhangskz zhangskz enabled auto-merge (squash) October 29, 2024 16:32
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Oct 29, 2024
@ted-xie
Copy link
Contributor Author

ted-xie commented Oct 29, 2024

The github workflows are still failing with the numpy error. @zhangskz any idea about the root cause? I still don't think my change should have caused this, and it looks like the recent other commits in the 29.x branch have been green.

I do see that 7060d3d bumped the numpy version, and also bumped the MacOS version number from 12 to 13. Would that be a relevant commit to cherry-pick into 29.x?

@zhangskz zhangskz merged commit bb287be into protocolbuffers:29.x Oct 29, 2024
172 of 177 checks passed
@zhangskz
Copy link
Member

Went ahead and merged this -- the error you saw should've been fixed in main and backported in #19013 (due to upgrade of github to python 3.13)

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.

2 participants