Skip to content

Commit

Permalink
Revert "omd/packages/Python: set R*PATH in Bazel build rather than th…
Browse files Browse the repository at this point in the history
…e make target"

This reverts commit 536d777.

Reason for revert: Results in non-working cygrpc.cpython-312-x86_64-linux-gnu.so on CentOS 8 and SLES 15 SP5

Change-Id: I9e47bc2366c06d80caae382fbebac1c12c5de194
  • Loading branch information
okin committed Aug 16, 2024
1 parent a84021e commit e211d04
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
13 changes: 2 additions & 11 deletions omd/packages/Python/BUILD.Python.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ configure_make(
sed -i "s|$BUILD_TMPDIR|$omd_prefix|g" $sysconfig_path;

# Fix shebang of scripts
cd $bin_dir && \
cd $bin_dir && \
ln -s python{pyMaj} python && \
sed -i 's|^#!'$py_install_dir'.*|#!/usr/bin/env python{pyMaj}|' 2to3 2to3-{pyMajMin} idle{pyMajMin} pydoc{pyMajMin};
sed -i 's|^#!'$py_install_dir'.*|#!/usr/bin/env python{pyMaj}|' 2to3 2to3-{pyMajMin} idle{pyMajMin} pydoc{pyMajMin};

# Fix pip3 configuration by using own wrapper script
# * PIP_TARGET currently has an issue when installing non-wheel packages, see https://github.com/pypa/pip/issues/8438
Expand All @@ -107,15 +107,6 @@ configure_make(
# Tests are not needed in final package
rm -rf $INSTALLDIR/lib/python{pyMajMin}/test ; \

# set RPATH for all ELF binaries we find
find $INSTALLDIR -maxdepth 2 -type f -exec file {{}} \\; \
| grep ELF | cut -d ':' -f1 \
| xargs patchelf --set-rpath "\\$ORIGIN/../lib"
find "$INSTALLDIR/lib/python{pyMajMin}/lib-dynload" -name "*.so" -exec file {{}} \\; \
| grep ELF | cut -d ':' -f1 \
| xargs patchelf --set-rpath "\\$ORIGIN/../.."
chmod +x $INSTALLDIR/bin/pip*

mkdir $BUILD_TMPDIR/tar
cp -R $INSTALLDIR $BUILD_TMPDIR/Python-{pyVers}
rm -rf $BUILD_TMPDIR/Python-{pyVers}/tar
Expand Down
8 changes: 8 additions & 0 deletions omd/packages/packages.make
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ $(INTERMEDIATE_INSTALL_BAZEL):
#TODO: The following code should be executed by Bazel instead of make
# Fix sysconfigdata
$(SED) -i "s|/replace-me|$(PACKAGE_PYTHON_DESTDIR)|g" $(PACKAGE_PYTHON_SYSCONFIGDATA)
# set RPATH for all ELF binaries we find
find "$(INTERMEDIATE_INSTALL_BASE)/$(PYTHON_DIR)" -maxdepth 2 -type f -exec file {} \; \
| grep ELF | cut -d ':' -f1 \
| xargs patchelf --set-rpath "\$$ORIGIN/../lib"
find "$(INTERMEDIATE_INSTALL_BASE)/$(PYTHON_DIR)/lib/python$(PYTHON_MAJOR_DOT_MINOR)/lib-dynload" -name "*.so" -exec file {} \; \
| grep ELF | cut -d ':' -f1 \
| xargs patchelf --set-rpath "\$$ORIGIN/../.."
chmod +x $(INTERMEDIATE_INSTALL_BASE)/$(PYTHON_DIR)/bin/pip*

# This will replace forced absolute paths determined at build time by
# Bazel/foreign_cc. Note that this step depends on $OMD_ROOT which is different
Expand Down

0 comments on commit e211d04

Please sign in to comment.