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

upgrading scalapb #1026

Merged
merged 5 commits into from
Apr 7, 2020
Merged

Conversation

tian000
Copy link
Contributor

@tian000 tian000 commented Mar 31, 2020

Description

Upgrading scalapb to the latest version supported for Scala 2.11

Since this is a minor version upgrade in scalapb, there may be binary, and perhaps API incompatibilities.

Motivation

#667
So that I can use sparksql-scala and lenses without binary incompatibilities.

There are some tests that are failing can someone give me some pointers on why they are failing.

In particular, it looks like this target //test/proto:test_service-fast is failing to build but running bazel build //test/proto:test_service-fast says that the target does not exist.

Here's the full error message:

(base) nudomsak-pro:rules_scala napasudomask$ bazel build //test/...
DEBUG: /private/var/tmp/_bazel_napasudomask/27b4d30503e20c142fbe6514959c12c2/external/bazel_skylib/lib.bzl:30:1: WARNING: lib.bzl is deprecated and will go away in the future, please directly load the bzl file(s) of the module(s) needed as it is more efficient.
INFO: Analyzed 1303 targets (12 packages loaded, 1727 targets configured).
INFO: Found 1303 targets...
INFO: From scala //src/scala/scripts:scalapb_generator_lib [for host]:
warning: there were three deprecation warnings; re-run with -deprecation for details
one warning found
ERROR: /Users/napasudomask/gcode/rules_scala/test/proto/BUILD:102:1: scala //test/proto:test_service-fast failed (Exit 1)
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:4: error: type MethodDescriptor is not a member of package io.grpc
  val METHOD_TEST_METHOD1: _root_.io.grpc.MethodDescriptor[_root_.test.proto.test.TestRequest, _root_.test.proto.test2.TestResponse1] =
                                          ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:14: error: type MethodDescriptor is not a member of package io.grpc
  val METHOD_TEST_METHOD2: _root_.io.grpc.MethodDescriptor[_root_.test.proto.test.TestRequest, _root_.test.proto.test3.TestResponse2] =
                                          ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:24: error: type ServiceDescriptor is not a member of package io.grpc
  val SERVICE: _root_.io.grpc.ServiceDescriptor =
                              ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:5: error: object MethodDescriptor is not a member of package io.grpc
    _root_.io.grpc.MethodDescriptor.newBuilder()
                   ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:6: error: object MethodDescriptor is not a member of package io.grpc
      .setType(_root_.io.grpc.MethodDescriptor.MethodType.UNARY)
                              ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:7: error: object MethodDescriptor is not a member of package io.grpc
      .setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("TestService", "TestMethod1"))
                                        ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:15: error: object MethodDescriptor is not a member of package io.grpc
    _root_.io.grpc.MethodDescriptor.newBuilder()
                   ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:16: error: object MethodDescriptor is not a member of package io.grpc
      .setType(_root_.io.grpc.MethodDescriptor.MethodType.UNARY)
                              ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:17: error: object MethodDescriptor is not a member of package io.grpc
      .setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("TestService", "TestMethod2"))
                                        ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:25: error: object ServiceDescriptor is not a member of package io.grpc
    _root_.io.grpc.ServiceDescriptor.newBuilder("TestService")
                   ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:49: error: type Channel is not a member of package io.grpc
  class TestServiceBlockingStub(channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT) extends _root_.io.grpc.stub.AbstractStub[TestServiceBlockingStub](channel, options) with TestServiceBlockingClient {
                                                        ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:49: error: type CallOptions is not a member of package io.grpc
  class TestServiceBlockingStub(channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT) extends _root_.io.grpc.stub.AbstractStub[TestServiceBlockingStub](channel, options) with TestServiceBlockingClient {
                                                                                         ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:49: error: object CallOptions is not a member of package io.grpc
  class TestServiceBlockingStub(channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT) extends _root_.io.grpc.stub.AbstractStub[TestServiceBlockingStub](channel, options) with TestServiceBlockingClient {
                                                                                                                      ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:49: error: Class io.grpc.Channel not found - continuing with a stub.
  class TestServiceBlockingStub(channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT) extends _root_.io.grpc.stub.AbstractStub[TestServiceBlockingStub](channel, options) with TestServiceBlockingClient {
                                                                                                                                                   ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:51: error: Symbol 'type io.grpc.Channel' is missing from the classpath.
This symbol is required by 'value scalapb.grpc.ClientCalls.channel'.
Make sure that type Channel is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
A full rebuild may help if 'ClientCalls.class' was compiled against an incompatible version of io.grpc.
      _root_.scalapb.grpc.ClientCalls.blockingUnaryCall(channel, METHOD_TEST_METHOD1, options, request)
      ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:58: error: type Channel is not a member of package io.grpc
    override def build(channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions): TestServiceBlockingStub = new TestServiceBlockingStub(channel, options)
                                               ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:58: error: type CallOptions is not a member of package io.grpc
    override def build(channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions): TestServiceBlockingStub = new TestServiceBlockingStub(channel, options)
                                                                                ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:61: error: type Channel is not a member of package io.grpc
  class TestServiceStub(channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT) extends _root_.io.grpc.stub.AbstractStub[TestServiceStub](channel, options) with TestService {
                                                ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:61: error: type CallOptions is not a member of package io.grpc
  class TestServiceStub(channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT) extends _root_.io.grpc.stub.AbstractStub[TestServiceStub](channel, options) with TestService {
                                                                                 ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:61: error: object CallOptions is not a member of package io.grpc
  class TestServiceStub(channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT) extends _root_.io.grpc.stub.AbstractStub[TestServiceStub](channel, options) with TestService {
                                                                                                              ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:70: error: type Channel is not a member of package io.grpc
    override def build(channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions): TestServiceStub = new TestServiceStub(channel, options)
                                               ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:70: error: type CallOptions is not a member of package io.grpc
    override def build(channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions): TestServiceStub = new TestServiceStub(channel, options)
                                                                                ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:73: error: type ServerServiceDefinition is not a member of package io.grpc
  def bindService(serviceImpl: TestService, executionContext: scala.concurrent.ExecutionContext): _root_.io.grpc.ServerServiceDefinition =
                                                                                                                 ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:74: error: object ServerServiceDefinition is not a member of package io.grpc
    _root_.io.grpc.ServerServiceDefinition.builder(SERVICE)
                   ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:91: error: type Channel is not a member of package io.grpc
  def blockingStub(channel: _root_.io.grpc.Channel): TestServiceBlockingStub = new TestServiceBlockingStub(channel)
                                           ^
bazel-out/darwin-fastbuild/bin/test/proto/tmp2917373157101204084/test/proto/test_service/TestServiceGrpc.scala:93: error: type Channel is not a member of package io.grpc
  def stub(channel: _root_.io.grpc.Channel): TestServiceStub = new TestServiceStub(channel)
                                   ^
26 errors found
26 errors found
java.lang.RuntimeException: Build failed
        at io.bazel.rulesscala.scalac.ScalacProcessor.compileScalaSources(ScalacProcessor.java:256)
        at io.bazel.rulesscala.scalac.ScalacProcessor.processRequest(ScalacProcessor.java:76)
        at io.bazel.rulesscala.worker.GenericWorker.runPersistentWorker(GenericWorker.java:45)
        at io.bazel.rulesscala.worker.GenericWorker.run(GenericWorker.java:111)
        at io.bazel.rulesscala.scalac.ScalaCInvoker.main(ScalaCInvoker.java:41)
INFO: Elapsed time: 18.973s, Critical Path: 13.67s
INFO: 38 processes: 38 worker.
FAILED: Build did NOT complete successfully

@ittaiz
Copy link
Member

ittaiz commented Apr 1, 2020

The tests aren’t compiling, it’s not that they’re not passing.
Try bazel build //test:proto
It seems the packages have changed. It might be backward incompatible. Don’t know.

@tian000
Copy link
Contributor Author

tian000 commented Apr 1, 2020

@ittaiz thank's for the pointers. I was able to fix the build by adding new dependencies of the grpc-java project.

@tian000
Copy link
Contributor Author

tian000 commented Apr 6, 2020

This fixes #667

Copy link
Collaborator

@simuons simuons left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks.

@tian000
Copy link
Contributor Author

tian000 commented Apr 7, 2020

thanks @simuons. Looks like i need a thumbs up from @ittaiz before this can be merged.

Copy link
Member

@ittaiz ittaiz left a comment

Choose a reason for hiding this comment

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

LGTM as well.
Simonas knows this area as well

@ittaiz ittaiz merged commit 9c84950 into bazelbuild:master Apr 7, 2020
@darl darl mentioned this pull request Apr 8, 2020
SocksDevil pushed a commit to SocksDevil/rules_scala that referenced this pull request Jul 6, 2020
* upgrading scalapb

* lint fix

* fix checksum

* fixed build and tests by including additional grpc dependencies
gergelyfabian pushed a commit to gergelyfabian/rules_scala that referenced this pull request May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants