Repository navigation
ci: add native CodeQL scans - #854
Merged
Merged
Conversation
Reuse Linux, Windows and macOS CMake builds for CodeQL on master pushes, weekly schedules, manual dispatch and pull requests labelled ci-codeql. Keep other branch and unlabelled pull-request builds free of scan overhead. Fixes #596 Assisted-by: Codex:GPT-6
Keep CMake package consumers on arm64 when CodeQL launches tools through Rosetta. Remove the README explanation as requested. Assisted-by: Codex:GPT-6
Keep the existing check names for pushes and ordinary pull request events. Prefix scan-only checks so skipped jobs cannot replace required CI results. Assisted-by: Codex:GPT-6
Run tracing after the normal checks and capture a clean rebuild of the configured native targets. This retains source coverage without carrying tracing overhead into the remaining compiler and packaging checks. Assisted-by: Codex:GPT-6
Scan one Release library build on Linux, Windows and macOS in parallel with ordinary CI. Keep master-push, weekly and manual scans, and gate pull-request scans on ci-codeql. Restore the ordinary build workflow. Assisted-by: Codex:GPT-6
Apply concurrency after the job's label gate so skipped label events cannot cancel a scan, while opened and labelled events share one scan. Assisted-by: Codex:GPT-6
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
Use checkout v7 while retaining current major tags for CodeQL and MSVC setup. Disable unsupported overlays for manual C/C++ builds and enable the JNI native access used by CodeQL's Windows path resolver. Assisted-by: Codex:GPT-6
Youw
marked this pull request as ready for review
November 15, 2026 23:46
Youw
added a commit
that referenced
this pull request
Nov 16, 2026
Use int for the get_path loop index to match num_ports. The eight-entry libusb buffer already bounds the count, so path formatting and error handling remain unchanged while CodeQL's narrow/wide comparison is removed. Addresses https://github.com/libusb/hidapi/security/code-scanning/1 Related to #854 and #596. Assisted-by: Codex:GPT-6
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.
Add a dedicated CodeQL workflow with one Release library build per platform. Scan every push to
master, weekly, on manual dispatch, and on PRs carryingci-codeql, including when the label is added. Superseded PR scans are canceled; master scans are preserved.Use default C/C++ queries and separate platform categories, with current major action refs (
checkout@v7,codeql-action@v4,setup-msvc-dev@v4). Select macOS 15/Xcode 16.4 for supported tracing. Explicit full-database mode avoids the manual-build overlay warning; native Java access avoids the Windows JNI warning.The existing build workflow and README are unchanged. CodeQL builds only the libraries, without test or packaging variants.
Both the manual full scan and label-gated PR scan passed on the final commit:
linux/hid.c,libusb/hid.cwindows/hid.c,windows/hidapi_descriptor_reconstruct.cmac/hid.cTimes exclude queueing and are single pilot measurements. The full scan used 6m08s of aggregate runner time. Jobs run in parallel with ordinary CI; the PR scan finished about 40 seconds after GitHub Builds in this pilot, so waiting for all checks can still take longer.
Validation: clean
actionlint, 11 event/label checks, successful existing CI, and no build warnings in the six final CodeQL job logs. All three full analyses uploaded 58 rules with empty error/warning fields. The full Linux scan reports one existingcpp/comparison-with-wider-typefinding atlibusb/hid.c:588; Windows and macOS report none. The finding remains available for separate triage.Coverage is limited to the selected native library builds; tests, examples, BSD-specific code and inactive preprocessor branches are outside this scan. Scheduled/default-branch triggers take effect after merge.
Fixes #596
Related to libusb/libusb#1294, the reference workflow linked by #596.
Assisted-by: Codex:GPT-6