tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[PATCH] Fixing the subtle python PLIST breakage on installing with an older version present
Hi,
with help of the IRC channel, I was able to track down the breakage I
got on my Linux system trying to update python37 to 3.7.3 with 3.7.2
already installed. The error is about a mismatch in PLIST at
lib/python${PY_VER_SUFFIX}/lib2to3/Grammar${PKGVERSION}.final.0.pickle
lib/python${PY_VER_SUFFIX}/lib2to3/PatternGrammar${PKGVERSION}.final.0.pickle
The generated files had version 3.7.2 instead of 3.7.3. The reason: My
system writes RPATH into the ELF binaries instead of the newer RUNPATH
(no --enable-new-dtags). The python build does set LD_LIBRARY_PATH when
generating these files with the newly built python binary, but that has
no effect with RPATH present. The linker finds the already installed
libpython3.7.so.1.0 and uses that, turning the process into a bastard
between 3.7.3 and 3.7.2.
I propose the attached patch to fix this: Adding LD_PRELOAD on the
library to the variable that is intended to set up the environment to
run the built but not yet installed python.
It worked for me with lang/python37. I suppose it is the same/similar
with all pythons down to python27. One migth even consider pushing this
upstream.
Comments? Anybody willing to push this to CVS?
Alrighty then,
Thomas
--
Dr. Thomas Orgis
HPC @ Universität Hamburg
--- Makefile.nisfix 2019-04-04 18:45:09.224356457 +0200
+++ Makefile 2019-04-04 18:47:38.866600649 +0200
@@ -160,6 +160,18 @@
SUBST_SED.findlib= -e 's,/usr/local,${PREFIX},'
SUBST_SED.findlib+= -e "s!\('-Wl,-t'\)!'${COMPILER_RPATH_FLAG}${PREFIX}/lib', '-L${PREFIX}/lib', \1!"
+# ELF's RPATH overrides LD_LIBRARY_PATH, resulting in the installed
+# libpython from an earlier minor version being found, messing up
+# PLIST with a wrong version string.
+.if ${OPSYS} == "Linux"
+SUBST_CLASSES+= usebuildlib
+SUBST_MESSAGE.usebuildlib= Preventing use of installed libpython.
+SUBST_STAGE.usebuildlib= pre-configure
+SUBST_FILES.usebuildlib= Makefile.pre.in
+SUBST_SED.usebuildlib= -e 's,^RUNSHARED= *,RUNSHARED= LD_PRELOAD=${WRKSRC:Q}/$$(INSTSONAME) ,'
+.endif
+
+
.include "options.mk"
CHECK_INTERPRETER_SKIP= lib/python${PY_VER_SUFFIX}/venv/scripts/posix/pydoc
Home |
Main Index |
Thread Index |
Old Index