Date: Tuesday, July 31, 2018 @ 04:58:25 Author: foutrelis Revision: 365027
Python 3.7 rebuild Added: tensorflow/trunk/protobuf-python37-apply.patch tensorflow/trunk/protobuf-python37.patch tensorflow/trunk/python37.patch tensorflow/trunk/update-cython.patch tensorflow/trunk/update-protobuf.patch Modified: tensorflow/trunk/PKGBUILD Deleted: tensorflow/trunk/17508.patch -------------------------------+ 17508.patch | 28 ------- PKGBUILD | 24 +++++- protobuf-python37-apply.patch | 27 +++++++ protobuf-python37.patch | 91 ++++++++++++++++++++++++ python37.patch | 61 ++++++++++++++++ update-cython.patch | 34 +++++++++ update-protobuf.patch | 146 ++++++++++++++++++++++++++++++++++++++++ 7 files changed, 380 insertions(+), 31 deletions(-) Deleted: 17508.patch =================================================================== --- 17508.patch 2018-07-31 03:49:46 UTC (rev 365026) +++ 17508.patch 2018-07-31 04:58:25 UTC (rev 365027) @@ -1,28 +0,0 @@ -From 340327dc8cc637fef01e66f7dd7cae68ce259b94 Mon Sep 17 00:00:00 2001 -From: Yun Peng <[email protected]> -Date: Wed, 7 Mar 2018 13:50:31 +0100 -Subject: [PATCH] jpeg.BUILD: Using --cpu instead of --android_cpu - ---- - third_party/jpeg/jpeg.BUILD | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/third_party/jpeg/jpeg.BUILD b/third_party/jpeg/jpeg.BUILD -index 87a23925c43..4418ac32fc4 100644 ---- a/third_party/jpeg/jpeg.BUILD -+++ b/third_party/jpeg/jpeg.BUILD -@@ -526,12 +526,12 @@ config_setting( - - config_setting( - name = "armeabi-v7a", -- values = {"android_cpu": "armeabi-v7a"}, -+ values = {"cpu": "armeabi-v7a"}, - ) - - config_setting( - name = "arm64-v8a", -- values = {"android_cpu": "arm64-v8a"}, -+ values = {"cpu": "arm64-v8a"}, - ) - - config_setting( Modified: PKGBUILD =================================================================== --- PKGBUILD 2018-07-31 03:49:46 UTC (rev 365026) +++ PKGBUILD 2018-07-31 04:58:25 UTC (rev 365027) @@ -6,7 +6,7 @@ pkgname=(tensorflow tensorflow-opt tensorflow-cuda tensorflow-opt-cuda python-tensorflow python-tensorflow-opt python-tensorflow-cuda python-tensorflow-opt-cuda) pkgver=1.9.0 _pkgver=1.9.0 -pkgrel=2 +pkgrel=3 pkgdesc="Library for computation using data flow graphs for scalable machine learning" url="https://www.tensorflow.org/" license=('APACHE') @@ -14,10 +14,28 @@ makedepends=('bazel' 'python-numpy' 'cuda' 'nvidia-utils' 'cudnn' 'python-pip' 'python-wheel' 'python-setuptools') optdepends=('tensorboard: Tensorflow visualization toolkit') -source=("https://github.com/tensorflow/tensorflow/archive/v${_pkgver}.tar.gz") -sha512sums=('eb25dafccf2ec600c4ca28612362c8317b8b9160610ca9fb60f265815651c155b19ae5be3f213a0d9e716d9e25637d6502164433955247cf6fa5d75408b7ac84') +source=("https://github.com/tensorflow/tensorflow/archive/v${_pkgver}.tar.gz" + update-cython.patch + update-protobuf.patch + python37.patch + protobuf-python37.patch + protobuf-python37-apply.patch) +sha512sums=('eb25dafccf2ec600c4ca28612362c8317b8b9160610ca9fb60f265815651c155b19ae5be3f213a0d9e716d9e25637d6502164433955247cf6fa5d75408b7ac84' + '4f91312e4744ed03bb5bdb7e2403a167d8cbb8e4ceb7a8ad062316609bb4988e28737131f2b5ffd115d8d8b4be90d8da1d186a61fe1d37b2b72cb5a91f6d77bc' + 'e2433942d071862325b3c201a79239347ba30a664d86d27bbcccb6769ec914f0f4bd878986790512c8b7486d1ac1a72fe61f64357b74e52e7ec45188900efd6c' + '9e4af5901cdff1fe877f981721193cfe6bfdc0b059e970f33a4896c53118f1f3dc7bb26dc8f9064eba7a9ac7ada5cb32bb26fc90afb188c490abb4e4aab5179a' + 'a248658d9466bd3aba854b429ce2c1981c5efff5196dead7b2a8c216b9a6cac781a9f487db5ff4513becc4e6d6cc14c494768a859e1f51a9eea848d8f0178204' + 'fcff7163f6b979018ef4c09dc927ab8dc784b778d8a1bca6d986cc6797fa12f9b5cd902b344fd25c74ac13f71c022f515066d909d9b42e6c3be0ff214f1c7ca8') prepare() { + # https://github.com/tensorflow/tensorflow/issues/20517 + patch -d tensorflow-${_pkgver} -Np1 -i ${srcdir}/update-cython.patch + patch -d tensorflow-${_pkgver} -Np1 -i ${srcdir}/python37.patch + # https://github.com/tensorflow/tensorflow/issues/20950 + patch -d tensorflow-${_pkgver} -Np1 -i ${srcdir}/update-protobuf.patch + patch -d tensorflow-${_pkgver} -Np1 -i ${srcdir}/protobuf-python37-apply.patch + cp ${srcdir}/protobuf-python37.patch tensorflow-${_pkgver}/third_party/ + cp -r tensorflow-${_pkgver} tensorflow-${_pkgver}-opt cp -r tensorflow-${_pkgver} tensorflow-${_pkgver}-cuda cp -r tensorflow-${_pkgver} tensorflow-${_pkgver}-opt-cuda Added: protobuf-python37-apply.patch =================================================================== --- protobuf-python37-apply.patch (rev 0) +++ protobuf-python37-apply.patch 2018-07-31 04:58:25 UTC (rev 365027) @@ -0,0 +1,27 @@ +diff -upr tensorflow-1.9.0.orig/tensorflow/workspace.bzl tensorflow-1.9.0/tensorflow/workspace.bzl +--- tensorflow-1.9.0.orig/tensorflow/workspace.bzl 2018-07-30 13:22:06.387368887 +0300 ++++ tensorflow-1.9.0/tensorflow/workspace.bzl 2018-07-30 13:26:15.734924242 +0300 +@@ -335,6 +335,7 @@ def tf_workspace(path_prefix="", tf_repo + ], + sha256 = "50a5753995b3142627ac55cfd496cebc418a2e575ca0236e29033c67bd5665f4", + strip_prefix = "protobuf-3.6.0", ++ patch_file = clean_dep("//third_party:protobuf-python37.patch"), + ) + + # We need to import the protobuf library under the names com_google_protobuf +@@ -348,6 +349,7 @@ def tf_workspace(path_prefix="", tf_repo + ], + sha256 = "50a5753995b3142627ac55cfd496cebc418a2e575ca0236e29033c67bd5665f4", + strip_prefix = "protobuf-3.6.0", ++ patch_file = clean_dep("//third_party:protobuf-python37.patch"), + ) + + tf_http_archive( +@@ -358,6 +360,7 @@ def tf_workspace(path_prefix="", tf_repo + ], + sha256 = "50a5753995b3142627ac55cfd496cebc418a2e575ca0236e29033c67bd5665f4", + strip_prefix = "protobuf-3.6.0", ++ patch_file = clean_dep("//third_party:protobuf-python37.patch"), + ) + + tf_http_archive( Added: protobuf-python37.patch =================================================================== --- protobuf-python37.patch (rev 0) +++ protobuf-python37.patch 2018-07-31 04:58:25 UTC (rev 365027) @@ -0,0 +1,91 @@ +From 0a59054c30e4f0ba10f10acfc1d7f3814c63e1a7 Mon Sep 17 00:00:00 2001 +From: Ben Webb <[email protected]> +Date: Thu, 12 Jul 2018 10:58:10 -0700 +Subject: [PATCH] Add Python 3.7 compatibility (#4862) + +Compilation of Python wrappers fails with Python 3.7 because +the Python folks changed their C API such that +PyUnicode_AsUTF8AndSize() now returns a const char* rather +than a char*. Add a patch to work around. Relates #4086. +--- + python/google/protobuf/pyext/descriptor.cc | 2 +- + python/google/protobuf/pyext/descriptor_containers.cc | 2 +- + python/google/protobuf/pyext/descriptor_pool.cc | 2 +- + python/google/protobuf/pyext/extension_dict.cc | 2 +- + python/google/protobuf/pyext/message.cc | 4 ++-- + 5 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/python/google/protobuf/pyext/descriptor.cc b/python/google/protobuf/pyext/descriptor.cc +index 8af0cb1289..19a1c38a62 100644 +--- a/python/google/protobuf/pyext/descriptor.cc ++++ b/python/google/protobuf/pyext/descriptor.cc +@@ -56,7 +56,7 @@ + #endif + #define PyString_AsStringAndSize(ob, charpp, sizep) \ + (PyUnicode_Check(ob)? \ +- ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ ++ ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ + PyBytes_AsStringAndSize(ob, (charpp), (sizep))) + #endif + +diff --git a/python/google/protobuf/pyext/descriptor_containers.cc b/python/google/protobuf/pyext/descriptor_containers.cc +index bc007f7efa..0153664f50 100644 +--- a/python/google/protobuf/pyext/descriptor_containers.cc ++++ b/python/google/protobuf/pyext/descriptor_containers.cc +@@ -66,7 +66,7 @@ + #endif + #define PyString_AsStringAndSize(ob, charpp, sizep) \ + (PyUnicode_Check(ob)? \ +- ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ ++ ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ + PyBytes_AsStringAndSize(ob, (charpp), (sizep))) + #endif + +diff --git a/python/google/protobuf/pyext/descriptor_pool.cc b/python/google/protobuf/pyext/descriptor_pool.cc +index 95882aeb35..962accc6e9 100644 +--- a/python/google/protobuf/pyext/descriptor_pool.cc ++++ b/python/google/protobuf/pyext/descriptor_pool.cc +@@ -48,7 +48,7 @@ + #endif + #define PyString_AsStringAndSize(ob, charpp, sizep) \ + (PyUnicode_Check(ob)? \ +- ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ ++ ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ + PyBytes_AsStringAndSize(ob, (charpp), (sizep))) + #endif + +diff --git a/python/google/protobuf/pyext/extension_dict.cc b/python/google/protobuf/pyext/extension_dict.cc +index 018b5c2c49..174c5470c2 100644 +--- a/python/google/protobuf/pyext/extension_dict.cc ++++ b/python/google/protobuf/pyext/extension_dict.cc +@@ -53,7 +53,7 @@ + #endif + #define PyString_AsStringAndSize(ob, charpp, sizep) \ + (PyUnicode_Check(ob)? \ +- ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ ++ ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ + PyBytes_AsStringAndSize(ob, (charpp), (sizep))) + #endif + +diff --git a/python/google/protobuf/pyext/message.cc b/python/google/protobuf/pyext/message.cc +index 53736b9c9f..b2984509dd 100644 +--- a/python/google/protobuf/pyext/message.cc ++++ b/python/google/protobuf/pyext/message.cc +@@ -79,7 +79,7 @@ + (PyUnicode_Check(ob)? PyUnicode_AsUTF8(ob): PyBytes_AsString(ob)) + #define PyString_AsStringAndSize(ob, charpp, sizep) \ + (PyUnicode_Check(ob)? \ +- ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ ++ ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ + PyBytes_AsStringAndSize(ob, (charpp), (sizep))) + #endif + #endif +@@ -1529,7 +1529,7 @@ PyObject* HasField(CMessage* self, PyObject* arg) { + return NULL; + } + #else +- field_name = PyUnicode_AsUTF8AndSize(arg, &size); ++ field_name = const_cast<char*>(PyUnicode_AsUTF8AndSize(arg, &size)); + if (!field_name) { + return NULL; + } Added: python37.patch =================================================================== --- python37.patch (rev 0) +++ python37.patch 2018-07-31 04:58:25 UTC (rev 365027) @@ -0,0 +1,61 @@ +diff --git a/tensorflow/c/eager/c_api.h b/tensorflow/c/eager/c_api.h +index 1862af3ce2..093b97110f 100644 +--- a/tensorflow/c/eager/c_api.h ++++ b/tensorflow/c/eager/c_api.h +@@ -76,7 +76,7 @@ typedef enum TFE_ContextDevicePlacementPolicy { + // Sets the default execution mode (sync/async). Note that this can be + // overridden per thread using TFE_ContextSetAsyncForThread. + TF_CAPI_EXPORT extern void TFE_ContextOptionsSetAsync(TFE_ContextOptions*, +- unsigned char async); ++ unsigned char is_async); + + TF_CAPI_EXPORT extern void TFE_ContextOptionsSetDevicePlacementPolicy( + TFE_ContextOptions*, TFE_ContextDevicePlacementPolicy); +@@ -125,7 +125,7 @@ TFE_ContextGetDevicePlacementPolicy(TFE_Context*); + + // Overrides the execution mode (sync/async) for the current thread. + TF_CAPI_EXPORT extern void TFE_ContextSetAsyncForThread(TFE_Context*, +- unsigned char async, ++ unsigned char is_async, + TF_Status* status); + + // Causes the calling thread to block till all ops dispatched in async mode +diff --git a/tensorflow/python/eager/pywrap_tfe_src.cc b/tensorflow/python/eager/pywrap_tfe_src.cc +index 6c9481c3af..13edbb07db 100644 +--- a/tensorflow/python/eager/pywrap_tfe_src.cc ++++ b/tensorflow/python/eager/pywrap_tfe_src.cc +@@ -813,7 +813,7 @@ char* TFE_GetPythonString(PyObject* o) { + } + #if PY_MAJOR_VERSION >= 3 + if (PyUnicode_Check(o)) { +- return PyUnicode_AsUTF8(o); ++ return (char *)PyUnicode_AsUTF8(o); + } + #endif + return nullptr; +diff --git a/tensorflow/python/lib/core/ndarray_tensor.cc b/tensorflow/python/lib/core/ndarray_tensor.cc +index 9df38d464c..4150fbfdd4 100644 +--- a/tensorflow/python/lib/core/ndarray_tensor.cc ++++ b/tensorflow/python/lib/core/ndarray_tensor.cc +@@ -154,7 +154,7 @@ Status PyBytesArrayMap(PyArrayObject* array, F f) { + if (PyUnicode_Check(item.get())) { + #if PY_VERSION_HEX >= 0x03030000 + // Accept unicode by converting to UTF-8 bytes. +- ptr = PyUnicode_AsUTF8AndSize(item.get(), &len); ++ ptr = (char *)PyUnicode_AsUTF8AndSize(item.get(), &len); + if (!ptr) { + return errors::Internal("Unable to get element as UTF-8."); + } +diff --git a/tensorflow/python/lib/core/py_func.cc b/tensorflow/python/lib/core/py_func.cc +index 30c1a9c759..231a66de59 100644 +--- a/tensorflow/python/lib/core/py_func.cc ++++ b/tensorflow/python/lib/core/py_func.cc +@@ -322,7 +322,7 @@ Status ConvertNdarrayToTensor(PyObject* obj, Tensor* ret) { + Py_ssize_t el_size; + if (PyBytes_AsStringAndSize(input_data[i], &el, &el_size) == -1) { + #if PY_MAJOR_VERSION >= 3 +- el = PyUnicode_AsUTF8AndSize(input_data[i], &el_size); ++ el = (char *)PyUnicode_AsUTF8AndSize(input_data[i], &el_size); + #else + el = nullptr; + if (PyUnicode_Check(input_data[i])) { Added: update-cython.patch =================================================================== --- update-cython.patch (rev 0) +++ update-cython.patch 2018-07-31 04:58:25 UTC (rev 365027) @@ -0,0 +1,34 @@ +From f7b39b0e72c1c8e9d0e72e3007000de39ee7a5ff Mon Sep 17 00:00:00 2001 +From: Yong Tang <[email protected]> +Date: Mon, 25 Jun 2018 21:39:44 -0700 +Subject: [PATCH] Update cython to 0.28.3 (#20228) + +This fix updates the cython from 3732784 (09/2017) +to the latest versioned release of 0.28.3 (05/2018). + +Signed-off-by: Yong Tang <[email protected]> +--- + tensorflow/workspace.bzl | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl +index b963bdab306..404eeb8aa36 100644 +--- a/tensorflow/workspace.bzl ++++ b/tensorflow/workspace.bzl +@@ -662,12 +662,12 @@ def tf_workspace(path_prefix="", tf_repo_name=""): + + tf_http_archive( + name = "cython", +- sha256 = "6dcd30b5ceb887b2b965ee7ceb82ea3acb5f0642fe2206c7636b45acea4798e5", ++ sha256 = "05e3eb7f06043f5ff2028338370329e71c29f57315e95f4dc6ad7c4971dd4c6f", + urls = [ +- "https://mirror.bazel.build/github.com/cython/cython/archive/3732784c45cfb040a5b0936951d196f83a12ea17.tar.gz", +- "https://github.com/cython/cython/archive/3732784c45cfb040a5b0936951d196f83a12ea17.tar.gz", ++ "https://mirror.bazel.build/github.com/cython/cython/archive/0.28.3.tar.gz", ++ "https://github.com/cython/cython/archive/0.28.3.tar.gz", + ], +- strip_prefix = "cython-3732784c45cfb040a5b0936951d196f83a12ea17", ++ strip_prefix = "cython-0.28.3", + build_file = clean_dep("//third_party:cython.BUILD"), + delete = ["BUILD.bazel"], + ) Added: update-protobuf.patch =================================================================== --- update-protobuf.patch (rev 0) +++ update-protobuf.patch 2018-07-31 04:58:25 UTC (rev 365027) @@ -0,0 +1,146 @@ +From 3bfd3aeb7856f414e511e20493dd1bdf952649cf Mon Sep 17 00:00:00 2001 +From: Gunhan Gulsoy <[email protected]> +Date: Wed, 20 Jun 2018 11:29:27 -0700 +Subject: [PATCH] Update protobuf dependency of TF to 3.6. + +PiperOrigin-RevId: 201386306 +--- + tensorflow/contrib/cmake/external/protobuf.cmake | 2 +- + .../tools/ci_build/install/install_pip_packages.sh | 4 ++-- + .../tools/ci_build/install/install_proto3.sh | 2 +- + .../install/install_python3.5_pip_packages.sh | 2 +- + .../install/install_python3.6_pip_packages.sh | 2 +- + tensorflow/tools/pip_package/setup.py | 2 +- + tensorflow/workspace.bzl | 24 +++++++++++----------- + 7 files changed, 19 insertions(+), 19 deletions(-) + +diff --git a/tensorflow/contrib/cmake/external/protobuf.cmake b/tensorflow/contrib/cmake/external/protobuf.cmake +index ab464bc99a4..f56fb35a0f7 100644 +--- a/tensorflow/contrib/cmake/external/protobuf.cmake ++++ b/tensorflow/contrib/cmake/external/protobuf.cmake +@@ -16,7 +16,7 @@ include (ExternalProject) + + set(PROTOBUF_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/protobuf/src/protobuf/src) + set(PROTOBUF_URL https://github.com/google/protobuf.git) +-set(PROTOBUF_TAG b04e5cba356212e4e8c66c61bbe0c3a20537c5b9) ++set(PROTOBUF_TAG v3.6.0) + + if(WIN32) + if(${CMAKE_GENERATOR} MATCHES "Visual Studio.*") +diff --git a/tensorflow/tools/ci_build/install/install_pip_packages.sh b/tensorflow/tools/ci_build/install/install_pip_packages.sh +index 88f1d041932..fbed4574e02 100755 +--- a/tensorflow/tools/ci_build/install/install_pip_packages.sh ++++ b/tensorflow/tools/ci_build/install/install_pip_packages.sh +@@ -51,8 +51,8 @@ pip2 install --upgrade markdown==2.6.8 + pip3 install --upgrade markdown==2.6.8 + + # Install protobuf. +-pip2 install --upgrade protobuf==3.3.0 +-pip3 install --upgrade protobuf==3.3.0 ++pip2 install --upgrade protobuf==3.6.0 ++pip3 install --upgrade protobuf==3.6.0 + + # Remove obsolete version of six, which can sometimes confuse virtualenv. + rm -rf /usr/lib/python3/dist-packages/six* +diff --git a/tensorflow/tools/ci_build/install/install_proto3.sh b/tensorflow/tools/ci_build/install/install_proto3.sh +index 7934002b2c9..821d50baff3 100755 +--- a/tensorflow/tools/ci_build/install/install_proto3.sh ++++ b/tensorflow/tools/ci_build/install/install_proto3.sh +@@ -17,7 +17,7 @@ + # Install protobuf3. + + # Select protobuf version. +-PROTOBUF_VERSION="3.3.0" ++PROTOBUF_VERSION="3.6.0" + protobuf_ver_flat=$(echo $PROTOBUF_VERSION | sed 's/\.//g' | sed 's/^0*//g') + local_protobuf_ver=$(protoc --version) + local_protobuf_ver_flat=$(echo $local_protobuf_ver | sed 's/\.//g' | sed 's/^0*//g') +diff --git a/tensorflow/tools/ci_build/install/install_python3.5_pip_packages.sh b/tensorflow/tools/ci_build/install/install_python3.5_pip_packages.sh +index acd69ef346f..037fc0e2e1e 100755 +--- a/tensorflow/tools/ci_build/install/install_python3.5_pip_packages.sh ++++ b/tensorflow/tools/ci_build/install/install_python3.5_pip_packages.sh +@@ -48,7 +48,7 @@ pip3.5 install --upgrade absl-py + pip3.5 install --upgrade six==1.10.0 + + # Install protobuf. +-pip3.5 install --upgrade protobuf==3.3.0 ++pip3.5 install --upgrade protobuf==3.6.0 + + # Remove obsolete version of six, which can sometimes confuse virtualenv. + rm -rf /usr/lib/python3/dist-packages/six* +diff --git a/tensorflow/tools/ci_build/install/install_python3.6_pip_packages.sh b/tensorflow/tools/ci_build/install/install_python3.6_pip_packages.sh +index 323b30f48e3..8fd65a3ee26 100755 +--- a/tensorflow/tools/ci_build/install/install_python3.6_pip_packages.sh ++++ b/tensorflow/tools/ci_build/install/install_python3.6_pip_packages.sh +@@ -60,7 +60,7 @@ pip3 install --upgrade absl-py + pip3 install --upgrade six==1.10.0 + + # Install protobuf. +-pip3 install --upgrade protobuf==3.3.0 ++pip3 install --upgrade protobuf==3.6.0 + + # Remove obsolete version of six, which can sometimes confuse virtualenv. + rm -rf /usr/lib/python3/dist-packages/six* +diff --git a/tensorflow/tools/pip_package/setup.py b/tensorflow/tools/pip_package/setup.py +index 97f625e7e9c..253802b9598 100644 +--- a/tensorflow/tools/pip_package/setup.py ++++ b/tensorflow/tools/pip_package/setup.py +@@ -53,7 +53,7 @@ + 'gast >= 0.2.0', + 'numpy >= 1.13.3', + 'six >= 1.10.0', +- 'protobuf >= 3.4.0', ++ 'protobuf >= 3.6.0', + 'setuptools <= 39.1.0', + 'tensorboard >= 1.8.0, < 1.9.0', + 'termcolor >= 1.1.0', +diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl +index b32d4732199..1f1d106bfb9 100644 +--- a/tensorflow/workspace.bzl ++++ b/tensorflow/workspace.bzl +@@ -330,11 +330,11 @@ def tf_workspace(path_prefix="", tf_repo_name=""): + tf_http_archive( + name = "protobuf_archive", + urls = [ +- "https://mirror.bazel.build/github.com/google/protobuf/archive/396336eb961b75f03b25824fe86cf6490fb75e3a.tar.gz", +- "https://github.com/google/protobuf/archive/396336eb961b75f03b25824fe86cf6490fb75e3a.tar.gz", ++ "https://mirror.bazel.build/github.com/google/protobuf/archive/v3.6.0.tar.gz", ++ "https://github.com/google/protobuf/archive/v3.6.0.tar.gz", + ], +- sha256 = "846d907acf472ae233ec0882ef3a2d24edbbe834b80c305e867ac65a1f2c59e3", +- strip_prefix = "protobuf-396336eb961b75f03b25824fe86cf6490fb75e3a", ++ sha256 = "50a5753995b3142627ac55cfd496cebc418a2e575ca0236e29033c67bd5665f4", ++ strip_prefix = "protobuf-3.6.0", + ) + + # We need to import the protobuf library under the names com_google_protobuf +@@ -343,21 +343,21 @@ def tf_workspace(path_prefix="", tf_repo_name=""): + tf_http_archive( + name = "com_google_protobuf", + urls = [ +- "https://mirror.bazel.build/github.com/google/protobuf/archive/396336eb961b75f03b25824fe86cf6490fb75e3a.tar.gz", +- "https://github.com/google/protobuf/archive/396336eb961b75f03b25824fe86cf6490fb75e3a.tar.gz", ++ "https://mirror.bazel.build/github.com/google/protobuf/archive/v3.6.0.tar.gz", ++ "https://github.com/google/protobuf/archive/v3.6.0.tar.gz", + ], +- sha256 = "846d907acf472ae233ec0882ef3a2d24edbbe834b80c305e867ac65a1f2c59e3", +- strip_prefix = "protobuf-396336eb961b75f03b25824fe86cf6490fb75e3a", ++ sha256 = "50a5753995b3142627ac55cfd496cebc418a2e575ca0236e29033c67bd5665f4", ++ strip_prefix = "protobuf-3.6.0", + ) + + tf_http_archive( + name = "com_google_protobuf_cc", + urls = [ +- "https://mirror.bazel.build/github.com/google/protobuf/archive/396336eb961b75f03b25824fe86cf6490fb75e3a.tar.gz", +- "https://github.com/google/protobuf/archive/396336eb961b75f03b25824fe86cf6490fb75e3a.tar.gz", ++ "https://mirror.bazel.build/github.com/google/protobuf/archive/v3.6.0.tar.gz", ++ "https://github.com/google/protobuf/archive/v3.6.0.tar.gz", + ], +- sha256 = "846d907acf472ae233ec0882ef3a2d24edbbe834b80c305e867ac65a1f2c59e3", +- strip_prefix = "protobuf-396336eb961b75f03b25824fe86cf6490fb75e3a", ++ sha256 = "50a5753995b3142627ac55cfd496cebc418a2e575ca0236e29033c67bd5665f4", ++ strip_prefix = "protobuf-3.6.0", + ) + + tf_http_archive(
