Skip to content

Commit 44cf35d

Browse files
Adding instructions for re-generating ProtoBuf code
1 parent 0b536f3 commit 44cf35d

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

README.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,39 @@ This code depends on the following libraries and requires them for compilation:
3838
add-apt-repository "deb http://ftp.debian.org/debian testing main contrib" && apt-get update
3939
apt-get install -y libprotobuf-c-dev=1.2.1-1+b1
4040

41-
The above are taken from the Debezium [docker images](https://github.com/debezium/docker-images).
41+
When updating the ProtoBuf definition, also install the ProtoBuf C compiler:
42+
43+
apt-get install -y protobuf-c-compiler=1.2.*
44+
45+
The above are taken from the Debezium [container images](https://github.com/debezium/docker-images).
4246

4347
#### Other Linux distributions
4448

4549
You just need to make sure the above software packages (_or some flavour thereof_) are installed for your distro.
4650
Note that the last step from the above sequence is only required for Debian to be able to install `libprotobuf-c-dev:1.2.1`
4751

48-
### Building and installing decoderbufs
52+
### Getting the source code
4953

50-
If you have all of the above prerequisites installed, clone this git repo to build from source. If you have multiple
51-
postgres versions installed, you can select which version to install by altering your `$PATH` to point to the right version.
52-
Then `make` and `make install` for each version. Here is an example:
54+
If you have all of the above prerequisites installed, clone this git repo to build from source:
5355

5456
git clone https://github.com/debezium/postgres-decoderbufs.git
5557
cd postgres-decoderbufs
58+
59+
### Optional: Re-generating ProtoBuf code
60+
61+
This is only needed after changes to the ProtoBuf definition (_proto/pg_logicaldec.proto):
62+
63+
cd proto
64+
protoc-c --c_out=../src/proto pg_logicaldec.proto
65+
cd ..
66+
67+
Commit the generated files to git then.
68+
69+
### Building and installing decoderbufs
70+
71+
If you have multiple Postgres versions installed, you can select which version to install decoderbufs into by altering your `$PATH` to point to the right version.
72+
Then `make` and `make install` for each version. Here is an example:
73+
5674
# Install for Postgres 9.6 if I have multiple local versions
5775
export PATH=/usr/lib/postgresql/9.6/bin:$PATH
5876
make

0 commit comments

Comments
 (0)