cmake: add FORMATTING_ONLY option to run formatters without build deps#5554
cmake: add FORMATTING_ONLY option to run formatters without build deps#5554Vineet1101 wants to merge 3 commits intop4lang:mainfrom
Conversation
|
To validate that this works as intended you should enable this option for our linter workflow here: https://github.com/p4lang/p4c/blob/main/.github/workflows/ci-lint.yaml |
Add a new FORMATTING_ONLY CMake option that skips all build
dependencies (flex, bison, boost, protobuf, etc.) and only configures
the formatting/linting targets (clang-format, cpplint, black, isort).
This allows contributors to run code formatters without needing to
install the full P4C toolchain:
cmake -B build -DFORMATTING_ONLY=ON
cmake --build build --target clang-format
Fixes: p4lang#4534
Signed-off-by: Vineet1101 <vineetgoel692@gmail.com>
Signed-off-by: Vineet1101 <vineetgoel692@gmail.com>
536785b to
b1d8f7e
Compare
done |
Great, now if you check the build log here: https://github.com/p4lang/p4c/actions/runs/23376288633/job/68008761360?pr=5554 You can see that we still install PI and BMv2, but we do not actually need them for the linter. Hopefully, once we get rid of these two, the linter run should be very quick. |
This disables BMv2, eBPF, and P4TC installation to speed up the linter job as they are not needed. Signed-off-by: Vineet1101 <vineetgoel692@gmail.com>
This is also done. This time the linter took only 3 mins, previously it took around 13mins |
Add a new FORMATTING_ONLY CMake option that skips all build dependencies (flex, bison, boost, protobuf, etc.) and only configures the formatting/linting targets (clang-format, cpplint, black, isort).
This allows contributors to run code formatters without needing to install the full P4C toolchain:
Fixes: #4534