[arch-commits] Commit in tensorflow/trunk (PKGBUILD openssl-1.1.patch)

Sven-Hendrik Haase svenstaro at gemini.archlinux.org
Wed Jul 28 01:00:27 UTC 2021


    Date: Wednesday, July 28, 2021 @ 01:00:26
  Author: svenstaro
Revision: 988119

upgpkg: tensorflow 2.5.0-6: Use openssl 1.1 (FS#71597)

Added:
  tensorflow/trunk/openssl-1.1.patch
Modified:
  tensorflow/trunk/PKGBUILD

-------------------+
 PKGBUILD          |   19 ++++++++++++-------
 openssl-1.1.patch |   24 ++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 7 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-07-28 00:40:39 UTC (rev 988118)
+++ PKGBUILD	2021-07-28 01:00:26 UTC (rev 988119)
@@ -7,12 +7,12 @@
 pkgname=(tensorflow tensorflow-opt tensorflow-cuda tensorflow-opt-cuda python-tensorflow python-tensorflow-opt python-tensorflow-cuda python-tensorflow-opt-cuda)
 pkgver=2.5.0
 _pkgver=2.5.0
-pkgrel=5
+pkgrel=6
 pkgdesc="Library for computation using data flow graphs for scalable machine learning"
 url="https://www.tensorflow.org/"
 license=('APACHE')
 arch=('x86_64')
-depends=('c-ares' 'intel-mkl' 'onednn' 'pybind11' 'openssl-1.0' 'lmdb' 'libpng' 'curl' 'giflib' 'icu' 'libjpeg-turbo')
+depends=('c-ares' 'intel-mkl' 'onednn' 'pybind11' 'openssl' 'lmdb' 'libpng' 'curl' 'giflib' 'icu' 'libjpeg-turbo')
 makedepends=('bazel' 'python-numpy' 'cuda' 'nvidia-utils' 'nccl' 'git'
              'cudnn' 'python-pip' 'python-wheel' 'python-setuptools' 'python-h5py'
              'python-keras-applications' 'python-keras-preprocessing'
@@ -21,11 +21,13 @@
 source=("$pkgname-$pkgver.tar.gz::https://github.com/tensorflow/tensorflow/archive/v${_pkgver}.tar.gz"
         48935.patch
         fix-c++17-compat.patch
-        build-against-actual-mkl.patch)
+        build-against-actual-mkl.patch
+        openssl-1.1.patch)
 sha512sums=('637c63b1bed1c0eb7bb018f1ff7f29f7f0d78e75dac384df4ecb5dfb92bbcb28209e3d3d2204145abddf88e3247d8c31bbb4cea032a73b7122b2ef3eb0d2b947'
-            '164a9213ffd8c7047a6a03022a3d768736ff3245871fcddb70e9bac8b57922f6dabf369a112d599465884e966ce5499040c6b041e216a7675f27c174e4f8c0ee'
+            '6dab3966de6e8065a3aa91575976df9593b56c7f347f5ef45cc791a4427b4569cde0b772ca6060f229d4e97ce637a69b04346a347c23cdc63420d8226da313ab'
             'a39f4adff91a60b05c18c4c1ef99b65375887bbea5991610eb162a3c6e3562f8d4438f9f1e1910b672f6094235b5b70dea633578f7f6b5b931f221ca2805152a'
-            'e51e3f3dced121db3a09fbdaefd33555536095584b72a5eb6f302fa6fa68ab56ea45e8a847ec90ff4ba076db312c06f91ff672e08e95263c658526582494ce08')
+            'e51e3f3dced121db3a09fbdaefd33555536095584b72a5eb6f302fa6fa68ab56ea45e8a847ec90ff4ba076db312c06f91ff672e08e95263c658526582494ce08'
+            'cb15e7331f62d6e77e1099055430cd026e5788f0cab202fbfad8e27c47fca9ad5e1467249683dcdaab8c76cab4dece016f8ecd0f0793adb256ff6d975f893125')
 
 # consolidate common dependencies to prevent mishaps
 _common_py_depends=(python-termcolor python-astor python-gast03 python-numpy python-protobuf absl-py python-h5py python-keras-applications python-keras-preprocessing python-tensorflow-estimator python-opt_einsum python-astunparse python-pasta python-flatbuffers)
