gh-90108: Disable LTO on _freeze_module and _testembed#109581
Conversation
LTO optimization is nice to make Python faster, but _freeze_module and _testembed performance is not important. Using LTO to build these two programs make a whole Python build way slower, especially combined with a sanitizer (like ASAN).
Sorry, something went wrong.
I don't think that this change is important to document in the Changelog, since it has no impact on users, it only makes the build a little bit faster when LTO is used. |
Sorry, something went wrong.
|
Did you check that build is passed with the clang(thinLTO)? |
Sorry, something went wrong.
|
PTAL: #96761 (comment) I am not sure that it will happen again, but you need check. |
Sorry, something went wrong.
|
Before, I only tested my PR with GCC. It seems like in practice, this change has no effect on clang with Python is built with
Sure. It just works, but there is a trick: Code added by you in commit 83d84e6 :-) In short, "NOLTO" does not disable LTO but enable LTO instead :-) I also tried:
Both commands produce Python build works (with my PR) in both cases. If I modify manually Makefile to use But... Python also fails on the main branch (without this PR) if manually edit Makefile to use Well: |
Sorry, something went wrong.
|
I discovered "NOLTO" variables when I worked on PR #109576: "Don't export -fsanitize compiler options". |
Sorry, something went wrong.
corona10
left a comment
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
Sorry, something went wrong.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot s390x Debian 3.x has failed when building commit 3e3a7da. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/49/builds/6610 Failed tests:
Failed subtests:
Summary of the results of the build (if available): == Click to see traceback logsTraceback (most recent call last):
File "/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/test/test_tools/test_freeze.py", line 28, in test_freeze_simple_script
outdir, scriptfile, python = helper.prepare(script, outdir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Tools/freeze/test/freeze.py", line 146, in prepare
copy_source_tree(srcdir, SRCDIR)
File "/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Tools/freeze/test/freeze.py", line 95, in copy_source_tree
shutil.copytree(oldroot, newroot, ignore=ignore_non_src)
File "/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/shutil.py", line 588, in copytree
return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/shutil.py", line 542, in _copytree
raise Error(errors)
shutil.Error: [('/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/build/test_python_2763169æ/test_python_t7c7j57j.sock', '/tmp/test_python_a4o1bjnm/tmphlyck6y3/cpython/build/test_python_2763169æ/test_python_t7c7j57j.sock', "[Errno 6] No such device or address: '/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/build/test_python_2763169æ/test_python_t7c7j57j.sock'")]
|
Sorry, something went wrong.
|
Nice, thanks Victor! |
Sorry, something went wrong.
…109581) LTO optimization is nice to make Python faster, but _freeze_module and _testembed performance is not important. Using LTO to build these two programs make a whole Python build way slower, especially combined with a sanitizer (like ASAN).
…e and _testembed (python#109581)" This reverts commit 3e3a7da.
…109581) LTO optimization is nice to make Python faster, but _freeze_module and _testembed performance is not important. Using LTO to build these two programs make a whole Python build way slower, especially combined with a sanitizer (like ASAN).
…e and _teste… (python#110720) pythongh-110313: Revert "pythongh-90108: Disable LTO on _freeze_module and _testembed (python#109581)" This reverts commit 3e3a7da.
LTO optimization is nice to make Python faster, but _freeze_module and _testembed performance is not important. Using LTO to build these two programs make a whole Python build way slower, especially combined with a sanitizer (like ASAN).