Make protobuf build
This includes the following:
- Setting up dependencies protobuf needs
- A few hacks to make protobuf work with our version of Bazel (going
to upgrade soon...)
- A few tweaks to make protobuf be happy in third_party
- Commenting out a few things we don't care about that didn't want to
work
Tested with -c fastbuild for all 3 toolchains.
Change-Id: I02c50cd7e82e509bd7973f2e7cecf9b7d183783e
diff --git a/third_party/python_import_helpers.BUILD b/third_party/python_import_helpers.BUILD
new file mode 100644
index 0000000..38a68ec
--- /dev/null
+++ b/third_party/python_import_helpers.BUILD
@@ -0,0 +1,19 @@
+# This repository is used to create helper __init__.py files which import things
+# under third_party at the root of the Python import namespace instead of
+# requiring third_party.xyz. in front of them.
+
+genrule(
+ name = 'google_protobuf_importer_init',
+ outs = ['google/__init__.py'],
+ cmd = 'echo "%s" > $@' % '\n'.join([
+ 'import sys',
+ 'import third_party.protobuf.google.protobuf',
+ 'sys.modules[\'google.protobuf\'] = third_party.protobuf.google.protobuf',
+ ]),
+)
+
+py_library(
+ name = 'google_protobuf_importer',
+ visibility = ['//visibility:public'],
+ srcs = [':google_protobuf_importer_init'],
+)