Skip to content

gh-115119: removed implicit fallback to the bundled libmpdec #134078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

skirpichev
Copy link
Contributor

@skirpichev skirpichev commented May 16, 2025

@bedevere-app bedevere-app bot mentioned this pull request May 16, 2025
15 tasks
@skirpichev
Copy link
Contributor Author

skirpichev commented May 16, 2025

On top of configure changes in #133997.

N/B: all linux jobs, except for changed (not sure if it worth) - have no system libmpdec. For MacOS we run tests with system libmpdec.

@skirpichev skirpichev marked this pull request as ready for review May 16, 2025 06:59
configure.ac Outdated
Comment on lines 4141 to 4144
[AC_MSG_WARN([m4_normalize([
no system libmpdecimal found; falling back to bundled libmpdecimal
(deprecated and scheduled for removal in Python 3.15)])])
USE_BUNDLED_LIBMPDEC()])
no system libmpdecimal found; falling back to pure-Python version
for the decimal module])])
AS_VAR_SET([py_cv_module_]_decimal, [n/a])])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AC_MSG_ERROR? I think opting in to the pure Python version should be explicit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AC_MSG_ERROR ?

Well, that could be an option.

Though, more complex wrt implementation: all linux jobs will fail, unless we either provide system libmpdec or change ./configure invocations to use a new option.

I think opting in to the pure Python version should be explicit.

I'm not sure it's useful. After all, the pure-Python version is always available as the _pydecimal.py.

Did you suggest a new option like --with-purepython-decimal?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A warning is actually ok, but users may not see it and then, they would have a slow version of decimal. OTOH, an error might be too abrupt but at least the tansition would be more explicit and would force people to upgrade if they want an efficient way to do it.

I'm +0.25 for AC_MSG_ERROR just to force people to update. We can add an option --allow-fallback-to-pydecimal to handle CI possible failures, though this means that devs should be aware that their C code might not be tested in the CI due to that.

picnixz

This comment was marked as resolved.

Co-authored-by: Victor Stinner <vstinner@python.org>
@@ -23,4 +29,5 @@ apt-get -yq install \
tk-dev \
uuid-dev \
xvfb \
zlib1g-dev
zlib1g-dev \
libmpdec-dev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep this list alphabetical.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't:) It's already non-alphabetical. Should I fix that?

@skirpichev skirpichev requested a review from hugovk June 10, 2025 02:15
@@ -851,6 +851,12 @@ Libraries options

.. seealso:: :option:`LIBMPDEC_CFLAGS` and :option:`LIBMPDEC_LIBS`.

.. option:: --with-libmpdec

Whether to build the ``_decimal`` extension module.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you document the default value?

Whether to build the ``_decimal`` extension module (default: yes).

I suggest to add:

See also the :option:`--with-system-libmpdec` option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants