summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorGlenn Johnson <glenn-johnson@uiowa.edu>2020-06-16 22:35:03 -0500
committerGitHub <noreply@github.com>2020-06-16 22:35:03 -0500
commit8e6f0c353cc40970051326ea9540beabb388baca (patch)
tree0a253dccade9823d145f0fbcc4a1a0a8895e2914 /var
parent6e467d13a4992791ccab196b02873778f5f46a51 (diff)
downloadspack-8e6f0c353cc40970051326ea9540beabb388baca.tar.gz
spack-8e6f0c353cc40970051326ea9540beabb388baca.tar.bz2
spack-8e6f0c353cc40970051326ea9540beabb388baca.tar.xz
spack-8e6f0c353cc40970051326ea9540beabb388baca.zip
Add patch for older versions of py-tensorflow (#17122)
Versions of py-tensorflow between versions 1.1 and 1.14 need a patch to avoid an import error on the cloud package even if built without support for the cloud package.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/py-tensorflow/contrib_cloud_1.1.patch14
-rw-r--r--var/spack/repos/builtin/packages/py-tensorflow/contrib_cloud_1.10.patch14
-rw-r--r--var/spack/repos/builtin/packages/py-tensorflow/contrib_cloud_1.4.patch14
-rw-r--r--var/spack/repos/builtin/packages/py-tensorflow/contrib_cloud_1.9.patch14
-rw-r--r--var/spack/repos/builtin/packages/py-tensorflow/package.py8
5 files changed, 64 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/py-tensorflow/contrib_cloud_1.1.patch b/var/spack/repos/builtin/packages/py-tensorflow/contrib_cloud_1.1.patch
new file mode 100644
index 0000000000..8813edf365
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-tensorflow/contrib_cloud_1.1.patch
@@ -0,0 +1,14 @@
+--- a/tensorflow/contrib/__init__.py 2020-05-05 17:52:57.716350118 -0500
++++ b/tensorflow/contrib/__init__.py 2020-05-05 17:56:55.665192882 -0500
+@@ -20,7 +20,10 @@
+
+ # Add projects here, they will show up under tf.contrib.
+ from tensorflow.contrib import bayesflow
+-from tensorflow.contrib import cloud
++try:
++ from tensorflow.contrib import cloud
++except ImportError:
++ pass
+ from tensorflow.contrib import compiler
+ from tensorflow.contrib import copy_graph
+ from tensorflow.contrib import crf
diff --git a/var/spack/repos/builtin/packages/py-tensorflow/contrib_cloud_1.10.patch b/var/spack/repos/builtin/packages/py-tensorflow/contrib_cloud_1.10.patch
new file mode 100644
index 0000000000..e76defff49
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-tensorflow/contrib_cloud_1.10.patch
@@ -0,0 +1,14 @@
+--- a/tensorflow/contrib/__init__.py 2020-05-05 18:14:30.701463150 -0500
++++ b/tensorflow/contrib/__init__.py 2020-05-05 18:15:12.392435370 -0500
+@@ -26,7 +26,10 @@
+ from tensorflow.contrib import bayesflow
+ from tensorflow.contrib import checkpoint
+ if os.name != "nt":
+- from tensorflow.contrib import cloud
++ try:
++ from tensorflow.contrib import cloud
++ except ImportError:
++ pass
+ from tensorflow.contrib import cluster_resolver
+ from tensorflow.contrib import coder
+ from tensorflow.contrib import compiler
diff --git a/var/spack/repos/builtin/packages/py-tensorflow/contrib_cloud_1.4.patch b/var/spack/repos/builtin/packages/py-tensorflow/contrib_cloud_1.4.patch
new file mode 100644
index 0000000000..a65417233e
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-tensorflow/contrib_cloud_1.4.patch
@@ -0,0 +1,14 @@
+--- a/tensorflow/contrib/__init__.py 2020-05-05 18:08:09.361724827 -0500
++++ b/tensorflow/contrib/__init__.py 2020-05-05 18:08:46.345699058 -0500
+@@ -20,7 +20,10 @@
+
+ # Add projects here, they will show up under tf.contrib.
+ from tensorflow.contrib import bayesflow
+-from tensorflow.contrib import cloud
++try:
++ from tensorflow.contrib import cloud
++except ImportError:
++ pass
+ from tensorflow.contrib import cluster_resolver
+ from tensorflow.contrib import compiler
+ from tensorflow.contrib import copy_graph
diff --git a/var/spack/repos/builtin/packages/py-tensorflow/contrib_cloud_1.9.patch b/var/spack/repos/builtin/packages/py-tensorflow/contrib_cloud_1.9.patch
new file mode 100644
index 0000000000..2a0ac1f713
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-tensorflow/contrib_cloud_1.9.patch
@@ -0,0 +1,14 @@
+--- a/tensorflow/contrib/__init__.py 2020-05-05 18:11:33.660582455 -0500
++++ b/tensorflow/contrib/__init__.py 2020-05-05 18:12:32.570541708 -0500
+@@ -25,7 +25,10 @@
+ from tensorflow.contrib import batching
+ from tensorflow.contrib import bayesflow
+ from tensorflow.contrib import checkpoint
+-from tensorflow.contrib import cloud
++try:
++ from tensorflow.contrib import cloud
++except ImportError:
++ pass
+ from tensorflow.contrib import cluster_resolver
+ from tensorflow.contrib import coder
+ from tensorflow.contrib import compiler
diff --git a/var/spack/repos/builtin/packages/py-tensorflow/package.py b/var/spack/repos/builtin/packages/py-tensorflow/package.py
index 6bdc7e69be..3b2c0ac062 100644
--- a/var/spack/repos/builtin/packages/py-tensorflow/package.py
+++ b/var/spack/repos/builtin/packages/py-tensorflow/package.py
@@ -255,6 +255,14 @@ class PyTensorflow(Package, CudaPackage):
# Allows 2.0.* releases to build with '--config=nogcp'
patch('0001-Remove-contrib-cloud-bigtable-and-storage-ops-kernel.patch',
when='@2.0.0:2.0.1')
+ # do not import contrib.cloud if not available
+ patch('https://github.com/tensorflow/tensorflow/commit/ed62ac8203999513dfae03498e871ea35eb60cc4.patch',
+ sha256='c37d14622a86b164e2411ea45a04f756ac61b2044d251f19ab17733c508e5305', when='@1.14.0')
+ # import_contrib_cloud patch for older versions
+ patch('contrib_cloud_1.10.patch', when='@1.10:1.13')
+ patch('contrib_cloud_1.9.patch', when='@1.9')
+ patch('contrib_cloud_1.4.patch', when='@1.4:1.8')
+ patch('contrib_cloud_1.1.patch', when='@1.1:1.3')
phases = ['configure', 'build', 'install']