Git Product home page Git Product logo

Comments (7)

pmbethe09 avatar pmbethe09 commented on July 27, 2024

Apparently I needed
with_grpc = False,

I would have thought 'False' should be the default value for that field.

But then:
no such target '//external:protoc_gen_grpc_cpp': target 'protoc_gen_grpc_cpp'

Same thing -- this should not be needed when I set 'with_grpc' to False.

from rules_protobuf.

pcj avatar pcj commented on July 27, 2024

I agree this is suboptimal. The architectural decision to include both grpc and non-grpc metadata in the proto_language rule entangles these concepts. I will need to think about how to address this and don't have a satisfactory answer at the moment.

from rules_protobuf.

pmbethe09 avatar pmbethe09 commented on July 27, 2024

from rules_protobuf.

thaidn avatar thaidn commented on July 27, 2024

I can't tell if this is related, but cc_proto_library fails to compile if with_grpc is false:

$bazel build proto:cpp
INFO: Found 1 target...
ERROR: /home/test/blah/proto/BUILD:11:1: C++ compilation of rule '//proto:cpp' failed: linux-sandbox failed: error executing command /home/test/blah/.cache/bazel/_bazel_test/0fb2f33edd989c698a85a6fc0489350b/execroot/k2/_bin/linux-sandbox ... (remaining 47 argument(s) skipped).
In file included from bazel-out/local-fastbuild/genfiles/proto/k2.grpc.pb.cc:6:0:
bazel-out/local-fastbuild/genfiles/proto/k2.grpc.pb.h:12:46: fatal error: grpc++/impl/codegen/async_stream.h: No such file or directory
 #include <grpc++/impl/codegen/async_stream.h>
                                              ^
compilation terminated.
Target //proto:cpp failed to build
# proto/BUILD 
package(default_visibility = ["//visibility:public"])

load("@org_pubref_rules_protobuf//cpp:rules.bzl", "cc_proto_library")
load("@org_pubref_rules_protobuf//java:rules.bzl", "java_proto_library")

filegroup(
    name = "protos",
    srcs = ["myproto.proto"],
)

cc_proto_library(
    name = "cpp",
    protos = [":protos"],
    verbose = 0,
    with_grpc = False,
    imports = [
      "external/com_github_google_protobuf/src/",
    ],
    inputs = [
      "@com_github_google_protobuf//:well_known_protos",
    ],
)

java_proto_library(
    name = "java",
    protos = [":protos"],
    verbose = 0,
    with_grpc = False,
    imports = [
      "external/com_github_google_protobuf/src/",
    ],
    inputs = [
      "@com_github_google_protobuf//:well_known_protos",
    ],
)

bazel build proto:java works just fine though.

Ideas?

PS: thank you for releasing this tool. It has saved me many hours!

from rules_protobuf.

pcj avatar pcj commented on July 27, 2024

@thaidn Thanks for reporting this. I'm looking into it now.

from rules_protobuf.

pcj avatar pcj commented on July 27, 2024

I think I see the problem. I've moved your issue to #50 to close it with #51, but the larger issue raised by @pmbethe09 is still present.

from rules_protobuf.

pcj avatar pcj commented on July 27, 2024

Note: these rules have been re-written and migrated to https://github.com/stackb/rules_proto. Please re-open there if issue persists, thanks.

Cleaning up all issues on this repo, apologies in advance for closing without proper response.

from rules_protobuf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.