tools: Add compilation database helpers by andrewleech · Pull Request #19698 · micropython/micropython · GitHub
Skip to content

tools: Add compilation database helpers - #19698

Open
andrewleech wants to merge 1 commit into
micropython:masterfrom
andrewleech:feature/sast-compile-commands
Open

andrewleech wants to merge 1 commit into
micropython:masterfrom
andrewleech:feature/sast-compile-commands

Conversation

@andrewleech

Copy link
Copy Markdown
Contributor

Add tools that generate and validate a clang compilation database from a real MicroPython Make build.

gen_compile_commands.py runs a verbose serial build and records each C/C++ compiler invocation. check_compile_commands.py reconciles each database entry with the produced objects and their retained dependency files, rejecting missing, mismatched, malformed, or extraneous entries.

This lets downstream static-analysis tooling consume the real per-translation-unit flags without compiler interposition.

The scripts are generic MicroPython tools; application-level build targets and CI wiring remain outside this PR.

Add a verbose Make build parser and an object-backed completeness check. Together they produce and validate compile_commands.json without compiler interposition, so downstream static analysis receives the real per-translation-unit flags.

Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
@codecov

codecov Bot commented Sep 13, 2026

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

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.

2 participants