Rewrite the public symbol check to verify the shared libraries, to check for more things, and to avoid duplication; fixes make check on ARM Taken from Debian: https://salsa.debian.org/multimedia-team/mpeg2dec/blob/master/debian/patches/61_global-symbol-test.patch --- mpeg2dec.orig/test/globals +++ mpeg2dec/test/globals @@ -1,4 +1,8 @@ #!/bin/sh +# TODO +# - fix checking of .a libs; problem is that "nm -g --defined-only" lists +# internal symbols; this can be solved by using objdump, but it's probably +# good enough to just run the tests on the shared lib if test x"$srcdir" != x""; then builddir="." # running from make check, but it does not define that @@ -14,22 +18,30 @@ builddir=`cd $builddir;pwd` error=0 -bad_globals=`nm -g --defined-only $builddir/../libmpeg2/*.o |\ - awk '{if ($3) print $3}' | grep -v '^_\?mpeg2_'` - -if test x"$bad_globals" != x""; then - echo BAD GLOBAL SYMBOLS: - for s in $bad_globals; do echo $s; done +# check_bad_public_symbols [...] +# +# checks public symbols in shared libs: +# - allow prefix_anything +# - reject _prefixanything +# - allow _anything +# - reject anything else +# +# NB: skips missing files +check_bad_public_symbols() { + symbols_prefix="$1" + shift + lib_files=`ls "$@" 2>/dev/null` + [ -z "$lib_files" ] && return + bad_globals=`nm -g --defined-only $lib_files | + awk '{if ($3) print $3}' | + sed -n "/^${symbols_prefix}_/ d; /^_${symbols_prefix}/ { p; d }; /^_/ d; p"` + [ -z "$bad_globals" ] && return error=1 -fi - -bad_globals=`nm -g --defined-only $builddir/../libmpeg2/convert/*.o |\ - awk '{if ($3) print $3}' | grep -v '^_\?mpeg2convert_'` + echo BAD GLOBAL SYMBOLS in $lib_files: + echo "$bad_globals" +} -if test x"$bad_globals" != x""; then - echo BAD GLOBAL SYMBOLS: - for s in $bad_globals; do echo $s; done - error=1 -fi +check_bad_public_symbols mpeg2 $builddir/../libmpeg2/.libs/libmpeg2.so +check_bad_public_symbols mpeg2convert $builddir/../libmpeg2/convert/.libs/libmpeg2convert.so exit $error uix/log/tests?id=741f61998210e7a83cbbae3b84426706f450adbc'>tests/cve-sample.json
AgeCommit message (Expand)Author
2020-12-21tests: Fix malformed JSON....Guile-JSON 4.3.2 would parse in spite of these typos, but 4.4.1 is stricter. * tests/swh.scm (%directory-entries): Add missing comma. * tests/cve-sample.json: Likewise. Ludovic Courtès
2019-10-23cve: Rewrite to read the JSON feed instead of the XML feed....The XML feed was discontinued on Oct. 16th, 2019: <https://nvd.nist.gov/General/News/XML-Vulnerability-Feed-Retirement-Phase-3> * guix/cve.scm (string->date*): New procedure. (<cve-item>, <cve>, <cve-reference>): New record types. (cpe-match->cve-configuration, configuration-data->cve-configurations) (json->cve-items, version-matches?): New procedures. (yearly-feed-uri): Change URL to refer to JSON feed. (cpe->product-alist, %parse-vulnerability-feed) (xml->vulnerabilities): Remove. (cve-configuration->package-list, merge-package-lists) (cve-item->vulnerability, json->vulnerabilities): New procedures. (write-cache): Use 'json->vulnerabilities' instead of 'xml->vulnerabilities', and remove 'parameterize'. (vulnerabilities->lookup-proc): Use 'version-matches?' when VERSION is true. * tests/cve.scm (%sample): Use 'tests/cve-sample.json'. (%expected-vulnerabilities): Rewrite accordingly. ("json->cve-items", "cve-item-published-date") ("json->vulnerabilities"): New tests. ("xml->vulnerabilities"): Remove. ("vulnerabilities->lookup-proc"): Adjust to new vulnerabilities. * tests/cve-sample.json: New file. * tests/cve-sample.xml: Remove. * Makefile.am (EXTRA_DIST): Adjust accordingly. * doc/guix.texi (Invoking guix lint): Update nist.gov URLs. Ludovic Courtès