Skip to content

Commit e3cb432

Browse files
committed
Update documentation for new loading scheme.
1 parent 81a8115 commit e3cb432

File tree

2 files changed

+31
-7
lines changed

2 files changed

+31
-7
lines changed

README.md

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ the main bazel repository. This is a moving target. The main goals
2525
of this project are to:
2626

2727
1. Provide `protoc`, the protocol buffer compiler
28-
([v3.1.x^52ab^](https://github.com/google/protobuf/commit/52ab3b07ac9a6889ed0ac9bf21afd8dab8ef0014)).
28+
([v3.1.x<sup>52ab</sup>](https://github.com/google/protobuf/commit/52ab3b07ac9a6889ed0ac9bf21afd8dab8ef0014)).
2929

3030
2. Provide the language-specific plugins.
3131

@@ -172,11 +172,11 @@ $ bazel run java/org/pubref/rules_closure/examples/helloworld/client:netty
172172
# Overriding or excluding WORKSPACE dependencies
173173

174174
To load alternate versions of dependencies, pass in a
175-
[dict][skylark-dict] having the same overall structure of the
176-
[repositories.bzl][repositories.bzl] file. Entries having a matching
177-
key will override those found in the file. For example, to load a
178-
different version of https://github.com/golang/protobuf, provide a
179-
different commit ID:
175+
[dict][skylark-dict] having the same overall structure of a
176+
[deps.bzl][protobuf/deps.bzl] file. Entries having a matching key will
177+
override those found in the file. For example, to load a different
178+
version of https://github.com/golang/protobuf, provide a different
179+
commit ID:
180180

181181
```python
182182
load("@org_pubref_rules_protobuf//go:rules.bzl", "go_proto_repositories")
@@ -202,6 +202,27 @@ go_proto_repositories(
202202
)
203203
```
204204

205+
To completely replace the set of dependencies that will attempt to be
206+
loaded, you can pass in a full `dict` object to the `lang_deps`
207+
attribute.
208+
209+
```python
210+
go_proto_repositories(
211+
lang_deps = {
212+
"com_github_golang_glog": {
213+
...
214+
},
215+
},
216+
)
217+
```
218+
219+
There are several language --> language dependencies as well. For
220+
example, `python_proto_repositories` and `ruby_proto_repositories`
221+
(and more) internally call the `cpp_proto_repositories` rule to
222+
provide the grpc plugins. To suppress this (and have better control
223+
in your workspace), you can use the `omit_cpp_repositories=True`
224+
option.
225+
205226
# Proto B --> Proto A dependencies
206227

207228
Use the `proto_deps` attribute to name proto rule dependencies. Use of
@@ -288,6 +309,9 @@ attribute, just as you would any typical `cc_library` rule.
288309

289310
Hopefully that made sense. It's a bit tricky.
290311

312+
If you are having problems, put `verbose={1,2,3}` in your build rule
313+
and/or disable sandboxing with `--spawn_strategy=standalone`.
314+
291315
> Note: bazel will likely a breaking change to the way external
292316
> repositories are laid out in the execution root in future versions
293317
> of bazel. This will likely affect the naming of import paths when

protobuf/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# proto\_repositories
22

3-
The `proto_repositores` macro loads the required external workspaces
3+
The `proto_repositories` macro loads the required external workspaces
44
for a particular language. This rule is used internally by the
55
language-specific `*_proto_repositories` rules, but can be invoked
66
directly to load the minimal set of deps to use `proto_compile`.

0 commit comments

Comments
 (0)