Skip to content

[3.15] gh-158810: Fix Py_ARRAY_LENGTH() macro on C++ - #159315

Merged
vstinner merged 3 commits into
python:3.15from
vstinner:array_len15
Oct 13, 2026
Merged

vstinner merged 3 commits into
python:3.15from
vstinner:array_len15

Conversation

@vstinner

@vstinner vstinner commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Fix the compiler warning "extension used" when building test_cext
with clang.

* test_cext no longer overrides the CC environment variable if it's
  already defined.
* test_cext now also logs __STRICT_ANSI__ macro.

(cherry picked from commit 85c03d4)
@vstinner vstinner added the needs backport to 3.14 bugs and security fixes label Oct 13, 2026
@vstinner
vstinner enabled auto-merge (squash) October 13, 2026 13:29
@vstinner
vstinner merged commit 152185f into python:3.15 Oct 13, 2026
58 checks passed
@vstinner
vstinner deleted the array_len15 branch October 13, 2026 13:32
@miss-islington-app

Copy link
Copy Markdown

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @vstinner, I could not cleanly backport this to 3.14 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker 152185fdf81515df55925e0bebccb9000c34cb11 3.14

@bedevere-bot

Copy link
Copy Markdown

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

Hi! The buildbot x86-64 macOS 3.15 (tier-2) has failed when building commit 152185f.

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/2031/builds/440) and take a look at the build logs.
  4. Check if the failure is related to this commit (152185f) 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/2031/builds/440

Failed tests:

  • test_cext

Failed subtests:

  • test_build - test.test_cext.TestInteralCpp.test_build
  • test_build_cpp03 - test.test_cext.TestPublicCpp.test_build_cpp03
  • test_build_cpp11 - test.test_cext.TestPublicCpp.test_build_cpp11

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

==

Click to see traceback logs
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 151, in test_build_cpp11
    self.check_build('_test_cppext_cpp11', std='c++11')
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 106, in check_build
    run_cmd('Tests', cmd)
    ~~~~~~~^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 81, in run_cmd
    subprocess.run(cmd, check=True, env=env)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/subprocess.py", line 692, in run
    raise CalledProcessError(retcode, process.args,
                             output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ['/Users/buildbot/buildarea/3.15.billenstein-macos/build/build/test_python_13579æ/tempcwd/env/bin/python.exe', '-X', 'dev', '/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/runtests.py', '_test_cppext_cpp11'] returned non-zero exit status 1.


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 192, in test_build
    self.check_build('_test_cppext_internal')
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 106, in check_build
    run_cmd('Tests', cmd)
    ~~~~~~~^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 81, in run_cmd
    subprocess.run(cmd, check=True, env=env)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/subprocess.py", line 692, in run
    raise CalledProcessError(retcode, process.args,
                             output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ['/Users/buildbot/buildarea/3.15.billenstein-macos/build/build/test_python_13579æ/tempcwd/env/bin/python.exe', '-X', 'dev', '/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/runtests.py', '_test_cppext_internal'] returned non-zero exit status 1.


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 147, in test_build_cpp03
    self.check_build('_test_cppext_cpp03', std='c++03')
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 106, in check_build
    run_cmd('Tests', cmd)
    ~~~~~~~^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 81, in run_cmd
    subprocess.run(cmd, check=True, env=env)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/subprocess.py", line 692, in run
    raise CalledProcessError(retcode, process.args,
                             output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ['/Users/buildbot/buildarea/3.15.billenstein-macos/build/build/test_python_13579æ/tempcwd/env/bin/python.exe', '-X', 'dev', '/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/runtests.py', '_test_cppext_cpp03'] returned non-zero exit status 1.


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 147, in test_build_cpp03
    self.check_build('_test_cppext_cpp03', std='c++03')
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 106, in check_build
    run_cmd('Tests', cmd)
    ~~~~~~~^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 81, in run_cmd
    subprocess.run(cmd, check=True, env=env)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/subprocess.py", line 692, in run
    raise CalledProcessError(retcode, process.args,
                             output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ['/Users/buildbot/buildarea/3.15.billenstein-macos/build/build/test_python_14639æ/tempcwd/env/bin/python.exe', '-X', 'dev', '/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/runtests.py', '_test_cppext_cpp03'] returned non-zero exit status 1.


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/runtests.py", line 68, in <module>
    main()
    ~~~~^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/runtests.py", line 62, in main
    raise AssertionError(f'Tests leaked {diff} references')
AssertionError: Tests leaked 1 references
ERROR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs backport to 3.14 bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants