gh-115119: Remove implicit fallback to the bundled libmpdec (#134078) · python/cpython@17cf0a3 · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

Commit 17cf0a3

Browse files
skirpichevvstinnerhugovk
authored
gh-115119: Remove implicit fallback to the bundled libmpdec (#134078)
Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent 93809a9 commit 17cf0a3

File tree

5 files changed

+57
-45
lines changed

5 files changed

+57
-45
lines changed

.github/workflows/posix-deps-apt.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,10 @@ apt-get -yq install \
2525
uuid-dev \
2626
xvfb \
2727
zlib1g-dev
28+
29+
# Workaround missing libmpdec-dev on ubuntu 24.04:
30+
# https://launchpad.net/~ondrej/+archive/ubuntu/php
31+
# https://deb.sury.org/
32+
sudo add-apt-repository ppa:ondrej/php
33+
apt-get update
34+
apt-get -yq install libmpdec-dev

Doc/whatsnew/3.15.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,11 @@ that may require changes to your code.
310310
Build changes
311311
=============
312312

313+
* Removed implicit fallback to the bundled copy of the ``libmpdec`` library.
314+
Now this should be explicitly enabled with :option:`--with-system-libmpdec`
315+
set to ``no`` or with :option:`!--without-system-libmpdec`.
316+
(Contributed by Sergey B Kirpichev in :gh:`115119`.)
317+
313318

314319
C API changes
315320
=============
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Removed implicit fallback to the bundled copy of the ``libmpdec`` library.
2+
Now this should be explicitly enabled via :option:`--with-system-libmpdec`
3+
set to ``no`` or :option:`!--without-system-libmpdec`. Patch by Sergey
4+
B Kirpichev.

configure

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

configure.ac

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4169,31 +4169,30 @@ fi
41694169

41704170
# Check for use of the system libmpdec library
41714171
AC_MSG_CHECKING([for --with-system-libmpdec])
4172+
AC_DEFUN([USE_BUNDLED_LIBMPDEC],
4173+
[LIBMPDEC_CFLAGS="-I\$(srcdir)/Modules/_decimal/libmpdec"
4174+
LIBMPDEC_LIBS="-lm \$(LIBMPDEC_A)"
4175+
LIBMPDEC_INTERNAL="\$(LIBMPDEC_HEADERS) \$(LIBMPDEC_A)"
4176+
have_mpdec=yes
4177+
with_system_libmpdec=no])
41724178
AC_ARG_WITH(
41734179
[system_libmpdec],
41744180
[AS_HELP_STRING(
41754181
[--with-system-libmpdec],
41764182
[build _decimal module using an installed mpdecimal library, see Doc/library/decimal.rst (default is yes)]
41774183
)],
4178-
[],
4184+
[AS_IF([test "x$with_system_libmpdec" = xno],
4185+
[USE_BUNDLED_LIBMPDEC()])],
41794186
[with_system_libmpdec="yes"])
41804187
AC_MSG_RESULT([$with_system_libmpdec])
41814188

4182-
AC_DEFUN([USE_BUNDLED_LIBMPDEC],
4183-
[LIBMPDEC_CFLAGS="-I\$(srcdir)/Modules/_decimal/libmpdec"
4184-
LIBMPDEC_LIBS="-lm \$(LIBMPDEC_A)"
4185-
LIBMPDEC_INTERNAL="\$(LIBMPDEC_HEADERS) \$(LIBMPDEC_A)"
4186-
have_mpdec=yes
4187-
with_system_libmpdec=no])
4188-
41894189
AS_VAR_IF(
41904190
[with_system_libmpdec], [yes],
41914191
[PKG_CHECK_MODULES(
41924192
[LIBMPDEC], [libmpdec >= 2.5.0], [],
41934193
[LIBMPDEC_CFLAGS=${LIBMPDEC_CFLAGS-""}
41944194
LIBMPDEC_LIBS=${LIBMPDEC_LIBS-"-lmpdec -lm"}
4195-
LIBMPDEC_INTERNAL=])],
4196-
[USE_BUNDLED_LIBMPDEC()])
4195+
LIBMPDEC_INTERNAL=])])
41974196

41984197
AS_VAR_IF([with_system_libmpdec], [yes],
41994198
[WITH_SAVE_ENV([
@@ -4209,16 +4208,7 @@ AS_VAR_IF([with_system_libmpdec], [yes],
42094208
], [const char *x = mpd_version();])],
42104209
[have_mpdec=yes],
42114210
[have_mpdec=no])
4212-
])],
4213-
[AC_MSG_WARN([m4_normalize([
4214-
the bundled copy of libmpdecimal is scheduled for removal in Python 3.15;
4215-
consider using a system installed mpdecimal library.])])])
4216-
4217-
AS_IF([test "$with_system_libmpdec" = "yes" && test "$have_mpdec" = "no"],
4218-
[AC_MSG_WARN([m4_normalize([
4219-
no system libmpdecimal found; falling back to bundled libmpdecimal
4220-
(deprecated and scheduled for removal in Python 3.15)])])
4221-
USE_BUNDLED_LIBMPDEC()])
4211+
])])
42224212

42234213
# Disable forced inlining in debug builds, see GH-94847
42244214
AS_VAR_IF(
@@ -8136,6 +8126,16 @@ PY_STDLIB_MOD([_curses_panel],
81368126
PY_STDLIB_MOD([_decimal],
81378127
[], [test "$have_mpdec" = "yes"],
81388128
[$LIBMPDEC_CFLAGS], [$LIBMPDEC_LIBS])
8129+
8130+
AS_VAR_IF([with_system_libmpdec], [no],
8131+
[AC_MSG_WARN([m4_normalize([
8132+
the bundled copy of libmpdecimal is scheduled for removal in Python 3.16;
8133+
consider using a system installed mpdecimal library.])])])
8134+
AS_IF([test "$with_system_libmpdec" = "yes" && test "$have_mpdec" = "no"],
8135+
[AC_MSG_WARN([m4_normalize([
8136+
no system libmpdecimal found; falling back to pure-Python version
8137+
for the decimal module])])])
8138+
81398139
PY_STDLIB_MOD([_dbm],
81408140
[test -n "$with_dbmliborder"], [test "$have_dbm" != "no"],
81418141
[$DBM_CFLAGS], [$DBM_LIBS])

0 commit comments

Comments
 (0)

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.