|
libfreenect2 0.4
Open source driver for the Kinect for Windows v2 (K4W2) sensor
|
libfreenect2 keeps compiler diagnostics and dynamic instrumentation target-scoped. Third-party GoogleTest code and system headers are not subjected to the project's warning policy.
High-signal warnings are enabled by default. To use the same warning gate as CI:
Set ENABLE_STRICT_WARNINGS=OFF only when diagnosing a compiler that does not understand the project warning set. Do not use it to land warning-producing first-party code.
The repository's Python helper and maintenance scripts require Python 3.12 or newer; see Development and contributing for the full toolchain requirements. Their Ruff policy matches pylibfreenect3: Ruff targets Python 3.12, uses an 88-character line length, and enables the E, F, I, UP, B, SIM, RUF, and PT rule families. Run the required Python quality gate locally with:
Each profile needs a separate build directory. ASan and TSan cannot be combined.
ENABLE_SANITIZERS=ON remains as a compatibility alias for the combined ASan+UBSan profile. The scheduled deep-analysis workflow also runs Clang's implicit-integer-conversion sanitizer.
Clang's libFuzzer drives the RGB stream parser, depth stream parser, and binary protocol response decoders. Every pull request runs a bounded smoke test; longer local runs retain interesting inputs in a corpus directory:
Any crashing input should be committed as a regression-test fixture after minimizing it with the fuzzer's -minimize_crash=1 mode.
The CI coverage job enforces the current ratcheting floors of 30% line coverage and 25% branch coverage for first-party CPU code. Raise these values as lifecycle, USB, and replay tests are added; do not lower them to accommodate a change.
The workflow publishes the complete llvm-cov text and LCOV reports as artifacts.
The required CI job runs .clang-tidy over every first-party translation unit in CMake's compile database. It enables Clang Static Analyzer, bug-prone, concurrency, performance, and portability checks. CodeQL's security-extended query suite runs independently. The scheduled deep-analysis workflow also runs Clang scan-build over a C++17 configuration.
For a local run:
The focused Semgrep policy prevents direct signed indexing of the enumerated-device collection, plain cross-thread VAAPI health flags, and uninitialized libusb configuration descriptor pointers. The Semgrep policy CI job enforces it on every push; for a local run:
The manually dispatched Kinect hardware soak workflow requires a self-hosted runner with the labels macOS and kinect, a Kinect v2, and a usable Metal device. It builds the shipping library and Protonect with ASan+UBSan, enables the Metal debug layer, and repeatedly exercises CPU and Metal connect/start/capture/stop/close lifecycles.