Skip to content

Commit 7f497c3

Browse files
authored
GH-108819: fix LIBDEST not honoring --with-platlibdir (#133163)
* GH-108819: fix LIBDEST not honoring --with-platlibdir We look for the pure-Python part of the standard library in PLATSTDLIBDIR, which may not match the default LIBDIR subdir. From ``getpath.py``: ```python ... STDLIB_SUBDIR = f'{platlibdir}/python{VERSION_MAJOR}.{VERSION_MINOR}{ABI_THREAD}' STDLIB_LANDMARKS = [f'{STDLIB_SUBDIR}/os.py', f'{STDLIB_SUBDIR}/os.pyc'] PLATSTDLIB_LANDMARK = f'{platlibdir}/python{VERSION_MAJOR}.{VERSION_MINOR}{ABI_THREAD}/lib-dynload' ... ``` Signed-off-by: Filipe Laíns <lains@riseup.net> * Add news Signed-off-by: Filipe Laíns <lains@riseup.net> * Always set LIBDEST and BINLIBDEST based on PLATLIBDIR Signed-off-by: Filipe Laíns <lains@riseup.net> * Add XXX comment on PLATLIBDIR default value Signed-off-by: Filipe Laíns <lains@riseup.net> * Regen configure Signed-off-by: Filipe Laíns <lains@riseup.net> --------- Signed-off-by: Filipe Laíns <lains@riseup.net>
1 parent b5576d8 commit 7f497c3

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

Makefile.pre.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ WHEEL_PKG_DIR= @WHEEL_PKG_DIR@
166166

167167
# Detailed destination directories
168168
BINLIBDEST= @BINLIBDEST@
169-
LIBDEST= $(SCRIPTDIR)/python$(VERSION)$(ABI_THREAD)
169+
LIBDEST= @LIBDEST@
170170
INCLUDEPY= $(INCLUDEDIR)/python$(LDVERSION)
171171
CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(LDVERSION)
172172

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Honor :option:`--with-platlibdir` in the pure-Python standard library
2+
installation path, if ``PLATLIBDIR`` doesn't match the value used in
3+
``LIBDIR``.

configure

Lines changed: 9 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6420,15 +6420,10 @@ if test "$ac_sys_system" = "iOS"; then
64206420
MODULE_DEPS_SHARED="$MODULE_DEPS_SHARED \$(PYTHONFRAMEWORKDIR)/\$(PYTHONFRAMEWORK)"
64216421
fi
64226422

6423-
6424-
AC_SUBST([BINLIBDEST])
6425-
BINLIBDEST='$(LIBDIR)/python$(VERSION)$(ABI_THREAD)'
6426-
6427-
64286423
# Check for --with-platlibdir
64296424
# /usr/$PLATLIBDIR/python$(VERSION)$(ABI_THREAD)
64306425
AC_SUBST([PLATLIBDIR])
6431-
PLATLIBDIR="lib"
6426+
PLATLIBDIR="lib" # XXX: We should probably calculate the defauly from libdir, if defined.
64326427
AC_MSG_CHECKING([for --with-platlibdir])
64336428
AC_ARG_WITH(
64346429
[platlibdir],
@@ -6445,19 +6440,22 @@ if test -n "$withval" -a "$withval" != yes -a "$withval" != no
64456440
then
64466441
AC_MSG_RESULT([yes])
64476442
PLATLIBDIR="$withval"
6448-
BINLIBDEST='${exec_prefix}/${PLATLIBDIR}/python$(VERSION)$(ABI_THREAD)'
64496443
else
64506444
AC_MSG_RESULT([no])
64516445
fi],
64526446
[AC_MSG_RESULT([no])])
64536447

6448+
AC_SUBST([LIBDEST])
6449+
AC_SUBST([BINLIBDEST])
6450+
LIBDEST='${prefix}/${PLATLIBDIR}/python$(VERSION)$(ABI_THREAD)'
6451+
BINLIBDEST='${exec_prefix}/${PLATLIBDIR}/python$(VERSION)$(ABI_THREAD)'
64546452

64556453
dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
64566454
AC_SUBST([PY_ENABLE_SHARED])
64576455
if test x$PLATFORM_TRIPLET = x; then
6458-
LIBPL='$(prefix)'"/${PLATLIBDIR}/python${VERSION}${ABI_THREAD}/config-${LDVERSION}"
6456+
LIBPL='$(LIBDEST)'"/config-${LDVERSION}"
64596457
else
6460-
LIBPL='$(prefix)'"/${PLATLIBDIR}/python${VERSION}${ABI_THREAD}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
6458+
LIBPL='$(LIBDEST)'"/config-${LDVERSION}-${PLATFORM_TRIPLET}"
64616459
fi
64626460
AC_SUBST([LIBPL])
64636461

0 commit comments

Comments
 (0)