.. versionadded:: 3.15
+.. option:: --with-build-details-suffix=[yes|SUFFIX]
+
+ Rename ``build-details.json`` to permit multiple co-located Python
+ installs. If a custom ``SUFFIX`` is supplied it is used verbatim,
+ otherwise one will be generated from the ``MULTIARCH`` tag with
+ ``-free-threading`` and ``-debug``, as appropriate.
+
+ .. versionadded:: 3.16
+
C compiler options
------------------
.. _libmpdec: https://www.bytereef.org/mpdecimal/
+* Add a :option:`--with-build-details-suffix` configure flag to allow
+ Linux distributions that co-install multiple versions of Python in the
+ same tree to avoid ``build-details.json`` clashes.
+
+ (Contributed by Stefano Rivera in :gh:`131372`.)
+
C API changes
=============
# the build, and is only listed here so it will be included in sysconfigdata.
IPHONEOS_DEPLOYMENT_TARGET=@IPHONEOS_DEPLOYMENT_TARGET@
+BUILD_DETAILS=@BUILD_DETAILS@
+
# Option to install to strip binaries
STRIPFLAG=-s
.PHONY: build_all
build_all: check-clean-src check-app-store-compliance $(BUILDPYTHON) platform sharedmods \
- gdbhooks Programs/_testembed scripts checksharedmods rundsymutil build-details.json
+ gdbhooks Programs/_testembed scripts checksharedmods rundsymutil $(BUILD_DETAILS)
.PHONY: build_wasm
build_wasm: check-clean-src $(BUILDPYTHON) platform sharedmods \
- python-config checksharedmods build-details.json
+ python-config checksharedmods $(BUILD_DETAILS)
.PHONY: build_emscripten
build_emscripten: build_wasm web_example web_example_pyrepl_jspi
exit 1 ; \
fi
-build-details.json: pybuilddir.txt
- $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/Tools/build/generate-build-details.py `cat pybuilddir.txt`/build-details.json
+$(BUILD_DETAILS): pybuilddir.txt
+ $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/Tools/build/generate-build-details.py `cat pybuilddir.txt`/$(BUILD_DETAILS)
# Build static library
$(LIBRARY): $(LIBRARY_OBJS)
# Only the main install gets a build-details.json.
.PHONY: install
install: @FRAMEWORKINSTALLFIRST@ @INSTALLTARGETS@ @FRAMEWORKINSTALLLAST@
- $(INSTALL_DATA) `cat pybuilddir.txt`/build-details.json $(DESTDIR)$(LIBDEST); \
+ $(INSTALL_DATA) `cat pybuilddir.txt`/$(BUILD_DETAILS) $(DESTDIR)$(LIBDEST); \
if test "x$(ENSUREPIP)" != "xno" ; then \
case $(ENSUREPIP) in \
upgrade) ensurepip="--upgrade" ;; \
--- /dev/null
+Add a :option:`--with-build-details-suffix` configure flag to allow Linux
+distributions that co-install multiple versions of Python in the same tree
+to avoid ``build-details.json`` clashes.
MODULE__IO_TRUE
MODULE_BUILDTYPE
_PYTHREAD_NAME_MAXLEN
+BUILD_DETAILS
TEST_MODULES
OPENSSL_LDFLAGS
OPENSSL_LIBS
with_ssl_default_suites
with_builtin_hashlib_hashes
enable_test_modules
+with_build_details_suffix
'
ac_precious_vars='build_alias
host_alias
--with-builtin-hashlib-hashes=md5,sha1,sha2,sha3,blake2
builtin hash modules, md5, sha1, sha2, sha3 (with
shake), blake2
+ --with-build-details-suffix=
+ rename build-details.json to permit multiple
+ colocated Python installs; optionally specify a
+ custom suffix (default: no)
Some influential environment variables:
PKG_CONFIG path to pkg-config utility
printf "%s\n" "$TEST_MODULES" >&6; }
+# Check for --with-build-details-suffix
+BUILD_DETAILS=build-details.json
+
+# Check whether --with-build-details-suffix was given.
+if test ${with_build_details_suffix+y}
+then :
+ withval=$with_build_details_suffix;
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-build-details-suffix" >&5
+printf %s "checking for --with-build-details-suffix... " >&6; }
+ if test "x$with_build_detials_suffix" = xno
+then :
+ as_fn_error $? "invalid --with-build-details-suffix option: expected custom suffix or \"yes\", not \"no\"" "$LINENO" 5
+
+fi
+ if test "x$with_build_details_suffix" = xyes
+then :
+
+ colocated_install=yes
+ threading_suffix=""
+ if [ "$ABI_THREAD" = "t" ]; then
+ threading_suffix=-free-threading
+ fi
+ debug_suffix=""
+ if [ "$Py_DEBUG" = "true" ]; then
+ debug_suffix=-debug
+ fi
+ BUILD_DETAILS=build-details.$MULTIARCH$threading_suffix$debug_suffix.json
+
+else case e in #(
+ e)
+ BUILD_DETAILS=build-details.$with_build_details_suffix.json
+
+ ;;
+esac
+fi
+
+
+fi
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_build_details_suffix" >&5
+printf "%s\n" "$with_build_details_suffix" >&6; }
+BUILD_DETAILS=$BUILD_DETAILS
+
+
# gh-109054: Check if -latomic is needed to get <pyatomic.h> atomic functions.
# On Linux aarch64, GCC may require programs and libraries to be linked
# explicitly to libatomic. Call _Py_atomic_or_uint64() which may require
AC_MSG_RESULT([$TEST_MODULES])
AC_SUBST([TEST_MODULES])
+# Check for --with-build-details-suffix
+BUILD_DETAILS=build-details.json
+AC_ARG_WITH([build-details-suffix],
+ [AS_HELP_STRING(
+ [--with-build-details-suffix=],
+ [rename build-details.json to permit multiple colocated Python installs; optionally specify a custom suffix (default: no)]
+ )],
+ [
+ AC_MSG_CHECKING([for --with-build-details-suffix])
+ AS_VAR_IF(
+ [with_build_detials_suffix], [no],
+ [AC_MSG_ERROR([invalid --with-build-details-suffix option: expected custom suffix or "yes", not "no"])]
+ )
+ AS_VAR_IF(
+ [with_build_details_suffix], [yes], [
+ colocated_install=yes
+ threading_suffix=""
+ if [[ "$ABI_THREAD" = "t" ]]; then
+ threading_suffix=-free-threading
+ fi
+ debug_suffix=""
+ if [[ "$Py_DEBUG" = "true" ]]; then
+ debug_suffix=-debug
+ fi
+ BUILD_DETAILS=build-details.$MULTIARCH$threading_suffix$debug_suffix.json
+ ], [
+ BUILD_DETAILS=build-details.$with_build_details_suffix.json
+ ]
+ )
+ ]
+)
+AC_MSG_RESULT([$with_build_details_suffix])
+AC_SUBST([BUILD_DETAILS], [$BUILD_DETAILS])
+
# gh-109054: Check if -latomic is needed to get <pyatomic.h> atomic functions.
# On Linux aarch64, GCC may require programs and libraries to be linked
# explicitly to libatomic. Call _Py_atomic_or_uint64() which may require