Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-98707: Don't let --with-system-libmpdec / --with-system-expat use the vendored headers#98711

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
erlend-aasland merged 2 commits intopython:mainfromhroncok:with-system
Nov 11, 2022

Conversation

@hroncok
Copy link
Contributor

@hroncokhroncok commentedOct 26, 2022
edited
Loading

This was a regression in Python 3.12.0a2 that prevented Fedora doing this:

$ rm -r Modules/_decimal/libmpdec$ rm -r Modules/expat

Before building Python with --with-system-libmpdec --with-system-expat.

The errors were:

make: *** No rule to make target 'Modules/_decimal/libmpdec/basearith.h', needed by 'Modules/_decimal/_decimal.o'.  Stop.make: *** No rule to make target 'Modules/expat/ascii.h', needed by 'Modules/pyexpat.o'.  Stop.

Now the make-dependency on the headers only exists when --with-system-libmpdec / --with-system-expat isnot used.

Fixes#98707

@hroncok

This comment was marked as resolved.

hroncokand others added2 commitsOctober 27, 2022 15:28
…t use the vendored headersThis was a regression in Python 3.12.0a2 that prevented Fedora doing this:    $ rm -r Modules/_decimal/libmpdec    $ rm -r Modules/expatBefore building Python with --with-system-libmpdec --with-system-expat.The errors were:    make: *** No rule to make target 'Modules/_decimal/libmpdec/basearith.h', needed by 'Modules/_decimal/_decimal.o'.  Stop.    make: *** No rule to make target 'Modules/expat/ascii.h', needed by 'Modules/pyexpat.o'.  Stop.Now the make-dependency on the headers only existswhen --with-system-libmpdec / --with-system-expat is **not** used.Fixespython#98707
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
@merwok
Copy link
Member

Python PRs avoid rebases and force pushes because it creates ghost notifications and generally makes it harder for reviewers to see what has changed. All PRs are squash merged so the number and contents of commits does not matter.

(Because of another github UI problem, sometimes the final commit message is a super-long, not useful concatenation of all commit messages, but 🤷🏽)

erlend-aasland reacted with thumbs up emoji

@hroncok
Copy link
ContributorAuthor

hroncok commentedOct 27, 2022
edited
Loading

Since there is no way of fixing the commit message in a new commit and I do not have merge rights, I've decided to correct the typo instead of leaving it up to the merge-committer who might not notice it. If there is a better way of ensuring the typo won't make it to the final commit message, I will gladly do it that way the next time. Sorry for the trouble.

@erlend-aasland
Copy link
Contributor

Since there is no way of fixing the commit message in a new commit and I do not have merge rights, I've decided to correct the typo instead of leaving it up to the merge-committer who might not notice it. If there is a better way of ensuring the typo won't make it to the final commit message, I will gladly do it that way the next time. Sorry for the trouble.

Use the PR title. IIRC, we've updated the default commit message to be the PR title.

hroncok and AlexWaygood reacted with thumbs up emoji

@encukouencukou added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelNov 2, 2022
@encukouencukou added 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section and removed 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelsNov 9, 2022
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@encukou for commitcb7d840 🤖

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

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelNov 9, 2022
@vstinner
Copy link
Member

I tested different configurations: Python build works as expected.

main branch

Vendored libmpdec:

$ make distclean$ ./configure CFLAGS="-O0" && make 2>&1|tee make.log$ grep -E '^(MODULE_PYEXPAT_DEPS|MODULE__DECIMAL_DEPS|MODULE__ELEMENTTREE_DEPS)' MakefileMODULE_PYEXPAT_DEPS=$(LIBEXPAT_HEADERS) $(LIBEXPAT_A)MODULE__DECIMAL_DEPS=$(srcdir)/Modules/_decimal/docstrings.h $(LIBMPDEC_HEADERS) $(LIBMPDEC_A)MODULE__ELEMENTTREE_DEPS=$(srcdir)/Modules/pyexpat.c $(LIBEXPAT_HEADERS) $(LIBEXPAT_A)# no result: _decimal is not linked to libmpdec$ ldd $(./python -c 'import _decimal; print(_decimal.__file__)')|grep libmpdec

System libmpdec:

$ make distclean$ ./configure CFLAGS="-O0" --with-system-libmpdec && make 2>&1|tee make.log$ grep -E '^(MODULE_PYEXPAT_DEPS|MODULE__DECIMAL_DEPS|MODULE__ELEMENTTREE_DEPS)' MakefileMODULE_PYEXPAT_DEPS=$(LIBEXPAT_HEADERS) $(LIBEXPAT_A)MODULE__DECIMAL_DEPS=$(srcdir)/Modules/_decimal/docstrings.h $(LIBMPDEC_HEADERS) MODULE__ELEMENTTREE_DEPS=$(srcdir)/Modules/pyexpat.c $(LIBEXPAT_HEADERS) $(LIBEXPAT_A)$ ldd $(./python -c 'import _decimal; print(_decimal.__file__)')|grep libmpdeclibmpdec.so.3 => /lib64/libmpdec.so.3 (0x00007f79499af000)

And LIBMPDEC_HEADERS is defined in Makefile with:

LIBMPDEC_HEADERS= \$(srcdir)/Modules/_decimal/libmpdec/basearith.h \$(srcdir)/Modules/_decimal/libmpdec/bits.h \$(srcdir)/Modules/_decimal/libmpdec/constants.h \$(srcdir)/Modules/_decimal/libmpdec/convolute.h \$(srcdir)/Modules/_decimal/libmpdec/crt.h \$(srcdir)/Modules/_decimal/libmpdec/difradix2.h \$(srcdir)/Modules/_decimal/libmpdec/fnt.h \$(srcdir)/Modules/_decimal/libmpdec/fourstep.h \$(srcdir)/Modules/_decimal/libmpdec/io.h \$(srcdir)/Modules/_decimal/libmpdec/mpalloc.h \$(srcdir)/Modules/_decimal/libmpdec/mpdecimal.h \$(srcdir)/Modules/_decimal/libmpdec/numbertheory.h \$(srcdir)/Modules/_decimal/libmpdec/sixstep.h \$(srcdir)/Modules/_decimal/libmpdec/transpose.h \$(srcdir)/Modules/_decimal/libmpdec/typearith.h \$(srcdir)/Modules/_decimal/libmpdec/umodarith.h

This PR

Vendored libmpdec:

$ make distclean$ ./configure CFLAGS="-O0" && make 2>&1|tee make.log$ grep -E '^(MODULE_PYEXPAT_DEPS|MODULE__DECIMAL_DEPS|MODULE__ELEMENTTREE_DEPS)' MakefileMODULE_PYEXPAT_DEPS=$(LIBEXPAT_HEADERS) $(LIBEXPAT_A)MODULE__DECIMAL_DEPS=$(srcdir)/Modules/_decimal/docstrings.h $(LIBMPDEC_HEADERS) $(LIBMPDEC_A)MODULE__ELEMENTTREE_DEPS=$(srcdir)/Modules/pyexpat.c $(LIBEXPAT_HEADERS) $(LIBEXPAT_A)# no result: _decimal is not linked to libmpdec$ ldd $(./python -c 'import _decimal; print(_decimal.__file__)')|grep libmpdec

System libmpdec withoutModules/_decimal/libmpdec/ (removed):

$ rm -rf Modules/_decimal/libmpdec/$ make distclean$ ./configure CFLAGS="-O0" --with-system-libmpdec && make 2>&1|tee make.log$ grep -E '^(MODULE_PYEXPAT_DEPS|MODULE__DECIMAL_DEPS|MODULE__ELEMENTTREE_DEPS)' MakefileMODULE_PYEXPAT_DEPS=$(LIBEXPAT_HEADERS) $(LIBEXPAT_A)MODULE__DECIMAL_DEPS=$(srcdir)/Modules/_decimal/docstrings.h MODULE__ELEMENTTREE_DEPS=$(srcdir)/Modules/pyexpat.c $(LIBEXPAT_HEADERS) $(LIBEXPAT_A)$ ldd $(./python -c 'import _decimal; print(_decimal.__file__)')|grep libmpdeclibmpdec.so.3 => /lib64/libmpdec.so.3 (0x00007f3aa03ff000)

=>Good, as expected, LIBMPDEC_HEADERS no longer in MODULE__DECIMAL_DEPS.

I also tested:system libmpdec withoutModules/_decimal/libmpdec/ (removed) andsystem expat withoutModules/expat/ (removed):

