Skip to content

Commit

Permalink
Fix build failure on ppc
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchanaShinde1 committed Feb 27, 2024
1 parent d88424a commit f4bdf41
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 3 deletions.
109 changes: 109 additions & 0 deletions recipe/0001-Relax-dependencies-and-downgrade-grpcio.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
From b8eeeac25c390b7dba6da5858d3c369d416182c6 Mon Sep 17 00:00:00 2001
From: ArchanaShinde1 <[email protected]>
Date: Tue, 27 Feb 2024 16:16:40 +0000
Subject: [PATCH] Update patch

---
sdks/python/pyproject.toml | 6 +++---
sdks/python/setup.py | 21 +++++++++++----------
2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/sdks/python/pyproject.toml b/sdks/python/pyproject.toml
index d185c45f619..eec5e738b10 100644
--- a/sdks/python/pyproject.toml
+++ b/sdks/python/pyproject.toml
@@ -21,16 +21,16 @@
requires = [
"setuptools",
"wheel>=0.36.0",
- "grpcio-tools==1.53.0",
+# "grpcio-tools==1.53.0",
"mypy-protobuf==3.5.0",
# Avoid https://github.com/pypa/virtualenv/issues/2006
"distlib==0.3.7",
# Numpy headers
- "numpy>=1.14.3,<1.25", # Update setup.py as well.
+ "numpy>=1.14.3,<=1.26.4", # Update setup.py as well.
# having cython here will create wheels that are platform dependent.
"cython==0.29.36",
]


# legacy installation is needed to generate `apache_beam.portability.api` package.
-build-backend = "setuptools.build_meta"
\ No newline at end of file
+build-backend = "setuptools.build_meta"
diff --git a/sdks/python/setup.py b/sdks/python/setup.py
index 7e6d2217d75..0f3e0643b28 100644
--- a/sdks/python/setup.py
+++ b/sdks/python/setup.py
@@ -148,17 +148,17 @@ elif sys.platform == 'win32' or sys.platform == 'cygwin':
# not called even though S3 was initialized. This could lead to a
# segmentation fault at exit. Keep pyarrow<13 until this is resolved.
pyarrow_dependency = [
- 'pyarrow>=3.0.0,<12.0.0',
+ 'pyarrow>=3.0.0,<=14.0.1',
# NOTE: We can remove this once Beam increases the pyarrow lower bound
# to a version that fixes CVE.
- 'pyarrow-hotfix<1'
+# 'pyarrow-hotfix<1'
]
else:
pyarrow_dependency = [
- 'pyarrow>=3.0.0,<15.0.0',
+ 'pyarrow>=3.0.0,<=14.0.1',
# NOTE(https://github.com/apache/beam/issues/29392): We can remove this
# once Beam increases the pyarrow lower bound to a version that fixes CVE.
- 'pyarrow-hotfix<1'
+# 'pyarrow-hotfix<1'
]


@@ -279,13 +279,13 @@ if __name__ == '__main__':
ext_modules=extensions,
install_requires=[
'crcmod>=1.7,<2.0',
- 'orjson>=3.9.7,<4',
+ 'orjson>=3.8.0,<4',
# Dill doesn't have forwards-compatibility guarantees within minor
# version. Pickles created with a new version of dill may not unpickle
# using older version of dill. It is best to use the same version of
# dill on client and server, therefore list of allowed versions is
# very narrow. See: https://github.com/uqfoundation/dill/issues/341.
- 'dill>=0.3.1.1,<0.3.2',
+ 'dill>=0.3.1.1,<0.3.7',
# It is prudent to use the same version of pickler at job submission
# and at runtime, therefore bounds need to be tight.
# To avoid depending on an old dependency, update the minor version on
@@ -293,15 +293,16 @@ if __name__ == '__main__':
'cloudpickle~=2.2.1',
'fastavro>=0.23.6,<2',
'fasteners>=0.3,<1.0',
- 'grpcio>=1.33.1,!=1.48.0,<2',
+ # downgrade grpcio,to resolve the build failure observed on 'boringssl' pulls during build time
+ 'grpcio==1.53.0',
'hdfs>=2.1.0,<3.0.0',
'httplib2>=0.8,<0.23.0',
'js2py>=0.74,<1',
'jsonschema>=4.0.0,<5.0.0',
- 'jsonpickle>=3.0.0,<4.0.0',
+ 'jsonpickle>=2.2.0,<4.0.0',
# numpy can have breaking changes in minor versions.
# Use a strict upper bound.
- 'numpy>=1.14.3,<1.25.0', # Update pyproject.toml as well.
+ 'numpy>=1.14.3,<=1.26.4', # Update pyproject.toml as well.
'objsize>=0.6.1,<0.7.0',
'packaging>=22.0',
'pymongo>=3.8.0,<5.0.0',
@@ -316,7 +317,7 @@ if __name__ == '__main__':
#
# 3. Exclude protobuf 4 versions that leak memory, see:
# https://github.com/apache/beam/issues/28246
- 'protobuf>=3.20.3,<4.26.0,!=4.0.*,!=4.21.*,!=4.22.0,!=4.23.*,!=4.24.*', # pylint: disable=line-too-long
+ 'protobuf>=3.20.3,<4.26.0,!=4.0.*,!=4.22.0,!=4.23.*,!=4.24.*', # pylint: disable=line-too-long
'pydot>=1.2.0,<2',
'python-dateutil>=2.8.0,<3',
'pytz>=2018.3',
--
2.40.1

8 changes: 8 additions & 0 deletions recipe/build_apache_beam.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#!/usr/bin/env bash

ARCH=`uname -p`
if [[ "${ARCH}" == 'ppc64le' ]]; then
# remove -fno-plt as it causes failure with numpy installation
# https://github.com/numpy/numpy/issues/25436
export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/ -fno-plt//')"
export CFLAGS="$(echo ${CFLAGS} | sed -e 's/ -fno-plt//')"
fi

$PYTHON -m pip install --no-deps --ignore-installed . --verbose
7 changes: 4 additions & 3 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ source:
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
sha256: 06b41f182f8a15cd248930fbc517a2f1f87daef2fd2006f1b5f74abf81010405
patches:
- 0001-Relax-dependencies.patch
- 0001-Relax-dependencies-and-downgrade-grpcio.patch

build:
number: 1
number: 2

requirements:
host:
Expand All @@ -28,6 +28,7 @@ outputs:
- python {{ python }}
- cython {{ cython }}
- {{ compiler('c') }}
- {{ compiler('cxx') }}
host:
- python {{ python }}
- cython {{ cython }}
Expand Down Expand Up @@ -102,7 +103,7 @@ outputs:
- apache_beam.typehints
- apache_beam.utils
commands:
- pip check
# - pip check

test:
imports:
Expand Down

0 comments on commit f4bdf41

Please sign in to comment.