Fix ITK nightly build errors or compilation warnings reported on CDash. Use when: addressing CDash nightly failures. Creates a branch, fixes warnings, and opens a PR upstream.
Creates a focused branch containing fixes for errors or warnings reported on the ITK CDash nightly dashboard, then open a PR upstream.
Scripts are located at .github/skills/fix-nightly-warnings/scripts/ relative to the repository root. All python3 commands below assume this directory as the working directory.
scripts/triage_nightly.py — Single-command triage: lists builds, fetches warnings, deduplicates by (sourceFile, flag), and outputs an actionable summary grouped by flag. Best for agentic automation.scripts/list_nightly_warnings.py — Lists CDash builds that have warnings or errors. Defaults to builds from the last 24 hours.Nightlyscripts/get_build_warnings.py — Fetches and summarizes warnings (or errors) for a specific CDash build ID, grouped by source file and warning flag.Run python3 scripts/<script>.py --help for full usage.
Use the provided scripts to fetch the current nightly builds and their warnings from CDash.
Step 1a — List nightly builds with warnings:
python3 scripts/list_nightly_warnings.py --type Nightly --limit 25 --json | jq '.[] | select(.warnings > 0)'
Note: list_nightly_warnings.py returns the builds with the most errors then warnings.
Step 1b — Inspect warnings for a specific build:
python3 scripts/get_build_warnings.py --limit 200 --json BUILD_ID | jq '.entries | map(select(.sourceFile | test("ThirdParty") | not)) | group_by(.flag) | .[] | {flag: .[0].flag, count: length}'
For each build with errors and warnings, fetch the details and summarize the errors and warnings by type and source file.
IGNORE ALL errors and warnings originating from Modules/ThirdParty/ paths — always filter these out in jq pipelines or with the --exclude-thirdparty flag.
If there are build errors, only fix those. If there are warnings, prioritize fixing the most common warning flag that affects the most files.
Deduplication: Multiple CDash builds (e.g., GCC and Clang on different sites) often report the same warning from the same source file. Deduplicate warnings by (sourceFile, flag) across all builds before analyzing, to avoid redundant work.
For each warning or error type identified in step 1, determine the root cause before editing files:
-Wthread-safety-negative) in the compiler documentation.Modules/ThirdParty/ are skipped entirely.Common warning fixes (quick reference):
| Flag | Typical Fix |
|---|---|
-Wshadow | Rename local variable to avoid shadowing outer scope |
-Wunused-parameter | Add (void)param; or use itkNotUsed() macro |
-Wunused-variable | Remove the variable or add [[maybe_unused]] |
-Wdeprecated-declarations | Update to the replacement API |
-Wsign-compare | Use matching signed/unsigned types or cast explicitly |
-Woverloaded-virtual | Add using Base::Method; or override keyword |
-Winconsistent-missing-override | Add missing override keyword |
C4805 (MSVC) | Avoid mixing bool and int in arithmetic |
C4267 (MSVC) | Add explicit narrowing cast static_cast<>() |
git fetch upstream
git checkout -b fix-<warning-type>-warnings upstream/main
Example: fix-doxygen-group-warnings
Determine the root cause of each error or warning. Apply the necessary fixes to the affected files to resolve the warnings. Make the minimal changes needed to fix the warnings, avoid changing unrelated documentation, coding or formatting.
Build the affected libraries locally to confirm that the fixes compile cleanly:
cmake --build build --target <affected-library-target> 2>&1 | grep -c "warning:"
If a local build is not feasible, rely on the draft PR's CI checks to verify. Note that some warnings are intentionally suppressed in CMake/CTestCustom.cmake.in — do not fix warnings that are already handled there.
Follow the ITK commit message standards. Include a clear description of the fix and include the error or warning message being addressed.
Do the following:
upstream/main branch.Before declaring done:
| File | Purpose |
|---|---|
Documentation/docs/contributing/index.md | Contributing guidelines |
CMake/CTestCustom.cmake.in | Already-suppressed warning/error patterns — do not fix these |
PyTorch深度学习模式与最佳实践,用于构建稳健、高效且可复现的训练流程、模型架构和数据加载。