You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
From CI, Tools/c-analyzer/check-c-globals.py failed #150948
Occasionally the tool is unable to parse updated code.
If this happens then add the file to the "EXCLUDED" list
in Tools/c-analyzer/cpython/_parser.py and create a new
issue for fixing the tool (and CC ericsnowcurrently
on the issue).
I guess if the PR is approved, this new file will be noted as excluded from the tool run.
I investigated the c-analyzer path and it appears that Modules/_multiprocessing/semaphore_macosx.h is being picked up by the analyzer through the generic Modules/**/*.h scan, but preprocessing fails on non-macOS CI because of the #include <sys/sysctl.h> dependency.
From what I found, the existing approach for files that cannot be parsed cross-platform is to add them to the EXCLUDED list in Tools/c-analyzer/cpython/_parser.py. Similar platform-specific exclusions already exist for _scproxy.c, _winapi.c, and other OS-specific files.
I plan to submit a small PR that adds Modules/_multiprocessing/semaphore_macosx.h to the macOS exclusion list, which appears to be consistent with the current c-analyzer guidance and existing exclusions.
Please let me know if there is a preferred alternative approach.
I confirm that this part of code is dedicated to macOS platform. The c-analyzer tool runs on linux where the <sys/sysctl.h> header has been deprecated for some time and no longer exists.
So I think it makes sense to add semaphore_macosx.h into the file Tools/c-analyzer/cpython/_parser.py, as suggested below.
I wish this is the right way to go about it.
This modification will be add to the #130913 PR.
Activity
StanFromIreland commentedon Jun 5, 2026
YvesDup commentedon Jun 5, 2026
I guess if the PR is approved, this new file will be noted as excluded from the tool run.
YvesDup commentedon Jun 5, 2026
I added in
Tools/c-analyzer/cpython/_parser.pythe file that raises the error.I created a new branch with the change into the
Tools/c-analyzer/cpython/_parser.pyfile but the "Check for unsupported C global variables" test is disabled - see https://github.com/YvesDup/cpython/actions/runs/27023166717/job/79756266970zainnadeem786 commentedon Jun 20, 2026
Hi @StanFromIreland @YvesDup ,
I'd like to work on this issue.
I investigated the c-analyzer path and it appears that
Modules/_multiprocessing/semaphore_macosx.his being picked up by the analyzer through the genericModules/**/*.hscan, but preprocessing fails on non-macOS CI because of the#include <sys/sysctl.h>dependency.From what I found, the existing approach for files that cannot be parsed cross-platform is to add them to the
EXCLUDEDlist inTools/c-analyzer/cpython/_parser.py. Similar platform-specific exclusions already exist for_scproxy.c,_winapi.c, and other OS-specific files.I plan to submit a small PR that adds
Modules/_multiprocessing/semaphore_macosx.hto the macOS exclusion list, which appears to be consistent with the current c-analyzer guidance and existing exclusions.Please let me know if there is a preferred alternative approach.
StanFromIreland commentedon Jun 20, 2026
I'm sorry but I closed your PR, it is not necessary. Such changes should be done in #130913 instead.
zainnadeem786 commentedon Jun 20, 2026
@StanFromIreland Understood, thank you for the clarification. I'll follow up in #130913 instead.
YvesDup commentedon Jun 21, 2026
StanFromIreland commentedon Jun 21, 2026
Sorry @YvesDup, I'm not familiar with macOS things and I don't have access to a machine to test.
YvesDup commentedon Jun 22, 2026
YvesDup commentedon Jun 22, 2026
I confirm that this part of code is dedicated to macOS platform. The
c-analyzertool runs on linux where the<sys/sysctl.h>header has been deprecated for some time and no longer exists.So I think it makes sense to add
semaphore_macosx.hinto the fileTools/c-analyzer/cpython/_parser.py, as suggested below.I wish this is the right way to go about it.
This modification will be add to the #130913 PR.
YvesDup commentedon Jun 22, 2026
I will close this issue as completed. No objection ?
StanFromIreland commentedon Jun 22, 2026
Since we don't need any action here, I agree we can close.
YvesDup commentedon Jun 22, 2026
@StanFromIreland thank you for adding macOS team as #130913 reviewers