Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grpcio: Changes backported from TF 2.15 branch #9015

Merged
merged 4 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions grpcio-absl-path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/setup.py 2024-02-14 12:21:26.788212443 +0100
+++ b/setup.py 2024-02-14 14:00:46.036665638 +0100
@@ -378,7 +378,7 @@
EXTENSION_LIBRARIES += ("re2",)
if BUILD_WITH_SYSTEM_ABSL:
EXTENSION_LIBRARIES += tuple(
- lib.stem[3:] for lib in pathlib.Path("/usr").glob("lib*/libabsl_*.so")
+ lib.stem[3:] for lib in pathlib.Path(os.getenv("ABSEIL_CPP_ROOT")).glob("lib*/libabsl_*.so")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iarspider , is lib.stem[3:] correct for our path?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes: stem is "the final path component, without its suffix". So this line strips "lib" prefix and last suffix (extension)

)

DEFINE_MACROS = (("_WIN32_WINNT", 0x600),)
16 changes: 14 additions & 2 deletions pip/grpcio.file
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
Requires: py3-six re2
%define PipPreBuild export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=true
## INCLUDE cpp-standard
%define patchsrc0 grep 'std=c++14' setup.py && sed -i -e 's|std=c++14|std=c++%{cms_cxx_standard}|g' setup.py
Patch0: grpcio-absl-path
%define PipPreBuild \
export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=True; \
export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=True; \
export GRPC_PYTHON_BUILD_SYSTEM_RE2=True; \
export GRPC_PYTHON_BUILD_SYSTEM_ABSL=True; \
export ABSEIL_CPP_ROOT; \
export LDFLAGS="-L${RE2_ROOT}/lib -L${ZLIB_ROOT}/lib -L${ABSEIL_CPP_ROOT}/lib -L${PYTHON3_ROOT}/lib"; \
export CXXFLAGS="-I${RE2_ROOT}/include -I${ZLIB_ROOT}/include -I${ABSEIL_CPP_ROOT}/include -I${PYTHON3_ROOT}/include/python3.%{cms_python3_minor_version}" ;\
export CFLAGS="-I${RE2_ROOT}/include -I${ZLIB_ROOT}/include -I${ABSEIL_CPP_ROOT}/include -I${PYTHON3_ROOT}/include/python3.%{cms_python3_minor_version}"

Requires: py3-six re2 zlib abseil-cpp
12 changes: 8 additions & 4 deletions rpm-preamble.file
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,14 @@ fi
NEW_REV=$(grep '^#CMSDIST_FILE_REVISION=' %{1} | tail -1 | sed 's|.*=||;s| ||g') \
if [ ${OLD_REV} -lt ${NEW_REV} ] ; then cp %{1} %{2}.tmp; mv %{2}.tmp %{2} ; fi

%define cms_python2_major_minor_version %(echo %{allpkgreqs} | tr ' ' '\\n' | grep /python/ | cut -d/ -f3 | cut -f1,2 -d.)
%define cms_python2_major_minor $(echo %{cms_python2_major_minor_version} | sed 's|[.]||')
%define cms_python3_major_minor_version %(echo %{allpkgreqs} | tr ' ' '\\n' | grep /python3/ | cut -d/ -f3 | cut -f1,2 -d.)
%define cms_python3_major_minor $(echo %{cms_python3_major_minor_version} | sed 's|[.]||')
%define cms_python2_major_version 2
%define cms_python3_major_version 3
%define cms_python2_minor_version %(echo %{allpkgreqs} | tr ' ' '\\n' | grep /python/ | cut -d/ -f3 | cut -f2 -d.)
%define cms_python3_minor_version %(echo %{allpkgreqs} | tr ' ' '\\n' | grep /python3/ | cut -d/ -f3 | cut -f2 -d.)
%define cms_python2_major_minor_version 2.%{cms_python2_minor_version}
%define cms_python2_major_minor 2%{cms_python2_minor_version}
%define cms_python3_major_minor_version 3.%{cms_python3_minor_version}
%define cms_python3_major_minor 3%{cms_python3_minor_version}

%if "%{?allow_version_suffix:set}" == "set"
%define check_version_suffix echo "%%allow_version_suffix defined, skipping version suffix check."
Expand Down