GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-115119: Fix libmpdec detection when pkg-config files are missing by stratakis · Pull Request #150502 · python/cpython Conversation
|
|
Found when trying to test what configure options to add for my buildbots and I saw the _decimal module wasn't actually building on centos stream 9 and 10, because they ship mpdecimal 2.5.1, hence no .pc files. I followed the convention of other libraries. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Could you please add a news entry? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM (modulo news entry)
Thanks for fixing this, it was my fault to believe, that pkg-config support was introduced in v2.5.0. But it was v4.0.0.
(Tested with v2.5.0)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
How can I test this change? I need a system with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
You can install libmpdec from sources for versions < 4.0.0. (./configure && make all install) I also checked Debian and derivatives, nobody ships *.pc files as a patch :(. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I applied the following change on diff --git a/configure.ac b/configure.ac index c8dce3fd49b..b9020368664 100644 --- a/configure.ac +++ b/configure.ac @@ -4376,7 +4376,7 @@ if test "$ac_cv_ffi_complex_double_supported" = "yes"; then fi dnl Check for libmpdec >= 2.5.0 -PKG_CHECK_MODULES([LIBMPDEC], [libmpdec >= 2.5.0], [have_mpdec=yes], [ +PKG_CHECK_MODULES([LIBMPDEC], [libmpdec >= 55.0], [have_mpdec=yes], [ WITH_SAVE_ENV([ CPPFLAGS="$CPPFLAGS $LIBMPDEC_CFLAGS" LIBS="$LIBS $LIBMPDEC_LIBS"
I downloaded this PR, made a similar I get these flags in Python builds successfully and I can import the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ], [const char *x = mpd_version();])], | ||
| [have_mpdec=yes], | ||
| [have_mpdec=no]) | ||
| AC_CHECK_HEADER([mpdecimal.h], [ |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
AC_CHECK_HEADER([mpdecimal.h] seems to be redundant to me. Is it really useful? We already check we can build/link a C program which starts with #include <mpdecimal.h> (below).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think it's good to have it there for the helpful error message, referencing that the header is missing aka "checking for mpdecimal.h... no". In the case the library is there without the header it will move on to compile the program with "checking for mpd_version in -lmpdec... yes" and then fail.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Agreed. These checks are logically distinct: first is for the header, next is for the library version.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Merged, thanks for the fix. The 3.15 branch has different code in configure.ac, it doesn't seem to be affected. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Old releases are affected. But in such cases the fallback is using bundled libmpdec, instead of undetected from the system. I think it's less severe issue, probably not worth to be fixed. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I don't see any issues via testing on previous branches, some stale makefile rules but if the system libmpdec option is used then it will properly link to that one without building the bundled one. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
I don't understand how this could be. See code e.g. in the v3.14: Lines 4218 to 4232 in 7756f59
If PKG_CHECK_MODULES() fails - USE_BUNDLED_LIBMPDEC() is used with with_system_libmpdec=no. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
USE_BUNDLED_LIBMPDEC() is the argument to AS_VAR_IF() so it won't fall through if PKG_CHECK_MODULES() fails. I've also verified this on a Centos Stream 9 machine on the 3.14 branch, no bundled object files and _decimal.so is linked against the system library (assuming of course I tested properly). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.