Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/sparse-zephyr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ jobs:
# We have to painfully extract REAL_CC from the docker image to
# tell the Zephyr build what it... already knows and wants!! Zephyr
# commit 3ebb18b8826 explains this sparse problem.
#
# --pristine is important to reproduce _warnings_. It makes no
# difference for github but it's useful for anyone trying to
# reproduce and copying the command from the logs.
- name: analyze zephyr
working-directory: ./workspace
run: |
Expand All @@ -72,6 +76,6 @@ jobs:
ZSDK=$(cat zsdk_location); _RCC=${{ matrix.platforms.real_cc }}
REAL_CC="$ZSDK/$_RCC" ./sof/zephyr/docker-run.sh \
./sof/zephyr/docker-build.sh ${{ matrix.platforms.platform }} \
--cmake-args=-DSPARSE=y 2>&1 | tee _.log
--cmake-args=-DSPARSE=y --pristine 2>&1 | tee _.log
printf '\n\n\t\t\t ---- Messages below are treated as sparse errors --- \n\n\n'
(set -x; ./sof/scripts/parse_sparse_output.sh < _.log)
(set -x; ./sof/scripts/parse_sparse_output.sh ${{ matrix.platforms.platform }} <_.log)
13 changes: 9 additions & 4 deletions scripts/parse_sparse_output.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause

# "sparse" is not designed for automated testing: its exit code is
Expand All @@ -13,6 +13,9 @@

main()
{
local platform="$1" # optional
local sparse_errors=()

>&2 printf 'Reminder: to see ALL warnings you must as usual build _from scratch_\n'

# To reproduce an 'error: ' and test this script try commenting out
Expand All @@ -22,9 +25,11 @@ main()
# script try deleting a __sparse_cache annotation like the one in
# src/audio/mixer/mixer.c

! grep -v 'alsatplg.*topology2.*skip' | grep -i \
-e '[[:space:]]error:[[:space:]]' \
-e '[[:space:]]warning:[[:space:]].*different address space' \
sparse_errors+=(-e '[[:space:]]error:[[:space:]]')

sparse_errors+=(-e '[[:space:]]warning:[[:space:]].*different address space')

! grep -v 'alsatplg.*topology2.*skip' | grep -i "${sparse_errors[@]}"

}

Expand Down