gh-150948: Exclude macOS semaphore header from c-analyzer#151777
Closed
zainnadeem786 wants to merge 1 commit into
Closed
gh-150948: Exclude macOS semaphore header from c-analyzer#151777zainnadeem786 wants to merge 1 commit into
zainnadeem786 wants to merge 1 commit into
Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Member
|
I'm sorry but I'm closing. This file does not exist, it is being considered as part of #130913. If we decide to merge that PR, we can add the exclusion there, too. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Exclude
Modules/_multiprocessing/semaphore_macosx.hfrom the c-analyzer parser configuration.Issue
check-c-globals.pyscans files matched byModules/**/*.h. The macOS-specific headerModules/_multiprocessing/semaphore_macosx.hincludes:This header is not available on non-macOS CI environments, causing preprocessing to fail before the analyzer can inspect the file.
As a result, the "Check for unsupported C global variables" job can fail due to a platform-specific dependency rather than an actual c-analyzer issue.
Fix
Add
Modules/_multiprocessing/semaphore_macosx.hto theEXCLUDEDlist inTools/c-analyzer/cpython/_parser.py.This follows the existing pattern used for other platform-specific files that cannot be parsed reliably across all CI platforms, such as:
Modules/_scproxy.cModules/_winapi.cRationale
The current c-analyzer workflow already relies on explicit exclusions for files that depend on OS-specific headers unavailable on other platforms.
Since
semaphore_macosx.hdepends on the macOS-onlysys/sysctl.hheader, excluding it is consistent with the existing policy and avoids unrelated CI failures.Fixes gh-150948.