Skip to content
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

gh-124613, regrtest: Detect JIT build in build info #124793

Merged
merged 5 commits into from
Sep 30, 2024
Merged
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
Next Next commit
gh-124613, regrtest: Detect JIT build in build info
  • Loading branch information
vstinner committed Sep 30, 2024
commit f7abe5b903ce5cd403f46f2111b374a40ae1a8e8
25 changes: 22 additions & 3 deletions Lib/test/libregrtest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def get_build_info():

config_args = sysconfig.get_config_var('CONFIG_ARGS') or ''
cflags = sysconfig.get_config_var('PY_CFLAGS') or ''
cflags_nodist = sysconfig.get_config_var('PY_CFLAGS_NODIST') or ''
cflags += ' ' + (sysconfig.get_config_var('PY_CFLAGS_NODIST') or '')
ldflags_nodist = sysconfig.get_config_var('PY_LDFLAGS_NODIST') or ''

build = []
Expand All @@ -313,16 +313,35 @@ def get_build_info():
# --with-pydebug
build.append('debug')

if '-DNDEBUG' in (cflags + cflags_nodist):
if '-DNDEBUG' in cflags:
build.append('without_assert')
else:
build.append('release')

if '--with-assertions' in config_args:
build.append('with_assert')
elif '-DNDEBUG' not in (cflags + cflags_nodist):
elif '-DNDEBUG' not in cflags:
build.append('with_assert')

# --enable-experimental-jit
tier2 = re.search('-D_Py_TIER2=([0-9]+)', cflags)
if tier2:
tier2 = int(tier2.group(1))
if tier2 == 1:
jit = 'JIT' # =yes
elif tier2 == 2:
jit = 'JIT=yes-off'
elif tier2 == 4:
jit = 'JIT=interpreter'
elif tier2 == 6: # Secret option
jit = 'JIT=interpreter-off'
elif '-D_Py_JIT' in cflags:
jit = 'JIT'
else:
jit = None
if jit:
build.append(jit)

# --enable-framework=name
framework = sysconfig.get_config_var('PYTHONFRAMEWORK')
if framework:
Expand Down
Loading