You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by di...@apache.org on 2020/07/10 13:24:01 UTC

[flink] branch release-1.11 updated: [FLINK-18561][python] Build manylinux1 with better compatibility instead of manylinux2014 Python Wheel Packages

This is an automated email from the ASF dual-hosted git repository.

dianfu pushed a commit to branch release-1.11
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/release-1.11 by this push:
     new c040d7a  [FLINK-18561][python] Build manylinux1 with better compatibility instead of manylinux2014 Python Wheel Packages
c040d7a is described below

commit c040d7ac7058aa1865f8968edb8cc9cf1958cb90
Author: huangxingbo <hx...@gmail.com>
AuthorDate: Fri Jul 10 19:17:45 2020 +0800

    [FLINK-18561][python] Build manylinux1 with better compatibility instead of manylinux2014 Python Wheel Packages
    
    This closes #12869.
---
 flink-python/dev/build-wheels.sh     | 18 ++++++++++++++++++
 flink-python/dev/glibc_version_fix.h | 17 +++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/flink-python/dev/build-wheels.sh b/flink-python/dev/build-wheels.sh
index f957205..034a7f7 100755
--- a/flink-python/dev/build-wheels.sh
+++ b/flink-python/dev/build-wheels.sh
@@ -27,8 +27,26 @@ done
 
 ## 3. build wheels
 for ((i=0;i<${#py_env[@]};i++)) do
+    if [[ "$(uname)" != "Darwin" ]]; then
+        # force the linker to use the older glibc version in Linux
+        export CFLAGS="-I. -include dev/glibc_version_fix.h"
+    fi
     ${PY_ENV_DIR}/${py_env[i]}/bin/python setup.py bdist_wheel
 done
 
+## 4. convert linux_x86_64 wheel to manylinux1 wheel in Linux
+if [[ "$(uname)" != "Darwin" ]]; then
+    source `pwd`/dev/.conda/bin/activate
+    # 4.1 install patchelf
+    conda install -c conda-forge patchelf=0.11 -y
+    # 4.2 install auditwheel
+    pip install auditwheel==3.2.0
+    # 4.3 convert Linux wheel
+    for wheel_file in dist/*.whl; do
+        auditwheel repair ${wheel_file} -w dist
+        rm -f ${wheel_file}
+    done
+    source deactivate
+fi
 ## see the result
 ls -al dist/
diff --git a/flink-python/dev/glibc_version_fix.h b/flink-python/dev/glibc_version_fix.h
new file mode 100644
index 0000000..f260492
--- /dev/null
+++ b/flink-python/dev/glibc_version_fix.h
@@ -0,0 +1,17 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");