GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — From CI, Tools/c-analyzer/check-c-globals.py failed · Issue #150948 · python/cpython

From CI, Tools/c-analyzer/check-c-globals.py failed #150948

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
From CI, Tools/c-analyzer/check-c-globals.py failed#150948
Copy link
Labels
infraCI, GitHub Actions, buildbots, Dependabot, etc.CI, GitHub Actions, buildbots, Dependabot, etc.type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@YvesDup
YvesDup
opened on Jun 5, 2026
Issue body actions

Bug report

Bug description:

Working from this #130913 PR, I recently needed to add this line #include <sys/sysctl.h> // sysctlbyname in a header file.

From CI, the check-c-globals.py tools failed with this message:

..... ..... /home/runner/work/cpython/cpython/Modules/_multiprocessing/semaphore_macosx.h:5:10: fatal error: sys/sysctl.h: No such file or directory
    5 | #include <sys/sysctl.h>  // sysctlbyname
      |          ^~~~~~~~~~~~~~
compilation terminated.
# requested file: </home/runner/work/cpython/cpython/Modules/_multiprocessing/semaphore_macosx.h>

See https://github.com/python/cpython/actions/runs/26958247530/job/79541476456?pr=130913#step:11:39 for complete logs

cc @ericsnowcurrently (As suggested in the documentation:)

CPython versions tested on:

3.16

Operating systems tested on:

macOS

Linked PRs

  • gh-150948: Exclude macOS semaphore header from c-analyzer #151777

Activity

  1. YvesDup
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Jun 5, 2026
  2. StanFromIreland commented on Jun 5, 2026

    @StanFromIreland
    StanFromIreland
    on Jun 5, 2026 · Hidden as off-topic
    show commentMore actions
  3. StanFromIreland
    added
    infraCI, GitHub Actions, buildbots, Dependabot, etc.CI, GitHub Actions, buildbots, Dependabot, etc.
    on Jun 5, 2026
  4. YvesDup commented on Jun 5, 2026

    @YvesDup
    YvesDup
    on Jun 5, 2026
    ContributorAuthor
    More actions

    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.

  5. YvesDup commented on Jun 5, 2026

    @YvesDup
    YvesDup
    on Jun 5, 2026
    ContributorAuthor
    More actions

    I added in Tools/c-analyzer/cpython/_parser.py the file that raises the error.

    # XXX Handle these.
    EXCLUDED = format_conf_lines([
        # macOS
        'Modules/_scproxy.c',              # SystemConfiguration/SystemConfiguration.h
        'Modules/_multiprocessing/semaphore_macosx.h',              # <sys/sysctl.h>
    
        # Windows
    

    I created a new branch with the change into the Tools/c-analyzer/cpython/_parser.py file but the "Check for unsupported C global variables" test is disabled - see https://github.com/YvesDup/cpython/actions/runs/27023166717/job/79756266970

  6. zainnadeem786 commented on Jun 20, 2026

    @zainnadeem786
    zainnadeem786
    on Jun 20, 2026
    Contributor
    More actions

    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.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.

  7. StanFromIreland commented on Jun 20, 2026

    @StanFromIreland
    StanFromIreland
    on Jun 20, 2026
    Member
    More actions

    I'm sorry but I closed your PR, it is not necessary. Such changes should be done in #130913 instead.

  8. zainnadeem786 commented on Jun 20, 2026

    @zainnadeem786
    zainnadeem786
    on Jun 20, 2026
    Contributor
    More actions

    @StanFromIreland Understood, thank you for the clarification. I'll follow up in #130913 instead.

  9. YvesDup commented on Jun 21, 2026

    @YvesDup
    YvesDup
    on Jun 21, 2026 · Hidden as off-topic
    Author
    show commentMore actions
  10. StanFromIreland commented on Jun 21, 2026

    @StanFromIreland
    StanFromIreland
    on Jun 21, 2026
    Member
    More actions

    Sorry @YvesDup, I'm not familiar with macOS things and I don't have access to a machine to test.

  11. YvesDup commented on Jun 22, 2026

    @YvesDup
    YvesDup
    on Jun 22, 2026 · Hidden as off-topic
    Author
    show commentMore actions
  12. YvesDup commented on Jun 22, 2026

    @YvesDup
    YvesDup
    on Jun 22, 2026
    ContributorAuthor
    More actions

    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.

  13. YvesDup commented on Jun 22, 2026

    @YvesDup
    YvesDup
    on Jun 22, 2026
    ContributorAuthor
    More actions

    I will close this issue as completed. No objection ?

  14. StanFromIreland commented on Jun 22, 2026

    @StanFromIreland
    StanFromIreland
    on Jun 22, 2026
    Member
    More actions

    Since we don't need any action here, I agree we can close.

    Reacted by Duprat
  15. StanFromIreland
    closed this as not plannedon Jun 22, 2026
  16. YvesDup commented on Jun 22, 2026

    @YvesDup
    YvesDup
    on Jun 22, 2026
    ContributorAuthor
    More actions

    @StanFromIreland thank you for adding macOS team as #130913 reviewers

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    infraCI, GitHub Actions, buildbots, Dependabot, etc.CI, GitHub Actions, buildbots, Dependabot, etc.type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.