From 3c45e289f4b6e1fe9a9b296cae658129fee49fd4 Mon Sep 17 00:00:00 2001 From: Konrad Kleine Date: Wed, 9 Oct 2024 09:07:46 +0200 Subject: [PATCH 1/2] Remove broken links in source tarball This is a backport of https://src.fedoraproject.org/rpms/llvm-test-suite/pull-request/41. Before it wasn't possible to pass `-DTEST_SUITE_SUBDIRS=CTMark` to cmake when configuring the llvm-test-suite: ``` -- Adding directory CTMark CMake Error at CTMark/CMakeLists.txt:1 (add_subdirectory): add_subdirectory given source "7zip" which is not an existing directory. CMake Error at CTMark/CMakeLists.txt:5 (add_subdirectory): add_subdirectory given source "lencod" which is not an existing directory. ``` The llvm-test-suite command script `pkg_test_suite.sh` removes directories with BAD or unreviewed licenses. Currently this leaves at least two directories in a broken state: ``` /usr/share/llvm-test-suite/CTMark/7zip -> ../MultiSource/Benchmarks/7zip /usr/share/llvm-test-suite/CTMark/lencod -> ../MultiSource/Applications/JM/lencod ``` In both cases the link target is non-existent. Therefore I find any broken symbolic links, remove them and adapt the `CMakeLists.txt` to not have the `add_subdirectory(broken_link)` entry in it. Here's an excerpt of what the `pkg_test_suite.sh` script shows when running as a proof of the work it does now. ``` ++ find test-suite-18.1.8.src -type l '!' -exec test -e '{}' ';' -print + broken_symlinks='test-suite-18.1.8.src/CTMark/7zip test-suite-18.1.8.src/CTMark/lencod' + for f in $broken_symlinks + test -L test-suite-18.1.8.src/CTMark/7zip + rm -fv test-suite-18.1.8.src/CTMark/7zip removed 'test-suite-18.1.8.src/CTMark/7zip' ++ dirname test-suite-18.1.8.src/CTMark/7zip + basedir=test-suite-18.1.8.src/CTMark ++ basename test-suite-18.1.8.src/CTMark/7zip + dir=7zip + cmake_file=test-suite-18.1.8.src/CTMark/CMakeLists.txt + test -f test-suite-18.1.8.src/CTMark/CMakeLists.txt + sed -i 's/add_subdirectory(7zip)//g' test-suite-18.1.8.src/CTMark/CMakeLists.txt + for f in $broken_symlinks + test -L test-suite-18.1.8.src/CTMark/lencod + rm -fv test-suite-18.1.8.src/CTMark/lencod removed 'test-suite-18.1.8.src/CTMark/lencod' ++ dirname test-suite-18.1.8.src/CTMark/lencod + basedir=test-suite-18.1.8.src/CTMark ++ basename test-suite-18.1.8.src/CTMark/lencod + dir=lencod + cmake_file=test-suite-18.1.8.src/CTMark/CMakeLists.txt + test -f test-suite-18.1.8.src/CTMark/CMakeLists.txt + sed -i 's/add_subdirectory(lencod)//g' test-suite-18.1.8.src/CTMark/CMakeLists.txt ``` --- llvm-test-suite.spec | 7 +++++-- pkg_test_suite.sh | 19 +++++++++++++++++++ sources | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) mode change 100644 => 100755 pkg_test_suite.sh diff --git a/llvm-test-suite.spec b/llvm-test-suite.spec index 6a5099d..087405a 100644 --- a/llvm-test-suite.spec +++ b/llvm-test-suite.spec @@ -6,12 +6,12 @@ Name: llvm-test-suite Version: %{llvm_test_suite_version}%{?rc_ver:~rc%{rc_ver}} -Release: 1%{?dist} +Release: 2%{?dist} Summary: C/C++ Compiler Test Suite License: NCSA and BSD and GPLv1 and GPLv2+ and GPLv2 and MIT and Python and Public Domain and CRC32 and AML and Rdisc and ASL 2.0 and LGPLv3 URL: http://llvm.org -# The LLVM Test Suite contains progrms with "BAD" or unknown licenses which should +# The LLVM Test Suite contains programs with "BAD" or unknown licenses which should # be removed. Some of the unknown licenses may be OK, but until they are reviewed, # we will remove them. # Use the pkg_test_suite.sh script to generate the test-suite tarball: @@ -80,6 +80,9 @@ cp -R %{_builddir}/%{test_suite_srcdir}/* %{buildroot}%{_datadir}/llvm-test-suit %changelog +* Thu Oct 10 2024 Konrad Kleine - 18.1.8-2 +- Remove broken links in source tarball + * Fri Jul 12 2024 Jesus Checa Hidalgo - 18.1.8-1 - 18.1.8 Release diff --git a/pkg_test_suite.sh b/pkg_test_suite.sh old mode 100644 new mode 100755 index 6aac54d..5ba4af3 --- a/pkg_test_suite.sh +++ b/pkg_test_suite.sh @@ -51,7 +51,26 @@ for f in $UNKNOWN $BAD $POSSIBLY_BAD $BUGGY; do cmake_file=$test_suite_src/$basedir/CMakeLists.txt test -f $cmake_file sed -i s/add_subdirectory\($dir\)//g $cmake_file +done +# The llvm-test-suite now contains broken symlinks because +# the link target was removed above, e.g. +# +# /usr/share/llvm-test-suite/CTMark/7zip -> ../MultiSource/Benchmarks/7zip +# /usr/share/llvm-test-suite/CTMark/lencod -> ../MultiSource/Applications/JM/lencod +# +# To fix these algorithmically, we have to find all broken +# symlinks and remove the add_subdirectory entry in the +# CMakeLists.txt in their parent directory. +broken_symlinks=$(find $test_suite_src -type l ! -exec test -e {} \; -print) +for f in $broken_symlinks; do + test -L $f + rm -fv $f + basedir=`dirname $f` + dir=`basename $f` + cmake_file=$basedir/CMakeLists.txt + test -f $cmake_file + sed -i s/add_subdirectory\($dir\)//g $cmake_file done tar --transform=s/$test_suite_src/$test_suite_src.fedora/ --show-transformed-names -cJf $currentdir/$test_suite_src.fedora.tar.xz $test_suite_src diff --git a/sources b/sources index 009482b..9441418 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (test-suite-18.1.8.src.fedora.tar.xz) = d9538aec6565ff2884939fb62a73d54fc8489660a73b990250991fa0bd4cea51936112c0302321392715fef24f6ae6836f9a6829cae154bd7208644b9d67b068 +SHA512 (test-suite-18.1.8.src.fedora.tar.xz) = f343056666c43009967ea4f156919c124bb1af773d0439d2dbda41067f3b4665719cd68510528256e84e68ed08068bca6c647bda51730d1864600835fb6ede64 From 444026fd4f81c749bdcec9928b554ec129abdb76 Mon Sep 17 00:00:00 2001 From: Konrad Kleine Date: Mon, 14 Oct 2024 20:05:51 +0200 Subject: [PATCH 2/2] Remove ClamAV subdirectory because of viruses in input files These were the findings: ``` MultiSource/Applications/ClamAV/inputs/rtf-test/rtf1.rtf: Eicar-Signature MultiSource/Applications/ClamAV/inputs/clam.zip: Clamav.Test.File-6 MultiSource/Applications/ClamAV/inputs/rtf-test/docCLAMexe.rtf: Clamav.Test.File-6 MultiSource/Applications/ClamAV/inputs/rtf-test/Doc11.rtf: Clamav.Test.File-6 MultiSource/Applications/ClamAV/inputs/rtf-test/Doc1.rtf: Clamav.Test.File-6 MultiSource/Applications/ClamAV/inputs/clam.cab: Clamav.Test.File-6 MultiSource/Applications/ClamAV/inputs/rtf-test/Doc2.rtf: Clamav.Test.File-6 MultiSource/Applications/ClamAV/inputs/clam.exe.bz2: Clamav.Test.File-6 MultiSource/Applications/ClamAV/inputs/rtf-test/doc3.rtf: Clamav.Test.File-6 MultiSource/Applications/ClamAV/inputs/clam.exe: Clamav.Test.File-6 MultiSource/Applications/ClamAV/inputs/rtf-test/Doc22.rtf: Clamav.Test.File-6 ``` --- license-files.txt | 2 -- llvm-test-suite.spec | 5 ++++- pkg_test_suite.sh | 6 ++++-- sources | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/license-files.txt b/license-files.txt index 3564e44..acad1f7 100644 --- a/license-files.txt +++ b/license-files.txt @@ -1,5 +1,4 @@ autoconf/LICENSE.TXT -CTMark/ClamAV/COPYING CTMark/consumer-typeset/LICENSE CTMark/kimwitu++/COPYING CTMark/kimwitu++/LICENSE.TXT @@ -11,7 +10,6 @@ MultiSource/Applications/aha/LICENSE.TXT MultiSource/Applications/ALAC/decode/LICENSE MultiSource/Applications/ALAC/encode/LICENSE MultiSource/Applications/ALAC/LICENSE -MultiSource/Applications/ClamAV/COPYING MultiSource/Applications/hbd/doc/COPYING MultiSource/Applications/hbd/LICENSE.TXT MultiSource/Applications/hexxagon/COPYING diff --git a/llvm-test-suite.spec b/llvm-test-suite.spec index 087405a..a18e4d6 100644 --- a/llvm-test-suite.spec +++ b/llvm-test-suite.spec @@ -6,7 +6,7 @@ Name: llvm-test-suite Version: %{llvm_test_suite_version}%{?rc_ver:~rc%{rc_ver}} -Release: 2%{?dist} +Release: 3%{?dist} Summary: C/C++ Compiler Test Suite License: NCSA and BSD and GPLv1 and GPLv2+ and GPLv2 and MIT and Python and Public Domain and CRC32 and AML and Rdisc and ASL 2.0 and LGPLv3 @@ -80,6 +80,9 @@ cp -R %{_builddir}/%{test_suite_srcdir}/* %{buildroot}%{_datadir}/llvm-test-suit %changelog +* Tue Oct 15 2024 Konrad Kleine - 18.1.8-3 +- Remove MultiSource/Applications/ClamAV directory because of viruses in input files + * Thu Oct 10 2024 Konrad Kleine - 18.1.8-2 - Remove broken links in source tarball diff --git a/pkg_test_suite.sh b/pkg_test_suite.sh index 5ba4af3..81d8b01 100755 --- a/pkg_test_suite.sh +++ b/pkg_test_suite.sh @@ -38,12 +38,14 @@ POSSIBLY_BAD="\ MultiSource/Applications/Burg/ \ MultiSource/Benchmarks/MiBench/telecomm-FFT/" +VIRUSES="\ + MultiSource/Applications/ClamAV/" #siod: llvm.org/PR38648 BUGGY="\ MultiSource/Applications/siod" -for f in $UNKNOWN $BAD $POSSIBLY_BAD $BUGGY; do +for f in $UNKNOWN $BAD $POSSIBLY_BAD $BUGGY $VIRUSES; do test -d $test_suite_src/$f rm -Rf $test_suite_src/$f basedir=`dirname $f` @@ -74,5 +76,5 @@ for f in $broken_symlinks; do done tar --transform=s/$test_suite_src/$test_suite_src.fedora/ --show-transformed-names -cJf $currentdir/$test_suite_src.fedora.tar.xz $test_suite_src -pushd +popd rm -Rf $tmpdir diff --git a/sources b/sources index 9441418..2c2a28a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (test-suite-18.1.8.src.fedora.tar.xz) = f343056666c43009967ea4f156919c124bb1af773d0439d2dbda41067f3b4665719cd68510528256e84e68ed08068bca6c647bda51730d1864600835fb6ede64 +SHA512 (test-suite-18.1.8.src.fedora.tar.xz) = 67f0ad86203d0e202fdd5755fc203efe0217e71f8d09f57d382a73135a228f90e5102c8a8b3a50c13b34e85a31475906609d450f427de721e8f79c436d415c79