@@ -67,6 +69,9 @@
   # https://github.com/tensorflow/tensorflow/pull/48935/files
   patch -Np1 -d tensorflow-${_pkgver} -i "$srcdir"/48935.patch
 
+  # https://bugs.archlinux.org/task/71597
+  patch -p1 -d tensorflow-${_pkgver} -i "$srcdir"/openssl-1.1.patch
+
   # Get rid of hardcoded versions. Not like we ever cared about what upstream
   # thinks about which versions should be used anyway. ;) (FS#68772)
   sed -i -E "s/'([0-9a-z_-]+) .= [0-9].+[0-9]'/'\1'/" tensorflow-${_pkgver}/tensorflow/tools/pip_package/setup.py
@@ -118,11 +123,11 @@
   export CC=gcc-10
   export CXX=g++-10
 
-  export BAZEL_ARGS="--config=mkl -c opt --copt=-I/usr/include/openssl-1.0 --host_copt=-I/usr/include/openssl-1.0 --linkopt=-l:libssl.so.1.0.0 --linkopt=-l:libcrypto.so.1.0.0 --host_linkopt=-l:libssl.so.1.0.0 --host_linkopt=-l:libcrypto.so.1.0.0"
+  export BAZEL_ARGS="--config=mkl -c opt"
 }
 
 build() {
-  echo "Building without cuda and without non-x86-64 optimizations"
+  echo "Building without cuda and without non-x87-64 optimizations"
   cd "${srcdir}"/tensorflow-${_pkgver}
   export CC_OPT_FLAGS="-march=x86-64"
   export TF_NEED_CUDA=0

Added: openssl-1.1.patch
===================================================================
--- openssl-1.1.patch	                        (rev 0)
+++ openssl-1.1.patch	2021-07-28 01:00:26 UTC (rev 988119)
@@ -0,0 +1,24 @@
+diff --git a/tensorflow/core/platform/s3/aws_crypto.cc b/tensorflow/core/platform/s3/aws_crypto.cc
+index 6a473027..2fe87675 100644
+--- a/tensorflow/core/platform/s3/aws_crypto.cc
++++ b/tensorflow/core/platform/s3/aws_crypto.cc
+@@ -35,14 +35,13 @@ class AWSSha256HMACOpenSSLImpl : public Aws::Utils::Crypto::HMAC {
+     Aws::Utils::ByteBuffer digest(length);
+     memset(digest.GetUnderlyingData(), 0, length);
+ 
+-    HMAC_CTX ctx;
+-    HMAC_CTX_init(&ctx);
++    HMAC_CTX * ctx = HMAC_CTX_new();
+ 
+-    HMAC_Init_ex(&ctx, secret.GetUnderlyingData(),
++    HMAC_Init_ex(ctx, secret.GetUnderlyingData(),
+                  static_cast<int>(secret.GetLength()), EVP_sha256(), NULL);
+-    HMAC_Update(&ctx, toSign.GetUnderlyingData(), toSign.GetLength());
+-    HMAC_Final(&ctx, digest.GetUnderlyingData(), &length);
+-    HMAC_CTX_cleanup(&ctx);
++    HMAC_Update(ctx, toSign.GetUnderlyingData(), toSign.GetLength());
++    HMAC_Final(ctx, digest.GetUnderlyingData(), &length);
++    HMAC_CTX_free(ctx);
+ 
+     return Aws::Utils::Crypto::HashResult(std::move(digest));
+   }



More information about the arch-commits mailing list