summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kalinkin <dmitry.kalinkin@gmail.com>2022-12-06 01:57:43 -0500
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2022-12-13 01:20:52 +0000
commit6b4950417a4da47e4306db5fccfd2d875f2f142f (patch)
tree192492c6aa304e0503980c45d55ac12fedb5038e
parentpython3Packages.tensorflow: fix overrides needed for darwin (diff)
downloadnixpkgs-origin/backport-204743-to-release-22.11.tar.gz
python3Packges.tensorflow: workaround buggy std::optional detection in abseil-cpporigin/backport-204743-to-release-22.11
(cherry picked from commit fc361aa951087e96cdbea9bc5b68808655cb4247)
-rw-r--r--pkgs/development/python-modules/tensorflow/com_google_absl_fix_macos.patch15
-rw-r--r--pkgs/development/python-modules/tensorflow/default.nix6
2 files changed, 19 insertions, 2 deletions
diff --git a/pkgs/development/python-modules/tensorflow/com_google_absl_fix_macos.patch b/pkgs/development/python-modules/tensorflow/com_google_absl_fix_macos.patch
new file mode 100644
index 000000000000..7da8ab1b2e9b
--- /dev/null
+++ b/pkgs/development/python-modules/tensorflow/com_google_absl_fix_macos.patch
@@ -0,0 +1,15 @@
+diff -ru a/absl/base/config.h b/absl/base/config.h
+--- a/absl/base/config.h
++++ b/absl/base/config.h
+@@ -558,9 +558,9 @@
+ __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 50000) || \
+ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && \
+ __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 120000))))
+-#define ABSL_INTERNAL_APPLE_CXX17_TYPES_UNAVAILABLE 1
++// #define ABSL_INTERNAL_APPLE_CXX17_TYPES_UNAVAILABLE 1
+ #else
+-#define ABSL_INTERNAL_APPLE_CXX17_TYPES_UNAVAILABLE 0
++// #define ABSL_INTERNAL_APPLE_CXX17_TYPES_UNAVAILABLE 0
+ #endif
+
+ // ABSL_HAVE_STD_ANY
diff --git a/pkgs/development/python-modules/tensorflow/default.nix b/pkgs/development/python-modules/tensorflow/default.nix
index df6166ccb371..39461fd7953d 100644
--- a/pkgs/development/python-modules/tensorflow/default.nix
+++ b/pkgs/development/python-modules/tensorflow/default.nix
@@ -311,6 +311,8 @@ let
# bazel 3.3 should work just as well as bazel 3.1
rm -f .bazelversion
patchShebangs .
+ '' + lib.optionalString (stdenv.hostPlatform.system == "x86_64-darwin") ''
+ cat ${./com_google_absl_fix_macos.patch} >> third_party/absl/com_google_absl_fix_mac_and_nvcc_build.patch
'' + lib.optionalString (!withTensorboard) ''
# Tensorboard pulls in a bunch of dependencies, some of which may
# include security vulnerabilities. So we make it optional.
@@ -375,7 +377,7 @@ let
then "sha256-SudzMTxfifKJJso6haCgOD2dXeAhYSXHA2nzq1ErTHg="
else "sha256-bwZwK24DlUevN5gIdKmBkq1dJpn0i2H4hq+IN77BzjE=";
aarch64-linux = "sha256-ZbCNZSHF9of+KGTNEqFdKQ44MVNto/rTyo2XEsKXISg=";
- x86_64-darwin = "sha256-/qPUDgfKsWCZh/pgZM4wm9+4U9U5kxxv7q3Uh7zKSO4=";
+ x86_64-darwin = "sha256-ZfZQjLdqo8VVlfKfkdolvSHQvKe4IbQSLc/4cNzHr3E=";
aarch64-darwin = "sha256-u+ODHAZDlGe06PUWId4sNKyl60vhAPMd01jMm2EvN8E=";
}.${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}");
};
@@ -424,7 +426,7 @@ let
license = licenses.asl20;
maintainers = with maintainers; [ jyp abbradar ];
platforms = with platforms; linux ++ darwin;
- broken = !(xlaSupport -> cudaSupport) || (stdenv.hostPlatform.system == "x86_64-darwin");
+ broken = !(xlaSupport -> cudaSupport);
} // lib.optionalAttrs stdenv.isDarwin {
timeout = 86400; # 24 hours
maxSilent = 14400; # 4h, double the default of 7200s