From b0afdacaa4dee837b1c3627f0de4f23c767c62df Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 15 Apr 2024 15:23:09 +0200 Subject: [PATCH 1/2] gh-117889: Fix PGO test in test_peg_generator Reuse support.check_cflags_pgo() in test_peg_generator to check if PGO build is used or not. --- Lib/test/test_peg_generator/test_c_parser.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Lib/test/test_peg_generator/test_c_parser.py b/Lib/test/test_peg_generator/test_c_parser.py index 9e273e99e387a4..1411e55dd0f293 100644 --- a/Lib/test/test_peg_generator/test_c_parser.py +++ b/Lib/test/test_peg_generator/test_c_parser.py @@ -13,9 +13,7 @@ from test.support import os_helper, import_helper from test.support.script_helper import assert_python_ok -_py_cflags_nodist = sysconfig.get_config_var("PY_CFLAGS_NODIST") -_pgo_flag = sysconfig.get_config_var("PGO_PROF_USE_FLAG") -if _pgo_flag and _py_cflags_nodist and _pgo_flag in _py_cflags_nodist: +if support.check_cflags_pgo(): raise unittest.SkipTest("peg_generator test disabled under PGO build") test_tools.skip_if_missing("peg_generator") From b95aa4788e38554989b98f29a02401cd8c244187 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 15 Apr 2024 15:29:46 +0200 Subject: [PATCH 2/2] test.pythoninfo logs PGO_PROF_USE_FLAG --- Lib/test/pythoninfo.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py index 0cfd033bb637a7..1db9fb9537f888 100644 --- a/Lib/test/pythoninfo.py +++ b/Lib/test/pythoninfo.py @@ -513,6 +513,7 @@ def collect_sysconfig(info_add): 'MACHDEP', 'MULTIARCH', 'OPT', + 'PGO_PROF_USE_FLAG', 'PY_CFLAGS', 'PY_CFLAGS_NODIST', 'PY_CORE_LDFLAGS',