Skip to content

Commit cdbae7f

Browse files
committed
0.3.5 with support for labels in protos attribute in (cpp,go)
1 parent ec9351f commit cdbae7f

File tree

6 files changed

+15
-5
lines changed

6 files changed

+15
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Require these rules your `WORKSPACE`:
6363
git_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

WORKSPACE

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff 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
# ================================================================

bzl/cpp/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
4350
When using the compiled library in other rules, `#include` the
4451
generated files relative to the `WORKSPACE` root. For example, the
4552
`//examples/helloworld/proto/helloworld.proto` functions can be loaded

bzl/java/rules.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

bzl/protoc.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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))

bzl/rules.bzl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
load("//bzl:repositories.bzl", "REPOSITORIES")
22
load("//bzl:classes.bzl", "CLASSES")
33
load("//bzl:util.bzl", "require", "invoke")
4+
load("@io_bazel_rules_go//go:def.bzl", "go_repositories")
45

56
def 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:

0 commit comments

Comments
 (0)