Skip to content

fix: Make contributor checks work on Windows - #1310

Open
yuefdev wants to merge 1 commit into
ARM-software:mainfrom
yuefdev:fix/windows-contributor-tools
Open

yuefdev wants to merge 1 commit into
ARM-software:mainfrom
yuefdev:fix/windows-contributor-tools

Conversation

@yuefdev

@yuefdev yuefdev commented Sep 13, 2026

Copy link
Copy Markdown

Contributor hooks fail on native Windows even with Git Bash installed: the style check hardcodes /bin/bash, the Android checker relies on executing a .py file through the shell, and generators write Windows path separators and line endings into tracked build files and umbrella headers.

Use Bash from PATH, launch the Android generator with the current Python interpreter and separate arguments, and normalize generated paths and text output. Android source filtering now also recognizes excluded directories and OpenCL headers when os.walk returns Windows paths. Doxygen and header-guard checks preserve LF instead of repeatedly undoing the mixed-line-ending hook. Generated CMake/Bazel files and umbrella headers retain their existing repository contents.

Fix the misspelled grep --exclude_dir options, which prevented the style scans from running correctly, and batch the license-header scan to avoid launching grep and wc separately for every source file. Since restoring the scans exposes existing missing conditional comments, add the required #else/#endif comments in 11 source/header files. Those changes were checked against the base to verify that only preprocessor comments changed.

The pre-push commit-message hook also installed Commitizen at run time for each filename batch. Concurrent invocations raced while writing to the same environment. Declare Commitizen as an isolated hook dependency and disable filename passing for both commit-message and sign-off checks.

Validation on Windows x64 with Git Bash and Python 3.10.21:

  • python -m unittest discover -s scripts/tests -v: all 10 tests pass, covering Android filtering, UTF-8/LF output, umbrella includes, graph paths, checkout paths with spaces, and positive/negative style and license checks.
  • Full pre-commit run: all 14 configured pre-commit hooks pass, including Android, CMake/Bazel generation, style, clang-format, header guards, and repository-wide REUSE compliance.
  • git diff --check: passes; generators leave the tracked build files unchanged.

No C++ kernel or API behavior changes; no Arm inference or full C++ library build was run.

Signed-off-by: Yusuf Efe <120668197+yuefdev@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant