Bug#1030222: [DSE-Dev] Bug#1030222: selint: please restrict check only where valgrind is available

2023-02-01 Thread Amin Bandali
Amin Bandali writes:

> Hello there,
>
> You might find it more convenient to depend on 'valgrind-if-available'
> rather than 'valgrind' itself, per the attached patch.  It also skips
> tests that need valgrind, for problematic arches.  What do you think?

To be fully clear, by "it" in "it also skips" I was referring to my
attached patch, not the act of depending on valgrind-if-available.



Bug#1030222: [DSE-Dev] Bug#1030222: selint: please restrict check only where valgrind is available

2023-02-01 Thread Amin Bandali
Hello there,

You might find it more convenient to depend on 'valgrind-if-available'
rather than 'valgrind' itself, per the attached patch.  It also skips
tests that need valgrind, for problematic arches.  What do you think?

diff --git a/debian/control b/debian/control
index 44fca69..a130223 100644
--- a/debian/control
+++ b/debian/control
@@ -13,7 +13,7 @@ Build-Depends: autoconf-archive,
libconfuse-dev,
pkg-config,
uthash-dev,
-   valgrind 
+   valgrind-if-available 
 Standards-Version: 4.6.1
 Rules-Requires-Root: no
 Homepage: https://github.com/SELinuxProject/selint
diff --git a/debian/rules b/debian/rules
index 3a18158..2409916 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,5 +1,7 @@
 #!/usr/bin/make -f
 
+include /usr/share/dpkg/architecture.mk
+
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=+lto
 
 ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
@@ -14,6 +16,10 @@ override_dh_auto_configure:
 	dh_auto_configure -- --enable-werror $(CONFIGURE_ARGS)
 
 execute_after_dh_auto_test:
+ifneq (,$(filter $(DEB_HOST_ARCH), mips64el mipsel))
+# Skip the tests requiring valgrind on problematic architectures
+	sed -i '/^@test "\(valgrind\|Broken config\)" {/a \	skip' end-to-end.bats
+endif
 	cd tests/functional/ && bats end-to-end.bats
 
 ifneq (, $(filter cross, $(DEB_BUILD_PROFILES)))


Bug#1030222: [DSE-Dev] Bug#1030222: selint: please restrict check only where valgrind is available

2023-02-01 Thread Christian Göttsche
> Would it be possible to check and restrict valgrind dependency only on the 
> above architectures?

I am probably going to drop the dependency on valgrind completely, as
the testsuite with valgrind also fails on mipsel (maybe some DWARF
incompatibility?).
Valgrind is used in the upstream CI, and I am also regularly run
SELint with sanitizers.

I'll wait with a new upload till a new upstream release (which
contains for example a fix for the flaky s390x autopkgtest), hopefully
released sometime this week (see
https://github.com/SELinuxProject/selint/issues/259).