From e211d043e13e283f7a78af2513b0f34d2ff7dacf Mon Sep 17 00:00:00 2001 From: Niko Wenselowski Date: Fri, 16 Aug 2024 15:10:15 +0200 Subject: [PATCH] Revert "omd/packages/Python: set R*PATH in Bazel build rather than the make target" This reverts commit 536d777a25e4411ff765dd6be882952ba75d15df. 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 --- omd/packages/Python/BUILD.Python.bazel | 13 ++----------- omd/packages/packages.make | 8 ++++++++ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/omd/packages/Python/BUILD.Python.bazel b/omd/packages/Python/BUILD.Python.bazel index 4095d4d3057..aadcb101300 100644 --- a/omd/packages/Python/BUILD.Python.bazel +++ b/omd/packages/Python/BUILD.Python.bazel @@ -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 @@ -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 diff --git a/omd/packages/packages.make b/omd/packages/packages.make index e4508f3767e..c825e952bac 100644 --- a/omd/packages/packages.make +++ b/omd/packages/packages.make @@ -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