File tree Expand file tree Collapse file tree 6 files changed +15
-5
lines changed
Expand file tree Collapse file tree 6 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ Require these rules your `WORKSPACE`:
6363git_repository(
6464 name = " org_pubref_rules_protobuf" ,
6565 remote = " https://github.com/pubref/rules_protobuf" ,
66- tag = " v0.3.4 " ,
66+ tag = " v0.3.5 " ,
6767)
6868```
6969
Original file line number Diff line number Diff line change @@ -11,10 +11,6 @@ git_repository(
1111 remote = "https://github.com/bazelbuild/rules_go.git" ,
1212)
1313
14- load ("@io_bazel_rules_go//go:def.bzl" , "go_repositories" )
15-
16- go_repositories ()
17-
1814# ================================================================
1915# Load self
2016# ================================================================
Original file line number Diff line number Diff line change @@ -38,8 +38,15 @@ cc_proto_library(
3838
3939``` sh
4040$ bazel build :protolib
41+ $ bazel build --spawn_strategy=standalone :protolib
4142```
4243
44+ > Note: there are some remaining issues with grpc++ compiling on linux
45+ > that may require disabling the sandbox via the
46+ > ` --spawn_strategy=standalone ` build option. See
47+ > https://github.com/pubref/rules_protobuf/issues/7
48+
49+
4350When using the compiled library in other rules, ` #include ` the
4451generated files relative to the ` WORKSPACE ` root. For example, the
4552` //examples/helloworld/proto/helloworld.proto ` functions can be loaded
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ def java_proto_library(
2525 args = {}
2626 args ["name" ] = name + "_pb"
2727 args ["deps" ] = deps
28+ args ["copy_protos_to_genfiles" ] = False
2829 args ["protos" ] = protos
2930 args ["verbose" ] = verbose
3031 args ["imports" ] = imports
Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ def _get_gendir(ctx):
108108 outdir = ctx .var ["GENDIR" ]
109109 else :
110110 outdir = ctx .var ["BINDIR" ]
111+
111112 return outdir + "/" + ctx .label .package
112113
113114
@@ -120,6 +121,7 @@ def _execute_rule(self):
120121 for src in self ["srcs" ]:
121122 srcfiles += [src .path ]
122123
124+
123125 #self["args"] += ["--descriptor_set_out=%s" % (descriptor_set_file.path)]
124126
125127 arguments = list (set (self ["args" ] + ["-I" + i for i in self ["imports" ]] + srcfiles ))
Original file line number Diff line number Diff line change 11load ("//bzl:repositories.bzl" , "REPOSITORIES" )
22load ("//bzl:classes.bzl" , "CLASSES" )
33load ("//bzl:util.bzl" , "require" , "invoke" )
4+ load ("@io_bazel_rules_go//go:def.bzl" , "go_repositories" )
45
56def protobuf_repositories (
67 with_protoc = True ,
@@ -47,6 +48,9 @@ def protobuf_repositories(
4748 if with_grpc_gateway :
4849 with_go = True
4950
51+ if with_go :
52+ go_repositories ()
53+
5054 if with_cpp :
5155 classes += ["cpp" ]
5256 if with_python :
You can’t perform that action at this time.
0 commit comments