Skip to content

Comments

Tell compilation db where to find the Python.h includes.#9506

Open
hzeller wants to merge 1 commit intoThe-OpenROAD-Project:masterfrom
hzeller:feature-20260220-py-compdb
Open

Tell compilation db where to find the Python.h includes.#9506
hzeller wants to merge 1 commit intoThe-OpenROAD-Project:masterfrom
hzeller:feature-20260220-py-compdb

Conversation

@hzeller
Copy link
Contributor

@hzeller hzeller commented Feb 20, 2026

There was one diagnostic error when running clang-tidy that was due to not finding Python.h. Add it to the -I paths.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request correctly identifies the need to include Python headers in the compilation database to resolve clang-tidy diagnostics. The proposed solution adds the necessary -I flags, but the implementation using dirname on a glob is fragile. I have suggested a more robust loop-based approach that also includes realpath for better compatibility with tools like clangd.

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@hzeller hzeller force-pushed the feature-20260220-py-compdb branch from 989ed7c to c5ce15f Compare February 20, 2026 13:28
There was one diagnostic error when running clang-tidy that
was due to not finding Python.h. Add it to the `-I` paths.

Signed-off-by: Henner Zeller <h.zeller@acm.org>
@hzeller hzeller force-pushed the feature-20260220-py-compdb branch from c5ce15f to 9760cb0 Compare February 20, 2026 13:30
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

echo '-fPIC' >> compile_flags.txt

# Python include bindings.
for f in bazel-out/../../../external/*/include/python3.*/Python.h; do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bazel-out/.. is a no-op, what is the intention in including it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bazel-out/ is a symlink that points to the bazel internal directories.

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