Skip to content

Add a stripped build and checkpatch to CI - #133

Open
breakertt wants to merge 1 commit into
PlatformLab:mainfrom
breakertt:feat/ci-checkpatch
Open

breakertt wants to merge 1 commit into
PlatformLab:mainfrom
breakertt:feat/ci-checkpatch

Conversation

@breakertt

Copy link
Copy Markdown
Contributor

This follows up on #119, as John (comment) and @Stuartwastaken (comment) suggested there. It adds these steps after the unit tests:

Step What it does Fails when
Build homa.ko (stripped) make __STRIP__=1, with the same kernel as the normal build the stripped module does not build
Unit tests, stripped (IPv6, IPv4) the unit tests built with __STRIP__=1 a test fails
checkpatch checkpatch on the change, in the module sources as they are (the files of make checkpatch) checkpatch reports an error
checkpatch (stripped) checkpatch on the change, in the files that go upstream after util/strip.py (the files of make checkpatch-net-next) checkpatch reports an error

Both checkpatch steps call .github/scripts/checkpatch.sh, which runs checkpatch with the same options as the netdev patch checks (NIPA). The script checks only the lines that a pull request or push changes, because the existing code on main already has some checkpatch errors. A checkpatch error fails the step. Warnings and checks do not fail it. They appear as warnings in the summary of the CI run.

The script is in .github/scripts/, where other projects keep the scripts of their workflows, for example libbpf, PyTorch and Neovim. You can also run it locally, before you push: .github/scripts/checkpatch.sh <base> <linux> [stripped].

I tested it in my fork with three pushes:

Push Run Stripped build and unit tests checkpatch checkpatch (stripped)
this commit, on a new branch 40660538429 pass skipped (new branch, nothing to compare with) skipped (new branch, nothing to compare with)
one CHECK in homa_qdisc.c 40660800474 pass pass, one annotation skipped (the file does not go upstream)
four ERRORs in homa_pool.c 40661091120 build fails (the test function has no prototype) fails fails

* Build homa.ko with __STRIP__=1 and run the unit tests on it, with the
  same kernel as the normal build, so that a change that breaks
  stripping shows at once.
* Run checkpatch on the change of each pull request and push, as the
  netdev patch checks do (.github/scripts/checkpatch.sh): once on the
  module sources as they are, once on the files that go upstream after
  util/strip.py. Only errors fail; warnings and checks show as
  annotations.
@Stuartwastaken

Stuartwastaken commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Looks good, Tianyi! One thing for later, not this PR: __STRIP__=1 strips with the preprocessor, so it can’t catch mistakes in what util/strip.py itself writes. Building that output against the same 6.17.8 tree found #134, and with -Werror it also catches the #126 dangling else. I have that as a CI step and can rebase it onto this once it’s merged, if that works for you.

@breakertt

breakertt commented Oct 28, 2026 via email

Copy link
Copy Markdown
Contributor Author

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