ci: Also require building with LLVM for modified kernel packages

Previously, we only checked that new or moved kernel APKBUILDs in
testing or above were building the kernel with LLVM. Now that it is also
formally a requirement for testing, we should change this check to also
enforce it when making modifications to a kernel APKBUILD in testing or
above.

Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8888>
This commit is contained in:
Aelin 2026-06-23 16:15:32 +02:00 committed by The Friendly Meow (merge) Bot
parent 7f33d4678d
commit 093fd51946
No known key found for this signature in database

View file

@ -121,14 +121,14 @@ if grep -qr '# Maintainer:' -- *; then
fi
if [ -n "$CI_MERGE_REQUEST_DIFF_BASE_SHA" ]; then
# Find all moved or new kernel APKBUILDs in main, community or testing
MOVED_OR_NEW_MAINLINE_KERNEL_PACKAGES=$(git show --pretty="" --name-only --diff-filter=AR "$CI_MERGE_REQUEST_DIFF_BASE_SHA"..HEAD | grep "device/\(main\|community\|testing\)/linux-.*/APKBUILD" || true)
# Find all added, modified or renamed kernel APKBUILDs in main, community or testing
MODIFIED_MAINLINE_KERNEL_PACKAGES=$(git show --pretty="" --name-only --diff-filter=AMR "$CI_MERGE_REQUEST_DIFF_BASE_SHA"..HEAD | grep "device/\(main\|community\|testing\)/linux-.*/APKBUILD" || true)
if [ -n "$MOVED_OR_NEW_MAINLINE_KERNEL_PACKAGES" ]; then
if [ -n "$(grep -L LLVM=1 $MOVED_OR_NEW_MAINLINE_KERNEL_PACKAGES || true)" ]; then
echo "ERROR: An added or moved close-to-mainline kernel package is not being built with LLVM."
if [ -n "$MODIFIED_MAINLINE_KERNEL_PACKAGES" ]; then
if [ -n "$(grep -L LLVM=1 $MODIFIED_MAINLINE_KERNEL_PACKAGES || true)" ]; then
echo "ERROR: A new or modified close-to-mainline kernel package is not being built with LLVM."
echo "See https://postmarketos.org/edge/2025/11/11/kernels-llvm/ for more details"
grep --color=always -L LLVM=1 $MOVED_OR_NEW_MAINLINE_KERNEL_PACKAGES
grep --color=always -L LLVM=1 $MODIFIED_MAINLINE_KERNEL_PACKAGES
exit_code=1
fi
fi