From 4eb5c6dcff48628772568a7a185fbb1b0e57c014 Mon Sep 17 00:00:00 2001 From: Oneric Date: Fri, 21 Oct 2022 00:47:17 +0200 Subject: ci/gha: ensure internal API is namespaced If static libass is linked into a binary defining functions of the same name there will be issues. To avoid this ensure our non-static functions are all prefixed with 'ass_'. --- .github/workflows/ghci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/ghci.yml b/.github/workflows/ghci.yml index 673546a..7383ab1 100644 --- a/.github/workflows/ghci.yml +++ b/.github/workflows/ghci.yml @@ -197,6 +197,28 @@ jobs: - name: compile run: make -j 2 + - name: ensure internal functions are namespaced + if: startsWith(matrix.os, 'ubuntu-') + run: | + test -f libass/.libs/libass.a || (echo "Static lib is missing!"; exit 1) + set +e + list="$(nm libass/.libs/libass.a | grep ' T ' | grep -v ' ass_')" + case "$?" in + 1) + : # All good + ;; + 0) + echo "There are non-namespaced functions! Prefix them with 'ass_'." + echo "$list" + exit 1 + ;; + *) + echo "Internal grep error occured!" + echo "$list" + exit 2 + ;; + esac + - name: run tests if: matrix.skip_tests != 'yes' run: | -- cgit v1.2.3