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
Unvendor libmpdec
sources
#115119
Comments
+1 for an autoconf warning. |
Adding an external libmpdec to the macOS installer build shouldn't be a big issue. Assign it to me if you proceed with this. |
FTR: the source deps repo is now updated. |
@ned-deily: for build-installer.py, is there more to do than adding a configuration for mpdecimal? I've used the following |
Likely yes, I'll take care of it. Thanks. |
I took a quick look at this and be aware that this change proposal will likely impact everyone building Python 3.13 on macOS. macOS does not ship a copy of libmpdec so, if the bundled version is removed, anyone building Python on macOS will now need to provide a local copy, either building from source or using a version from one of the widely-used third-party package managers, like Homebrew or MacPorts. Both currently have |
Last time I checked, libmpdec did not provide pkgconfig files: $ ls $(brew --prefix libmpdec)/lib/pkgconfig
ls: /opt/homebrew/opt/mpdecimal/lib/pkgconfig: No such file or directory
$ cd mpdecimal-2.5.1; find . | grep pkg
$ |
With the current 4.0.0 version, it appears both Homebrew and MacPorts ship them:
|
Yes, the 4.0.0 version does indeed provide pkg-config configuration files. I'll work on an Autoconf patch. |
Only libmpdec 4.0.0 supports pkg-config.
This includes adding what should be a relatively temporary `Modules/_decimal/windows/mpdecimal.h` shim to choose between `mpdecimal32vc.h` or `mpdecimal64vc.h` based on which of `CONFIG_64` or `CONFIG_32` is defined.
…-115182) This includes adding what should be a relatively temporary `Modules/_decimal/windows/mpdecimal.h` shim to choose between `mpdecimal32vc.h` or `mpdecimal64vc.h` based on which of `CONFIG_64` or `CONFIG_32` is defined.
…-115182) This includes adding what should be a relatively temporary `Modules/_decimal/windows/mpdecimal.h` shim to choose between `mpdecimal32vc.h` or `mpdecimal64vc.h` based on which of `CONFIG_64` or `CONFIG_32` is defined.
…-115182) This includes adding what should be a relatively temporary `Modules/_decimal/windows/mpdecimal.h` shim to choose between `mpdecimal32vc.h` or `mpdecimal64vc.h` based on which of `CONFIG_64` or `CONFIG_32` is defined.
pkg-config is supported for libmpdec 4.0.0 and newer.
@zware are we still aiming for 3.13 for the first batch of items? |
Resolved by: |
I would like to, but I don't know when I'm going to have a chance to get back to this. |
There is an issue with unvendoring on macOS that will affect some users (and this may be something you ran into when testing, @erlend-aasland). For some reason, mpdecimal, for both 2.5.1 and 4.0.0, chooses to define By default, the libmpdec build produces both shared and a static libraries. On macOS, the shared library install name looks like this:
Note the
An To further cloud the issue, it appears that Homebrew, when building and installing its mpdecimal package, converts the
and, at the moment, MacPorts does not:
Also, like most similar packages providing libraries, mpdecimal by default installs both a shared library and a static (.a) library but the linker will normally always prefer a shared library when both are present in the same directory. Both Homebrew and MacPorts install both. AFAICT, this leaves the following scenarios as of now when building 3.13 with
Now there are various workarounds that I can think of to get around the situations where you are using an environment that contains a pre-built libmpdec with the default The big question I have is how best to document this to minimize the impact on the various categories of users. At this point, I don't have good answers and I feel I can't spend any more time on this prior to feature code cutoff. But we shouldn't impose this change on users until we can fully explain its impact and how to workaround it. |
(Opened MacPorts issue: https://trac.macports.org/ticket/69870) |
Thank you for chiming in, Ned! I'll look into how to improve the docs here. Even with the extra week before the feature freeze, it's going to be hard to land this nicely. I may find some time for this later this week, but I can't (and won't, and should not) promise anything.
Yes, this may explain my issues from some weeks ago.
For this case, we should consider marking |
To facilitate cleaner updates of the externally-maintained
libmpdec
required by the_decimal
module, we should migrate away from the bundled copy inModules/_decimal/libmpdec
and towards an "external" incpython-source-deps
for Windows and--with-system-libmpdec
by default elsewhere.My tentative plan is as follows:
mpdecimal-2.5.1
andmpdecimal-4.0.0
tocpython-source-deps
:mpdecimal-2.5.1
external (gh-115119: Switch Windows build to mpdecimal external #115182)mpdecimal-4.0.0
configure.ac
to default to--with-system-libmpdec
, with a fallback to the bundled copy (maybe with a warning?)--with[out]-system-libmpdec
is not specified and the system lib is not found--without-system-libmpdec
--with-system-libmpdec
--with[out]-system-libmpdec
configure
options andModules/_decimal/libmpdec/
Linked PRs
The text was updated successfully, but these errors were encountered: