gh-115119: Removed bundled copy of the libmpdec#133964
Conversation
7cba56a to
9d6c9b5
Compare
AA-Turner
left a comment
There was a problem hiding this comment.
quick comments, haven't looked at build system changes
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
0a33f9f to
2ba6b8b
Compare
ned-deily
left a comment
There was a problem hiding this comment.
Mac/Buildscript/build-installer.py change LGTM
| * Remove the bundled libmpdec_ decimal library from the CPython source tree, | ||
| to simplify maintenence and updates. The :mod:`decimal` module will now | ||
| unconditionally use the system's libmpdec decimal library. Also remove the | ||
| now unused :option:`!--with-system-libmpdec` :program:`configure` flag. |
There was a problem hiding this comment.
We should probably mention that binary distributions will still include the _decimal module with libmpdec compiled in.
| decimal.so is not built from a static libmpdec.a since doing so led to | ||
| failures on AIX (user report) and Windows (mixing static and dynamic CRTs | ||
| causes locale problems and more). | ||
|
|
There was a problem hiding this comment.
Nit: most of this is out of date, and there are more extra blank lines at the top of the file.
There was a problem hiding this comment.
Are you OK with removal of this?
There was a problem hiding this comment.
Either removal or paring it back to just the About section would be my preference.
There was a problem hiding this comment.
There's also a Scratch that, we still use Modules/_decimal/windows/ directory to remove, and arguably Modules/_decimal/tests/.Modules/_decimal/windows/mpdecimal.h. Still on the fence about tests/, though.
There was a problem hiding this comment.
Still on the fence about tests/, though.
Why? We don't have any tests for the decimal module in th pybenchmark. Yet, have severe regressions since 3.9+. I don't think that removal of tests is a good idea.
At least, that should go to another pr.
There was a problem hiding this comment.
As far as I can tell, these tests are not run by regrtest and are mostly relevant to libmpdec rather than _decimal. I mostly just don't see why they're here. If they're important enough to keep, they're important enough to wire into regrtest.
Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
sethmlarson
left a comment
There was a problem hiding this comment.
Reviewed the changes to sbom.spdx.json and generate_sbom.py and those changes LGTM.
zware
left a comment
There was a problem hiding this comment.
Quite close, I think, just a few more cleanups.
| decimal.so is not built from a static libmpdec.a since doing so led to | ||
| failures on AIX (user report) and Windows (mixing static and dynamic CRTs | ||
| causes locale problems and more). | ||
|
|
There was a problem hiding this comment.
Either removal or paring it back to just the About section would be my preference.
| decimal.so is not built from a static libmpdec.a since doing so led to | ||
| failures on AIX (user report) and Windows (mixing static and dynamic CRTs | ||
| causes locale problems and more). | ||
|
|
There was a problem hiding this comment.
There's also a Scratch that, we still use Modules/_decimal/windows/ directory to remove, and arguably Modules/_decimal/tests/.Modules/_decimal/windows/mpdecimal.h. Still on the fence about tests/, though.
| * Remove the bundled copy of the libmpdec_ decimal library from the CPython source tree | ||
| to simplify maintenence and updates. The :mod:`decimal` module will now | ||
| unconditionally use the system's libmpdec decimal library. Also remove the | ||
| now unused :option:`!--with-system-libmpdec` :program:`configure` flag. |
There was a problem hiding this comment.
This could still use a note to the following effect:
| now unused :option:`!--with-system-libmpdec` :program:`configure` flag. | |
| now unused :option:`!--with-system-libmpdec` :program:`configure` flag. | |
| This change has no impact on binary releases of Python, which have been | |
| built against a separate copy of libmpdec for the past several releases. |
| Previously, the :mod:`!_decimal` C extension underlying the :mod:`decimal` module | ||
| was built using an included copy of the libmpdec | ||
| library unless the build is configured ``--with-system-libmpdec``:: |
There was a problem hiding this comment.
Wouldn't hurt to fix the libffi section as well. Suggested wording here, though:
| Previously, the :mod:`!_decimal` C extension underlying the :mod:`decimal` module | |
| was built using an included copy of the libmpdec | |
| library unless the build is configured ``--with-system-libmpdec``:: | |
| The :mod:`!_decimal` C extension underlying the :mod:`decimal` module | |
| is linked to the libmpdec C library:: |
On the other hand, we could just leave this file alone for now and get someone more knowledgeable about such things to tell us what we should do in a separate issue :)
| if test "$have_mpdec" = "no" | ||
| then | ||
| AS_VAR_SET([py_cv_module_]_decimal, [missing]) | ||
| fi |
There was a problem hiding this comment.
Not quite the change I meant; this whole check should be completely unnecessary:
| if test "$have_mpdec" = "no" | |
| then | |
| AS_VAR_SET([py_cv_module_]_decimal, [missing]) | |
| fi |
The PY_STDLIB_MOD macro below just does what's needed.
| # Disable forced inlining in debug builds, see GH-94847 | ||
| AS_VAR_IF( | ||
| [with_pydebug], [yes], | ||
| [AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -DTEST_COVERAGE"])]) |
There was a problem hiding this comment.
This is only relevant for building libmpdec itself, isn't it?
There is a usage of TEST_COVERAGE in Modules/_decimal/_decimal.c, but I don't see anything ever defining it for that module.
| [with_pydebug], [yes], | ||
| [AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -DTEST_COVERAGE"])]) | ||
|
|
||
| AC_SUBST([LIBMPDEC_CFLAGS]) |
| decimal.so is not built from a static libmpdec.a since doing so led to | ||
| failures on AIX (user report) and Windows (mixing static and dynamic CRTs | ||
| causes locale problems and more). | ||
|
|
There was a problem hiding this comment.
As far as I can tell, these tests are not run by regrtest and are mostly relevant to libmpdec rather than _decimal. I mostly just don't see why they're here. If they're important enough to keep, they're important enough to wire into regrtest.
libmpdecsources #115119📚 Documentation preview 📚: https://cpython-previews--133964.org.readthedocs.build/