python3Packges.tensorflow: workaround buggy std::optional detection in abseil-cpp

Changed files
+19 -2
pkgs
development
python-modules
+15
pkgs/development/python-modules/tensorflow/com_google_absl_fix_macos.patch
···
+
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
+4 -2
pkgs/development/python-modules/tensorflow/default.nix
···
# 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.
···
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}");
};
···
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