Skip to content

Fix compile args, add fix and system_last options - #3

Merged
PhilipDeegan merged 3 commits into
masterfrom
fix
Nov 7, 2026
Merged

PhilipDeegan merged 3 commits into
masterfrom
fix

Conversation

@PhilipDeegan

Copy link
Copy Markdown
Member

Fixes:

  • iwyu was given the compile command minus only its first word, so with ccache g++ ... it got g++ as an input file (error: no such file or directory: 'g++'). The flags are now taken with Compilers::identify, like clang.tidy.
  • The iwyu profile configured the module under init (it only implements compile) and had no src, so CI never ran iwyu.
  • The format profile used style: google, which ignores .clang-format (SortIncludes: false) and moved mkn/mod/init.hpp last, breaking the build. Now style: file.
  • headers args are only passed for header files, previously .cpp files were also checked as headers.
  • types accepts space or : separated values as the README says, ignore accepts a list.
  • mkn.yaml drops the ${MKN_HOME} maiken dependency, only mkn.mod headers are used.
  • CI runs apt-get update before installing iwyu.

New options:

  • fix: <args>: iwyu output is written to <build dir>/iwyu.out and passed to fix_include with these args. Only the checked files are edited (iwyu also reports on headers of other projects), --basedir is set so the paths match. fix: "" for fix_include defaults.
  • system_last: true: with fix, system includes are moved after project includes in the files fix_include edited.

Tested on Linux: module self-check, scratch projects, and mkn.avx (19 files edited, tests still build except test_all, where grid.hpp uses is_aligned from vector.hpp inside a template without including it). Windows cmd /c path for fix is untested.

- pass iwyu the real compile flags, the compiler prefix (e.g. ccache) and
  binary were left in the arguments
- iwyu profile runs the module in the compile phase, it was configured
  under init and had no sources, so nothing ran
- format profile uses .clang-format, google style reordered includes and
  broke the init.hpp first requirement
- headers args only for header files, ignore takes a list, types space or
  : separated
- fix: pass iwyu output to fix_include, limited to checked files
- system_last: with fix, move system includes after project includes
- drop MKN_HOME based maiken dependency, mkn.mod is enough
@PhilipDeegan
PhilipDeegan merged commit be34478 into master Nov 7, 2026
1 check passed
@PhilipDeegan
PhilipDeegan deleted the fix branch November 7, 2026 14:33
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