Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1960)

Unified Diff: appengine/components/tools/compile_proto.py

Issue 1148073005: Use luci-config for infrequently changing settings, part 2. (Closed) Base URL: git@github.com:luci/luci-py@master
Patch Set: fix pylint (??!) Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/components/components/datastore_utils/config.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/components/tools/compile_proto.py
diff --git a/appengine/components/tools/compile_proto.py b/appengine/components/tools/compile_proto.py
index e34e15a5f06b3e7dd8478bbef723d034d87e3c7a..d389eab23f0c9b1bcbaa0b0ceff692d23aa4d9ec 100755
--- a/appengine/components/tools/compile_proto.py
+++ b/appengine/components/tools/compile_proto.py
@@ -15,24 +15,27 @@ import sys
import tempfile
+# Directory with this file.
+THIS_DIR = os.path.dirname(os.path.abspath(__file__))
+
+
# Printed if protoc is missing or too old.
PROTOC_INSTALL_HELP = r"""Could not find working protocol buffers compiler.
-To install it on Linux run install_protoc.py.
+To install it on Linux and Mac run %s.
-On Windows and Mac you are on your own.
-"""
+On Windows you are on your own.
+""" % (os.path.join(THIS_DIR, 'install_protoc.py'))
-# Directory with this file.
-THIS_DIR = os.path.dirname(os.path.abspath(__file__))
-
# Where to look for 'protoc' first (before hitting PATH). install_protoc.py
# installs protoc there.
DEFAULT_PROTOC_DIR = os.path.join(THIS_DIR, 'protoc')
# Minimally required protoc version.
MIN_SUPPORTED_PROTOC_VERSION = (2, 5, 0)
+# Maximally supported protoc version.
+MAX_SUPPORTED_PROTOC_VERSION = (2, 5, 9)
# Paths that should not be searched for *.proto.
BLACKLISTED_PATHS = [
@@ -183,6 +186,15 @@ def main(args, app_dir=None, import_paths=None, blacklisted_paths=None):
(existing, expected))
sys.stderr.write(PROTOC_INSTALL_HELP)
return 1
+ # Make sure protoc produces code compatible with vendored libprotobuf.
+ if protoc_version > MAX_SUPPORTED_PROTOC_VERSION:
+ existing = '.'.join(map(str, protoc_version))
+ expected = '.'.join(map(str, MAX_SUPPORTED_PROTOC_VERSION))
+ print >> sys.stderr, (
+ 'protoc version is too new (%s), expecting at most %s.\n' %
+ (existing, expected))
+ sys.stderr.write(PROTOC_INSTALL_HELP)
+ return 1
# Include default blacklisted paths.
blacklisted_paths = list(blacklisted_paths or [])
« no previous file with comments | « appengine/components/components/datastore_utils/config.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698