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

Switch java_proto_library & java_grpc_library #204

Merged
merged 1 commit into from
May 24, 2023

Conversation

vorburger
Copy link
Member

@vorburger vorburger commented May 24, 2023

Use https://grpc.io instead of https://rules-proto-grpc.com (fixes #202)

🪄 🧛🏽

@vorburger vorburger changed the title fix (build): Use java_proto_library & java_grpc_library from grpc.io … Switch java_proto_library & java_grpc_library May 24, 2023
@vorburger vorburger mentioned this pull request May 24, 2023
@vorburger
Copy link
Member Author

CI Build is red due to bazel-bin/connectors/demo/demo --singlejar 9090 failing to start.

It's bad that ./test.bash does not detect that - I'll try to fix both the missing test coverage and actual problem.

@vorburger
Copy link
Member Author

CI Build is red due to bazel-bin/connectors/demo/demo --singlejar 9090 failing to start.

Actually not exactly, what was broken here was the following (and I'm glad CI detected it):

$  bazel-bin/connectors/demo/demo --singlejar 9090
Started Demo gRPC Server on localhost at port: 9090
810181 PID written to /tmp/ServerPID

$ ./enola -vvv get --model file:docs/use/connector/model-grpc.yaml demo.book_kind/0-13-140731-7
2023-05-24 22:56:51 WARNING io.grpc.NameResolverRegistry getDefaultRegistry No NameResolverProviders found via ServiceLoader, including for DNS. This is probably due to a broken build. If using ProGuard, check your configuration
io.grpc.ManagedChannelRegistry$ProviderNotFoundException: No functional channel service provider found. Try adding a dependency on the grpc-okhttp, grpc-netty, or grpc-netty-shaded artifact
        at io.grpc.ManagedChannelRegistry.newChannelBuilder(ManagedChannelRegistry.java:181)
        at io.grpc.ManagedChannelRegistry.newChannelBuilder(ManagedChannelRegistry.java:157)
        at io.grpc.Grpc.newChannelBuilder(Grpc.java:101)
        at dev.enola.core.aspects.GrpcAspect.<init>(GrpcAspect.java:42)
        at dev.enola.core.EnolaServiceProvider.get(EnolaServiceProvider.java:72)
        at dev.enola.cli.CommandWithEntityID.run(CommandWithEntityID.java:38)

The reason for this was subtle, and took me a moment to figure out... 😄 It was that the @maven//:io_grpc_grpc_netty really needs to be a runtime_deps not just of java_test but of the java_library(name = "impl" in core/impl/BUILD.

It's bad that ./test.bash does not detect that - I'll try to fix both the missing test coverage and actual problem.

Wehl... this is a very special corner case that's difficult to cover - not worth it.

The Executable Markdown / Demo does find it anyway (as has happened here).

@vorburger vorburger force-pushed the issue-202_java_proto_library branch from 2e8c475 to 46718e0 Compare May 24, 2023 21:07
@vorburger vorburger force-pushed the issue-202_java_proto_library branch from 46718e0 to 322134a Compare May 24, 2023 21:18
@vorburger
Copy link
Member Author

vorburger commented May 24, 2023

@maven//:io_grpc_grpc_netty really needs to be

a runtime_deps of BOTH java_test AND java_library in core/impl/BUILD AS WELL AS connectors/demo/BUILD, to fix:

io.grpc.ManagedChannelProvider$ProviderNotFoundException: No functional server found. Try adding a dependency on the grpc-netty or grpc-netty-shaded artifact
        at io.grpc.ServerProvider.provider(ServerProvider.java:44)
        at io.grpc.ServerBuilder.forPort(ServerBuilder.java:44)
        at dev.enola.demo.Server.start(Server.java:44)
        at dev.enola.demo.ServerTest.testServer(ServerTest.java:37)

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.

Change Protocol Buffer and gRPC from rules_proto_grpc to grpc/grpc-java
1 participant