$ rm -rf Modules/_decimal/libmpdec/ Modules/expat/$ make distclean$ ./configure CFLAGS="-O0" --with-system-libmpdec --with-system-expat && make 2>&1|tee make.log$ grep -E '^(MODULE_PYEXPAT_DEPS|MODULE__DECIMAL_DEPS|MODULE__ELEMENTTREE_DEPS)' MakefileMODULE_PYEXPAT_DEPS=MODULE__DECIMAL_DEPS=$(srcdir)/Modules/_decimal/docstrings.h MODULE__ELEMENTTREE_DEPS=$(srcdir)/Modules/pyexpat.c $ ldd $(./python -c 'import _decimal; print(_decimal.__file__)')|grep libmpdeclibmpdec.so.3 => /lib64/libmpdec.so.3 (0x00007fe29b855000)$ ldd $(./python -c 'import pyexpat; print(pyexpat.__file__)')|grep expatlibexpat.so.1 => /lib64/libexpat.so.1 (0x00007f763abea000)

Good, as expected, MODULE_PYEXPAT_DEPS is empty.

Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

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

LGTM.

@vstinner
Copy link
Member

This change can be backported to Python 3.11.

Python 3.10 doesn't seem to be affected:

$ git clean -fdx$ rm -rf Modules/_decimal/libmpdec/ Modules/expat/$ ./configure CFLAGS="-O0" --with-system-libmpdec --with-system-expat$ make 2>&1|tee make.log$ ldd $(./python -c 'import _decimal; print(_decimal.__file__)')|grep libmpdeclibmpdec.so.3 => /lib64/libmpdec.so.3 (0x00007f1edc402000)$ ldd $(./python -c 'import pyexpat; print(pyexpat.__file__)')|grep expatlibexpat.so.1 => /lib64/libexpat.so.1 (0x00007f7a66b87000)

The build works without Modules/_decimal/libmpdec/ nor Modules/expat/ directories (removed).

@vstinner
Copy link
Member

@erlend-aasland: Do you want to review again the PR?

I plan to merge it soon. I'm now waiting for last buildbot jobs.

Since there is no way of fixing the commit message in a new commit and I do not have merge rights, I've decided to correct the typo instead of leaving it up to the merge-committer who might not notice it.

I always done that, so I'm fine with it :-) I prefergit commit --amend to fix the commit message. Otherwise, there is a risk that the wrong commit message is picked :-(

Copy link
Contributor

@erlend-aaslanderlend-aasland left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks Miro for finding and fixing this, and thanks Victor for verifying the fix :)

@erlend-aaslanderlend-aasland merged commit6abec1c intopython:mainNov 11, 2022
@miss-islington
Copy link
Contributor

Thanks@hroncok for the PR, and@erlend-aasland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@miss-islington
Copy link
Contributor

Sorry,@hroncok and@erlend-aasland, I could not cleanly backport this to3.11 due to a conflict.
Please backport usingcherry_picker on command line.
cherry_picker 6abec1caffdba2e282b14fe57c6ce61974de4bbe 3.11

@bedevere-bot
Copy link

GH-99391 is a backport of this pull request to the3.11 branch.

@bedevere-botbedevere-bot removed the needs backport to 3.11only security fixes labelNov 11, 2022
erlend-aasland pushed a commit to erlend-aasland/cpython that referenced this pull requestNov 11, 2022
…stem-expat no longer include vendored headers (pythonGH-98711).(cherry picked from commit6abec1c)Co-authored-by: Miro Hrončok <miro@hroncok.cz>
ethanfurman pushed a commit to ethanfurman/cpython that referenced this pull requestNov 12, 2022
erlend-aasland added a commit that referenced this pull requestNov 13, 2022
…xpat no longer include vendored headers (GH-98711) (#99391)(cherry picked from commit6abec1c)Co-authored-by: Miro Hrončok <miro@hroncok.cz>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@vstinnervstinnervstinner approved these changes

@erlend-aaslanderlend-aaslanderlend-aasland approved these changes

@tirantiranAwaiting requested review from tiran

Assignees

@erlend-aaslanderlend-aasland

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

--with-system-libmpdec / --with-system-expat still uses the vendored headers

7 participants

@hroncok@merwok@erlend-aasland@bedevere-bot@vstinner@miss-islington@encukou

[8]ページ先頭

©2009-2025 Movatter.jp