aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/protobuf
diff options
context:
space:
mode:
authorGravatar Laszlo Csomor <laszlocsomor@google.com>2016-09-29 12:07:57 +0000
committerGravatar Yun Peng <pcloudy@google.com>2016-09-29 12:44:43 +0000
commit601b3d8577c6be048a5c1edfc61ac19f2790b53f (patch)
tree1e60477697d6065150e1550ae3aded3eb2444fe7 /third_party/protobuf
parent9ae766b7b6e2773f8b05a2bd2d51884305b8f82b (diff)
Protobuf: update build instructions for MinGW
See https://github.com/bazelbuild/bazel/issues/1856 Slightly reformat (prettify) the page too. -- MOS_MIGRATED_REVID=134649252
Diffstat (limited to 'third_party/protobuf')
-rw-r--r--third_party/protobuf/README.md61
1 files changed, 45 insertions, 16 deletions
diff --git a/third_party/protobuf/README.md b/third_party/protobuf/README.md
index bf93a9893d..0c7627c8d0 100644
--- a/third_party/protobuf/README.md
+++ b/third_party/protobuf/README.md
@@ -1,4 +1,4 @@
-How to update the binaries other than `protoc-linux-x86_64.exe`:
+### Updating binaries other than the Linux 64-bit and MinGW ones
1. Go to http://search.maven.org/
2. Search for g:"com.google.protobuf"
@@ -9,35 +9,64 @@ How to update the binaries other than `protoc-linux-x86_64.exe`:
7. Update `third_party/BUILD` to point to the new jar file.
8. Done.
+* * *
+### Updating the Linux 64-bit proto compiler
The 64-bit Linux version of the proto compiler is linked statically. To update it, do
the following steps on an x86_64 machine:
1. `git clone http://github.com/google/protobuf.git`
-2. `git checkout <commithash>` (current is `d5fb408d` or `3.0.0-beta-2`)
+2. `git checkout <tag or commithash>` (e.g. `v3.0.0` or `e8ae137`)
3. `./autogen.sh`
4. `LDFLAGS=-static ./configure`
5. Change `LDFLAGS = -static` to `LDFLAGS = -all-static` in `src/Makefile`.
6. `make`
7. `cp src/protoc <Bazel tree>/third_party/protobuf/protoc-linux-x86_64.exe` .
-How to update `protobuf.bzl` and the `src/` directory:
+* * *
+### Updating the MinGW proto compiler (64-bit)
+Do this from a MinGW shell ([https://sourceforge.net/projects/msys2/files/]) on
+a Windows machine.
+
+1. Clone the protobuf repo and check out the right commit
+
+ ```sh
+ git clone http://github.com/google/protobuf.git
+ git checkout <tag or commithash> # e.g. `v3.0.0` or `e8ae137`
+ ```
+
+2. Close all other MSYS/MinGW/Cygwin windows. Kill all running background jobs.
+ This step is optional, but if you have other terminal windows open the next
+ step may print some error messages (though it still seems to work).
+3. Install necessary MinGW packages
+
+ ```sh
+ pacman -Syuu autoconf automake libtool curl make gcc unzip
+ ```
+
+4. Configure for static linking and build like you would for Unix
+
+ ```sh
+ ./autogen.sh
+ ./configure --disable-shared # takes about 2 minutes
+ ./make # takes about 11 minutes
+ ```
+
+5. Copy resulting binary
+
+ ```sh
+ cp src/protoc.exe <bazel tree>/third_party/protobuf/protoc-mingw.exe
+ ```
+
+* * *
+### Updating `protobuf.bzl` and the `src/` directory:
1. `git clone http://github.com/google/protobuf.git`
-2. `git checkout <commithash>` (current is `d5fb408d` or `3.0.0-beta-2`)
+2. `git checkout <tag or commithash>` (e.g. `v3.0.0` or `e8ae137`)
2. `mkdir -p third_party/protobuf/src/google` in the root of the Bazel tree.
3. `cp -R <root of protobuf tree>/src/google/protobuf third_party/protobuf/src/google`
4. Update rules in `third_party/protobuf/BUILD` with the rules in the protobuf repository.
5. Done.
-How to update `protoc-mingw.exe`:
-This is pretty much the same steps as for x86_64 above, but they need to be done
-from MingW shell on Windows machine ([https://sourceforge.net/projects/msys2/files/]).
-
-1. `git clone http://github.com/google/protobuf.git`
-2. `git checkout <commithash>` (current is `d5fb408d` or `3.0.0-beta-2`)
-3. `./autogen.sh`
-6. `make`
-7. `cp src/protoc.exe <Bazel tree>/third_party/protobuf/protoc-mingw.exe` .
-
-How to update anything else in this directory: follow usual procedure as described on
-https://www.bazel.io/contributing.html
+* * *
+### Updating anything else in the directory
+Follow usual procedure as described on https://www.bazel.io/contributing.html