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

Bazel build broken at main / 7.x #16169

Open
sgammon opened this issue Mar 14, 2024 · 1 comment · May be fixed by sgammon/protobuf#1
Open

Bazel build broken at main / 7.x #16169

sgammon opened this issue Mar 14, 2024 · 1 comment · May be fixed by sgammon/protobuf#1
Labels

Comments

@sgammon
Copy link
Contributor

sgammon commented Mar 14, 2024

What version of protobuf and what language are you using?
Version: main
Language: N/A

What operating system (Linux, Windows, ...) and version? N/A

What runtime / compiler are you using (e.g., python version or gcc version)

openjdk version "21.0.2" 2024-01-16
OpenJDK Runtime Environment GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30)
OpenJDK 64-Bit Server VM GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30, mixed mode, sharing)

What did you do?
Steps to reproduce the behavior:

  1. git clone git@github.com:protocolbuffers/protobuf.git && cd protobuf
  2. bazel build //java:release (passes)

What did you expect to see
Passing build

What did you see instead?

➜  protobuf-main git:(main) bazel build //java:release
Starting local Bazel server and connecting to it...
ERROR: /Volumes/VAULTROOM/proto/protobuf-main/java/util/BUILD.bazel:24:32: in _osgi_jar rule //java/util:util_bundle: 
Traceback (most recent call last):
	File "/Volumes/VAULTROOM/proto/protobuf-main/java/osgi/osgi.bzl", line 177, column 48, in _osgi_jar_impl
		source_jar = target_java_output.source_jars[0]
Error: type 'depset' has no operator [](int)
ERROR: /Volumes/VAULTROOM/proto/protobuf-main/java/util/BUILD.bazel:24:32: Analysis of target '//java/util:util_bundle' failed
ERROR: Analysis of target '//java:release' failed; build aborted: Analysis failed
INFO: Elapsed time: 18.330s, Critical Path: 0.01s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
Error: bazel exited with exit code: 1

Anything else we should know about your project / environment
I don't see a .bazelversion, so default latest is running via Bazelisk:

Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Mon Mar 11 17:55:51 2024 (1710179751)
Build timestamp: 1710179751
Build timestamp as int: 1710179751

Pinning to 6.3.2 fixes the problem:

echo 6.3.2 > .bazelversion
@sgammon sgammon added the untriaged auto added to all issues by default when created. label Mar 14, 2024
sgammon added a commit to sgammon/protobuf that referenced this issue Mar 14, 2024
Fixes and closes protocolbuffers#16169 by pinning the
build to Bazel `6.3.2`.

Signed-off-by: Sam Gammon <sam@elide.ventures>
sgammon added a commit to sgammon/protobuf that referenced this issue Mar 14, 2024
Fixes and closes protocolbuffers#16169 by amending the build to
support the latest version of Bazel (`7.1.0`).

- fix: use `to_list()[0]` for depset
- fix: upgrade `rules_jvm_external` → latest
- fix: upgrade `rules_kotlin` → `1.9.0`, to match `rules_jvm_external`
- fix: `io_bazel_rules_kotlin` → `rules_kotlin`
- fix: target for `kotlin-stdlib`
- chore: re-generate maven dependency lockfile
@sgammon
Copy link
Contributor Author

sgammon commented Mar 14, 2024

I've posted two PR fix options for this issue: one which pins the build to 6.3.2, and one which brings the build up to Bazel 7.x support.

sgammon added a commit to sgammon/protobuf that referenced this issue Mar 14, 2024
Fixes and closes protocolbuffers#16169 by pinning the
build to Bazel `6.3.2`.

Signed-off-by: Sam Gammon <sam@elide.ventures>
@shaod2 shaod2 added java and removed untriaged auto added to all issues by default when created. labels Apr 2, 2024
sgammon added a commit to sgammon/protobuf that referenced this issue Apr 3, 2024
Fixes and closes protocolbuffers#16169 by pinning the
build to Bazel `6.3.2`.

Signed-off-by: Sam Gammon <sam@elide.ventures>
sgammon added a commit to sgammon/protobuf that referenced this issue Apr 15, 2024
Fixes and closes protocolbuffers#16169 by pinning the
build to Bazel `6.3.2`.

Signed-off-by: Sam Gammon <sam@elide.ventures>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants