Skip to content

gh-115119: Fall back to bundled libmpdec if system libmpdec is not found - #119196

Merged
erlend-aasland merged 1 commit into
python:mainfrom
erlend-aasland:libmpdec-fallback
May 20, 2024
Merged

erlend-aasland merged 1 commit into
python:mainfrom
erlend-aasland:libmpdec-fallback

Conversation

@erlend-aasland

@erlend-aasland erlend-aasland commented May 20, 2024 •

Copy link
Copy Markdown
Contributor
$ brew unlink libmpdec
$ ./configure --with-system-libmpdec | grep -E "(decimal|mpdec)"
checking for --with-system-libmpdec... yes
checking for libmpdec >= 2.5.0... no
configure: WARNING: no system libmpdecimal found; falling back to bundled libmpdecimal (deprecated and scheduled for removal in Python 3.15)
checking for --with-decimal-contextvar... yes
checking for decimal libmpdec machine... universal
checking for stdlib extension module _decimal... yes
$ grep 'DECIMAL_.*FLAGS' Makefile
MODULE__DECIMAL_CFLAGS=-I$(srcdir)/Modules/_decimal/libmpdec -DUNIVERSAL=1
MODULE__DECIMAL_LDFLAGS=-lm $(LIBMPDEC_A)

$ ./configure | grep -E "(decimal|mpdec)"
checking for --with-system-libmpdec... yes
checking for libmpdec >= 2.5.0... no
configure: WARNING: no system libmpdecimal found; falling back to bundled libmpdecimal (deprecated and scheduled for removal in Python 3.15)
checking for --with-decimal-contextvar... yes
checking for decimal libmpdec machine... universal
checking for stdlib extension module _decimal... yes
$ grep 'DECIMAL_.*FLAGS' Makefile
MODULE__DECIMAL_CFLAGS=-I$(srcdir)/Modules/_decimal/libmpdec -DUNIVERSAL=1
MODULE__DECIMAL_LDFLAGS=-lm $(LIBMPDEC_A)

$ ./configure --without-system-libmpdec | grep -E "(decimal|mpdec)"
checking for --with-system-libmpdec... no
configure: WARNING: the bundled copy of libmpdecimal is scheduled for removal in Python 3.15; consider using a system installed mpdecimal library.
checking for --with-decimal-contextvar... yes
checking for decimal libmpdec machine... universal
checking for stdlib extension module _decimal... yes
$ grep ‘DECIMAL_.*FLAGS’ Makefile
MODULE__DECIMAL_CFLAGS=-I$(srcdir)/Modules/_decimal/libmpdec -DUNIVERSAL=1
MODULE__DECIMAL_LDFLAGS=-lm $(LIBMPDEC_A)

$ brew link libmpdec
$ ./configure --with-system-libmpdec | grep -E "(decimal|mpdec)"
checking for --with-system-libmpdec... yes
checking for libmpdec >= 2.5.0... yes
checking for --with-decimal-contextvar... yes
checking for stdlib extension module _decimal... yes
$ grep ‘DECIMAL_.*FLAGS’ Makefile
MODULE__DECIMAL_CFLAGS=-I/opt/homebrew/Cellar/mpdecimal/4.0.0/include
MODULE__DECIMAL_LDFLAGS=-L/opt/homebrew/Cellar/mpdecimal/4.0.0/lib -lmpdec -lm
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @erlend-aasland for commit c537d8b 🤖

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label May 20, 2024

@ned-deily ned-deily left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

@erlend-aasland

erlend-aasland commented May 20, 2024 •

Copy link
Copy Markdown
Contributor Author

Thanks for the review, Ned! FTR, the buildbot failures all seem unrelated1

Footnotes

  1. buildbot/PPC64LE Fedora Stable Refleaks PR is another regression I introduced in sqlite3; PR is already up merged 😄 ↩

@erlend-aasland

Copy link
Copy Markdown
Contributor Author

I'll wait for Zach to chime in before landing.

@vstinner

Copy link
Copy Markdown
Member

cc @hroncok who had issues with this issue.

@erlend-aasland

Copy link
Copy Markdown
Contributor Author

Merging, as per Ned's comment on Discord.

@erlend-aasland
erlend-aasland merged commit 642b25b into python:main May 20, 2024
@erlend-aasland
erlend-aasland deleted the libmpdec-fallback branch May 20, 2024 14:58
@miss-islington-app

This comment was marked as outdated.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 20, 2024
…not found (pythonGH-119196)

(cherry picked from commit 642b25b)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
@bedevere-app

bedevere-app Bot commented May 20, 2024

Copy link
Copy Markdown

GH-119217 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label May 20, 2024
erlend-aasland added a commit to erlend-aasland/cpython that referenced this pull request May 20, 2024
erlend-aasland added a commit that referenced this pull request May 20, 2024
erlend-aasland added a commit that referenced this pull request May 20, 2024
… not found (GH-119196) (#119217)

(cherry picked from commit 642b25b)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants