Skip to content

GH-131296: move suppression of "unused label" warning for clang-cl on Windows #131900

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 2 commits into from
Apr 10, 2025

Conversation

chris-eibl
Copy link
Member

@chris-eibl chris-eibl commented Mar 30, 2025

from global pyproject-clangcl.props to ceval.c
@@ -898,7 +898,7 @@ extern void _PyUOpPrint(const _PyUOpInstruction *uop);
if computed gotos aren't used. */

/* TBD - what about other compilers? */
#if defined(__GNUC__)
#if defined(__GNUC__) || defined(__clang__)
Copy link
Member Author

@chris-eibl chris-eibl Mar 30, 2025

Choose a reason for hiding this comment

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

On Windows, clang-cl does not define __GNUC__ (in contrast to Linux), so let's add __clang__ here.

Slightly further down, for MSVC the same warning (4102) is suppressed using #pragma warning(disable:4102), which clang-cl unfortunately does not understand (yet).

The only occurrences of this warning in the whole code base stem from "generated_cases.c.h", so this is a better place to suppress it in case of clang-cl, instead of doing it globally via pyproject-clangcl.props.

@@ -46,7 +46,7 @@
Please see GH-131691 for details.
-->
<ExceptionHandling>Async</ExceptionHandling>
<AdditionalOptions>-Wno-deprecated-non-prototype -Wno-unused-label -Wno-pointer-sign -Wno-incompatible-pointer-types-discards-qualifiers -Wno-unused-function %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>-Wno-pointer-sign -Wno-incompatible-pointer-types-discards-qualifiers -Wno-unused-function %(AdditionalOptions)</AdditionalOptions>
Copy link
Member Author

Choose a reason for hiding this comment

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

-Wno-unused-label is moved to ceval.c.

-Wno-deprecated-non-prototype is removed, because it does not "fire" for the whole code base.

@chris-eibl
Copy link
Member Author

chris-eibl commented Mar 30, 2025

Failing of *-apple-darwin/clang tail-calling CI is for sure not related to this PR: they are failing since 28th of March (https://github.com/python/cpython/actions/workflows/tail-call.yml).
@Fidget-Spinner any idea?

@Fidget-Spinner
Copy link
Member

Failing of *-apple-darwin/clang tail-calling CI is for sure not related to this PR: they are failing since 28th of March (https://github.com/python/cpython/actions/workflows/tail-call.yml). @Fidget-Spinner any idea?

I'm busy right now but from the brief look I did, it seems homebrew changed the directory of where clang 19 is installed. I can only fix it tomorrow, but if you want to take a try you can fix the directory in the CI file today #131895 (comment)

@python-cla-bot
Copy link

python-cla-bot bot commented Apr 6, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@zooba zooba merged commit e5f68fd into python:main Apr 10, 2025
47 checks passed
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot aarch64 Fedora Stable LTO 3.x (tier-2) has failed when building commit e5f68fd.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/336/builds/6652) and take a look at the build logs.
  4. Check if the failure is related to this commit (e5f68fd) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/336/builds/6652

Failed tests:

  • test_perf_profiler

Failed subtests:

  • test_python_calls_appear_in_the_stack_if_perf_activated - test.test_perf_profiler.TestPerfProfilerWithDwarf.test_python_calls_appear_in_the_stack_if_perf_activated

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/Lib/test/test_perf_profiler.py", line 364, in test_python_calls_appear_in_the_stack_if_perf_activated
    self.assertIn(f"py::foo:{script}", stdout)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'py::foo:/tmp/test_python_4j1zsk_k/tmp7fu1gvow/perftest.py' not found in 'python   84438 1483036.666285:          1 cycles:Pu: \n\tffffaa282d37fc78 [unknown] ([unknown])\n\tffffaa282d38049c [unknown] ([unknown])\n\tffffaa282bf215e4 [unknown] ([unknown])\n\t    ffffb00ddac0 _start+0x0 (/usr/lib/ld-linux-aarch64.so.1)\n\npython   84438 1483036.666340:          1 cycles:Pu: \n\t    ffffb00ddac0 _start+0x0 (/usr/lib/ld-linux-aarch64.so.1)\n\npython   84438 1483036.667126:          1 cycles:Pu: \n\tffffaa282d37ff10 [unknown] ([unknown])\n\tffffaa282d3804cc [unknown] ([unknown])\n\tffffaa282bf215e4 [unknown] ([unknown])\n\t    ffffb00d2e18 __tls_init_tp+0x94 (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffffb00d90ab call_tls_init_tp+0xcb (inlined)\n\t    ffffb00d90ab init_tls+0xcb (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffffb00dbd63 dl_main+0x1f63 (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffffb00d85ff _dl_sysdep_start+0x1df (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffffb00d9b17 _dl_start_final+0x5ab (inlined)\n\t    ffffb00d9b17 _dl_start+0x5ab (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffffb00ddad3 _start+0x13 (/usr/lib/ld-linux-aarch64.so.1)\n\npython   84438 1483036.667165:        406 cycles:Pu: \n\t    ffffb00d2e2c rseq_register_current_thread+0xa8 (inlined)\n\t    ffffb00d2e2c __tls_init_tp+0xa8 (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffffb00d90ab call_tls_init_tp+0xcb (inlined)\n\t    ffffb00d90ab init_tls+0xcb (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffffb00dbd63 dl_main+0x1f63 (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffffb00d85ff _dl_sysdep_start+0x1df (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffffb00d9b17 _dl_start_final+0x5ab (inlined)\n\t    ffffb00d9b17 _dl_start+0x5ab (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffffb00ddad3 _start+0x13 (/usr/lib/ld-linux-aarch64.so.1)\n\npython   84438 1483036.668857:       1008 cycles:Pu: \n\t    ffffaff3e5d
usr/lib64/libc.so.6)\n\t    ffffafeed5cb malloc+0x22b (/usr/lib64/libc.so.6)\n\t    ffffafe81b3b _nl_intern_locale_data+0x9b (/usr/lib64/libc.so.6)\n\t    ffffafe818ff _nl_load_locale_from_archive+0x45f (/usr/lib64/libc.so.6)\n\t    ffffafe80c7f _nl_find_locale+0xff (/usr/lib64/libc.so.6)\n\t    ffffafe8344f setlocale+0x3cf (/usr/lib64/libc.so.6)\n\t          46aabb _Py_SetLocaleFromEnv+0x75b (inlined)\n\t          46aabb _PyPreConfig_Read+0x75b (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          662da3 _Py_PreInitializeFromPyArgv+0xb7 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          72c0d3 pymain_init+0x53 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          72c287 pymain_main+0x27 (inlined)\n\t          72c287 Py_BytesMain+0x27 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t    ffffafe7625b __libc_start_call_main+0x7b (/usr/lib64/libc.so.6)\n\t    ffffafe7633b __libc_start_main@@GLIBC_2.34+0x9b (/usr/lib64/libc.so.6)\n\t          41f5af _start+0x2f (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\npython   84438 1483036.670251:     655837 cycles:Pu: \n\t          477e04 _PyType_HasFeature+0x20 (inlined)\n\t          477e04 _PyType_PreHeaderSize+0x20 (inlined)\n\t          477e04 _PyObject_GC_New+0x20 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          497dcf PyList_New+0x16b (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          71b52f _PyGC_Init+0xcf (inlined)\n\t          71b52f pycore_interp_init+0xcf (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          72b827 pyinit_config+0xb5b (inlined)\n\t          72b827 pyinit_core.constprop.0+0xb5b (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          72b9db Py_InitializeFromConfig+0x37 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          72c1bf pymain_init+0x13f (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          72c287 pymain_main+0x27 (inlined)\n\t          72c287 Py_BytesMain+0x27 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t    ffffafe7625b __libc_start_call_main+0x7b (/usr/lib64/libc.so.6)\n\t    ffffafe7633b __libc_start_main@@GLIBC_2.34+0x9b (/usr/lib64/libc.so.6)\n\t          41f5af _start+0x2f (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\npython   84438 1483036.672783:    3719594 cycles:Pu: \n\t          655a54 convertsimple.isra.0+0x1aa4 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          490b0b convertitem+0x2ab (inlined)\n\t          490b0b vgetargs1_impl+0x2ab (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          490ef7 vgetargs1+0x67 (inlined)\n\t          490ef7 PyArg_ParseTuple+0x67 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          63cae7 type_new+0x47 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          4f95bf type_call+0x57 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          53eb23 _PyObject_MakeTpCall+0xdb (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          494593 _PyObject_VectorcallTstate+0x1ab (inlined)\n\t          494593 _PyObject_CallFunctionVa+0x1ab (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          4946cb PyObject_CallFunction+0x6b (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          57581f PyErr_NewException+0xef (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          71ded3 create_exception_group_class+0x2a73 (inlined)\n\t          71ded3 _PyBuiltins_AddExceptions+0x2a73 (inlined)\n\t          71ded3 pycore_init


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/Lib/test/test_perf_profiler.py", line 364, in test_python_calls_appear_in_the_stack_if_perf_activated
    self.assertIn(f"py::foo:{script}", stdout)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'py::foo:/tmp/test_python_bszi0yjp/tmpkotxa74u/perftest.py' not found in 'python  101588 1483293.374433:          1 cycles:Pu: \n\t    ffff7ffd5ac0 _start+0x0 (/usr/lib/ld-linux-aarch64.so.1)\n\npython  101588 1483293.374466:          1 cycles:Pu: \n\tffffaa282d37fc78 [unknown] ([unknown])\n\tffffaa282d38049c [unknown] ([unknown])\n\tffffaa282bf215e4 [unknown] ([unknown])\n\t    ffff7ffd5ac0 _start+0x0 (/usr/lib/ld-linux-aarch64.so.1)\n\npython  101588 1483293.375102:          1 cycles:Pu: \n\t    ffff7ffc70c4 _dl_relocate_object+0x164 (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff7ffd33d3 dl_main+0x15d3 (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff7ffd05ff _dl_sysdep_start+0x1df (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff7ffd1b17 _dl_start_final+0x5ab (inlined)\n\t    ffff7ffd1b17 _dl_start+0x5ab (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff7ffd5ad3 _start+0x13 (/usr/lib/ld-linux-aarch64.so.1)\n\npython  101588 1483293.375127:        292 cycles:Pu: \n\t    ffff7ffc7320 _dl_relocate_object+0x3c0 (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff7ffd33d3 dl_main+0x15d3 (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff7ffd05ff _dl_sysdep_start+0x1df (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff7ffd1b17 _dl_start_final+0x5ab (inlined)\n\t    ffff7ffd1b17 _dl_start+0x5ab (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff7ffd5ad3 _start+0x13 (/usr/lib/ld-linux-aarch64.so.1)\n\npython  101588 1483293.376107:        835 cycles:Pu: \n\t    ffff7fde9240 __memcpy_generic+0x100 (/usr/lib64/libc.so.6)\n\t          424507 _PyMem_RawWcsdup+0x57 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          726587 config_parse_cmdline+0x2a67 (inlined)\n\t          726587 config_read_cmdline+0x2a67 (inlined)\n\t          726587 _PyConfig_Read.constprop.0+0x2a67 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          72af8f pyinit_core.constprop.0+0x2c3 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          72b9db Py_InitializeFromConfig+0x37 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          72c1bf pymain_init+0x13f (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          72c287 pymain_main+0x27 (inlined)\n\t          72c287 Py_BytesMain+0x27 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t    ffff7fd6625b __libc_start_call_main+0x7b (/usr/lib64/libc.so.6)\n\t    ffff7fd6633b __libc_start_main@@GLIBC_2.34+0x9b (/usr/lib64/libc.so.6)\n\t          41f5af _start+0x2f (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\npython  101588 1483293.376155:      38640 cycles:Pu: \n\t    ffff7ffd839c strcmp+0x9c (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff7ffc2b57 check_match+0x77 (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff7ffc3017 do_lookup_x+0x3
/build/python)\n\t          5216d3 descr_new+0x727 (inlined)\n\t          5216d3 PyDescr_NewMember+0x727 (inlined)\n\t          5216d3 type_add_members+0x727 (inlined)\n\t          5216d3 type_ready_fill_dict+0x727 (inlined)\n\t          5216d3 type_ready+0x727 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          6b0f0b init_static_type+0xab (inlined)\n\t          6b0f0b _PyStaticType_InitBuiltin+0xab (inlined)\n\t          6b0f0b _PyTypes_InitTypes+0xab (inlined)\n\t          6b0f0b pycore_init_types+0xab (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          71b563 pycore_interp_init+0x103 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          72b827 pyinit_config+0xb5b (inlined)\n\t          72b827 pyinit_core.constprop.0+0xb5b (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          72b9db Py_InitializeFromConfig+0x37 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          72c1bf pymain_init+0x13f (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          72c287 pymain_main+0x27 (inlined)\n\t          72c287 Py_BytesMain+0x27 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t    ffff7fd6625b __libc_start_call_main+0x7b (/usr/lib64/libc.so.6)\n\t    ffff7fd6633b __libc_start_main@@GLIBC_2.34+0x9b (/usr/lib64/libc.so.6)\n\t          41f5af _start+0x2f (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\npython  101588 1483293.378487:    2003225 cycles:Pu: \n\t    ffff7ffc2d84 do_lookup_x+0x104 (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff7ffc3833 _dl_lookup_symbol_x+0x113 (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff7ffc8a5b _dl_fixup+0xfb (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff7ffcaef7 _dl_runtime_resolve+0x47 (/usr/lib/ld-linux-aarch64.so.1)\n\t          66e3ef _PySys_SetPreliminaryStderr+0x123 (inlined)\n\t          66e3ef _PySys_Create+0x123 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          66e3ef _PySys_SetPreliminaryStderr+0x123 (inlined)\n\t          66e3ef _PySys_Create+0x123 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\npython  101588 1483293.381926:    5614648 cycles:Pu: \n\t          5a7480 _PyCode_Quicken+0x558 (inlined)\n\t          5a7480 init_code+0x558 (inlined)\n\t          5a7480 _PyCode_New+0x558 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          5d429b r_object+0x87b (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          5d3c97 r_object+0x277 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          5d418b r_object+0x76b (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          5d591f read_object+0x97 (inlined)\n\t          5d591f PyMarshal_ReadObjectFromString+0x97 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          5f3053 unmarshal_frozen_code+0x93 (inlined)\n\t          5f3053 _imp_get_frozen_object_impl+0x93 (inlined)\n\t          5f3053 _imp_get_frozen_object+0x93 (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          7117bf _PyEval_EvalFrameDefault+0x653f (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          71981b _PyEval_EvalFrame+0x23b (inlined)\n\t          71981b _PyEval_Vector+0x23b (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          5567a3 _PyObject_VectorcallTstate+0x17f (inlined)\n\t          5567a3 object_vacall+0x17f (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          5569bb PyObject_CallMethodObjArgs+0x9b (/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/python)\n\t          5f5d23 import_find_and_load+0x7a3 (inlined)\n\t          5f5d23 PyImport_ImportModuleLevelObject+0x

@chris-eibl chris-eibl deleted the move_unused_label_to_ceval branch April 11, 2025 03:52
seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants