ci: add CheckKernelLLVM#4
Conversation
Add task to build kernel with LLVM + checking context analysis warnings: https://docs.kernel.org/dev-tools/context-analysis.html This feature does static compile time checking of the __must_hold, __guarded_by etc annotations now used by kernel.
Add localci command so that the docker CI can be tested locally without secrets. Example: git clone --depth 1 https://github.com/bluez/bluetooth-next work/src docker run --volume $PWD/work:/work/base:O $IMG localci kernel bluez/bluetooth-next 103
Add option for setting make -j option value.
| sys.exit(1) | ||
|
|
||
| if args.jobs == "auto": | ||
| args.jobs = str(os.cpu_count()) |
There was a problem hiding this comment.
No super found of the jobs variable being either a string or an int.
|
|
||
| if args.jobs == "auto": | ||
| args.jobs = str(os.cpu_count()) | ||
|
|
There was a problem hiding this comment.
Maybe the default should also be set here? That's where it's advertised.
| *) | ||
| echo "Unknown TASK: $TASK" | ||
| eixt 1 | ||
| exit 1 |
| if ! test -d "$GITHUB_WORKSPACE/$BASE_DIR/src"; then | ||
| echo "Cloning https://github.com/$GITHUB_REPOSITORY" | ||
| git clone --depth 1 "https://github.com/$GITHUB_REPOSITORY" \ | ||
| $GITHUB_WORKSPACE/$BASE_DIR/src |
There was a problem hiding this comment.
You'll probably want to run shellcheck on that portion of the script, see also #5 which does that for the rest of the script.
|
|
||
| set -e | ||
|
|
||
| export PATH=/opt/llvm/bin:$PATH |
There was a problem hiding this comment.
This wouldn't be needed if we used llvm from the distribution, see BluezTestBot/docker-bluez-build#2 (comment)
There was a problem hiding this comment.
As long as the CONTEXT_ANALYSIS is a bit of a moving target vs Clang versions, I think it's better to pick manually the compiler we want
| self.dry_run = dry_run | ||
|
|
||
| if make_params: | ||
| make_params = ['W=1'] + make_params |
There was a problem hiding this comment.
Don't know if it's too early to ask for that, but would it be possible to only have "generic" make params be added to the make params? I'm thinking of the (eventual) meson support which wouldn't know what to do with W=1.
Add task to build kernel with LLVM + checking context analysis warnings:
https://docs.kernel.org/dev-tools/context-analysis.html
This feature does static compile time checking of the __must_hold,
__guarded_by etc annotations now used by kernel, as support for Sparse locking analysis was removed.
Kernel CONTEXT_ANALYSIS requires LLVM 22 (and apparently LLVM 23 in near future), so this also needs someone to update the blueztestbot docker image: BluezTestBot/docker-bluez-build#2
Also add new
entrypoint.shcommand to run the Docker image locally, so that it is possible to test it without having BlueZ github secrets.Example:
... in the case where we had the following in the kernel source to demonstrate an error