Skip to content

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Aug 29, 2023

If Python is built with ./configure --with-trace-refs, don't build the _testclinic_limited extension. The limited C API (Py_LIMITED_API) is not compatible with Py_TRACE_REFS.

If Python is built with ./configure --with-trace-refs, don't build
the _testclinic_limited extension. The limited C API (Py_LIMITED_API)
is not compatible with Py_TRACE_REFS.
@vstinner
Copy link
Member Author

Currently, building Python on the TraceRefs buildbot fails with:

gcc  -fno-strict-overflow -Wsign-compare -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -Og -Wall    -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal  -I. -I./Include    -fPIC -c ./Modules/_testclinic_limited.c -o Modules/_testclinic_limited.o
In file included from ./Include/Python.h:44,
                 from ./Modules/_testclinic_limited.c:7:
./Include/object.h:62:4: error: #error Py_LIMITED_API is incompatible with Py_TRACE_REFS
   62 | #  error Py_LIMITED_API is incompatible with Py_TRACE_REFS
      |    ^~~~~
make: *** [Makefile:3139: Modules/_testclinic_limited.o] Error 1

link: https://buildbot.python.org/all/#/builders/484/builds/3914

You can reproduce with:

make distclean
./configure --with-pydebug --with-trace-refs && make

With this change, the build completes as expected and test_clinic pass:

$ make && ./python -m test -v test_clinic 

The following modules are *disabled* in configure script:
_testclinic_limited   xxlimited             xxlimited_35       

(...)
test_my_int_func (test.test_clinic.LimitedCAPIFunctionalTest.test_my_int_func) ... skipped '_testclinic_limited is missing'
test_my_int_sum (test.test_clinic.LimitedCAPIFunctionalTest.test_my_int_sum) ... skipped '_testclinic_limited is missing'
(...)

@vstinner
Copy link
Member Author

cc @erlend-aasland

@vstinner vstinner merged commit bf08131 into python:main Aug 29, 2023
@vstinner vstinner deleted the testclinic_limited_tracerefs branch August 29, 2023 11:39
@vstinner
Copy link
Member Author

Merged, thanks for the review.

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.

3 participants