Skip to content

Commit

Permalink
Adds a blurb about updating protobuf/protoc library with a link added…
Browse files Browse the repository at this point in the history
… to the error message.

PiperOrigin-RevId: 507469510
Change-Id: I6bcee38e9f8caf08791ad34db1fa90e0008f6e2d
  • Loading branch information
tfboyd authored and copybara-github committed Feb 6, 2023
1 parent 7e9b569 commit 6495ab5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
29 changes: 28 additions & 1 deletion reverb/pip_package/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This document covers a couple scenarios:

* <a href='#Release'>Create a Reverb release</a>
* <a href='#Develop'>Develop Reverb inside a Docker container</a>

* <a href='#builds-tips-and-hints'>Build tips and hints</a>

While there is overlap in the above scenarios, treating them separately seems
the most clear at the moment. Before you get started, setup a local variable
Expand Down Expand Up @@ -118,3 +118,30 @@ $ docker run --rm --mount "type=bind,src=$REVERB_DIR,dst=/tmp/reverb" \
# *.whl.
$ $PYTHON_BIN_PATH -mpip install --upgrade /tmp/reverb_build/dist/*.whl
```

<a id='#builds-tips-and-hints'></a>

## Builds Tips and Hints

### protoc / protobuf version mismatch

There is a
[check in the Reverb build process](https://github.com/deepmind/reverb/blob/master/third_party/protobuf.BUILD)
that checks if the protoc library in Tensorflow matches what Reverb is using. It
throws this error if there is a mismatch: "Please update the PROTOC_VERSION in
your WORKSPACE". Here for search reasons :-).

Tensorflow sets its version of Protobuf in this
[WORKSPACE](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/workspace2.bzl)
file. Reverb sets its version of protoc in this
[WORKSPACE](https://github.com/deepmind/reverb/blob/master/WORKSPACE) file. The
twist is the protobuf people release protoc as 21.9 and the protobuf library as
3.21.0 as seen
[here](https://github.com/protocolbuffers/protobuf/releases/tag/v21.12).

Until Feb-2023, Tensorflow was using a version of Protobuf that was ~2 years
old. In Feb 2023, TF jumped to the latest protobuf 3.21.9.

Note: While I am pretty sure Tensorflow was on 21.9 as of Feb-2023, The checker
in Reverb saw it as 21.0. 21.0 worked so I (tobyboyd) did not look into it any
farther.
1 change: 1 addition & 0 deletions third_party/protobuf.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if [ "$${PROTOC_VERSION}" -ne "$${TF_PROTO_VERSION}" ]; then
echo Your protoc version does not match the tensorflow proto header \
required version: "$${PROTOC_VERSION}" vs. "$${TF_PROTO_VERSION}" 1>&2
echo Please update the PROTOC_VERSION in your WORKSPACE file. 1>&2
echo https://github.com/deepmind/reverb/tree/master/reverb/pip_package 1>&2
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1>&2
false
else
Expand Down

0 comments on commit 6495ab5

Please sign in to comment.