8000 gh-101525: Skip test_gdb if the binary is relocated by BOLT. by corona10 · Pull Request #118572 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-101525: Skip test_gdb if the binary is relocated by BOLT. #118572

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

Merged
merged 10 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address code review
  • Loading branch information
corona10 committed Aug 31, 2024
commit af9c391b3f0cada870cf268bb340b75c476c6120
3 changes: 0 additions & 3 deletions Lib/test/libregrtest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,6 @@ def get_build_info():
# PGO (--enable-optimizations)
optimizations.append('PGO')

if support.check_bolt_optimized():
optimizations.append('BOLT')

if optimizations:
build.append('+'.join(optimizations))

Expand Down
10 changes: 2 additions & 8 deletions Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,14 +870,7 @@ def check_bolt_optimized():
# Always return false, if the platform is WASI.
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment only says what the code does, but not why. Could you rewrite it to state why this is happening? I can easily see by the code that we always return false if we're on WASI; there is no need to manifest that info into a comment ;)

if is_wasi:
return False
# BOLTed binary can be checked based on ELF information.
# link: https://github.com/llvm/llvm-project/issues/60253
binary_path = sys.executable
with open(binary_path, 'rb') as f:
binary = f.read()
if b'.note.bolt_info' in binary:
return True
return False
return '--enable-bolt' in sysconfig.get_config_var('CONFIG_ARGS')


Py_GIL_DISABLED = bool(sysconfig.get_config_var('Py_GIL_DISABLED'))
Expand All @@ -892,6 +885,7 @@ def expected_failure_if_gil_disabled():
return unittest.expectedFailure
return lambda test_case: test_case


if Py_GIL_DISABLED:
_header = 'PHBBInP'
else:
Expand Down
0