Hi,

On 2025-03-06 19:29, Aurelien Jarno wrote:
> control: tag -1 + patch
> 
> Hi,
> 
> On 2025-03-01 21:03, Santiago Vila wrote:
> > Package: src:rt-tests
> > Version: 2.6-1
> > Severity: serious
> > Tags: ftbfs trixie sid
> > 
> > Dear maintainer:
> > 
> > During a rebuild of all packages in unstable, your package failed to build:
> > 
> > --------------------------------------------------------------------------------
> > [...]
> >  debian/rules clean
> > dh clean
> >    dh_auto_clean
> >     make -j2 distclean
> > make[1]: Entering directory '/<<PKGBUILDDIR>>'
> > for F in cyclictest hackbench pip_stress pi_stress pmqtest ptsematest 
> > rt-migrate-test signaltest sigwaittest svsematest cyclicdeadline 
> > deadline_test queuelat ssdd oslat *.o .depend *.*~ *.orig *.rej *.d *.a 
> > *.8.gz *.8.bz2 ; do find -type f -name $F | xargs rm -f; done
> > rm -f rt-tests-*.tar
> > rm -f hwlatdetect
> > rm -f get_cyclictest_snapshot
> > rm -f tags
> > rm -rf BUILD BUILDROOT RPMS SRPMS SPECS releases *.tar.gz *.tar.asc tmp
> > make[1]: Leaving directory '/<<PKGBUILDDIR>>'
> >    dh_clean
> >  debian/rules binary
> > dh build-arch
> >    dh_update_autotools_config -a
> >    dh_autoreconf -a
> >    dh_auto_configure -a
> >    dh_auto_build -a
> >     make -j2 "INSTALL=install --strip-program=true"
> > make[1]: Entering directory '/<<PKGBUILDDIR>>'
> > gcc -D VERSION=2.6 -c src/cyclictest/cyclictest.c -g -O2 
> > -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. 
> > -fstack-protector-strong -fstack-clash-protection -Wformat 
> > -Werror=format-security -fcf-protection -O2 -g -Wdate-time 
> > -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -Isrc/include -o bld/cyclictest.o
> > gcc -D VERSION=2.6 -c src/lib/rt-error.c -g -O2 
> > -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. 
> > -fstack-protector-strong -fstack-clash-protection -Wformat 
> > -Werror=format-security -fcf-protection -O2 -g -Wdate-time 
> > -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -Isrc/include -o bld/rt-error.o
> > gcc -D VERSION=2.6 -c src/lib/rt-get_cpu.c -g -O2 
> > -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. 
> > -fstack-protector-strong -fstack-clash-protection -Wformat 
> > -Werror=format-security -fcf-protection -O2 -g -Wdate-time 
> > -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -Isrc/include -o bld/rt-get_cpu.o
> > gcc -D VERSION=2.6 -c src/lib/rt-sched.c -g -O2 
> > -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. 
> > -fstack-protector-strong -fstack-clash-protection -Wformat 
> > -Werror=format-security -fcf-protection -O2 -g -Wdate-time 
> > -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -Isrc/include -o bld/rt-sched.o
> > gcc -D VERSION=2.6 -c src/lib/rt-utils.c -g -O2 
> > -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. 
> > -fstack-protector-strong -fstack-clash-protection -Wformat 
> > -Werror=format-security -fcf-protection -O2 -g -Wdate-time 
> > -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -Isrc/include -o bld/rt-utils.o
> > In file included from src/lib/rt-utils.c:28:
> > src/include/rt-sched.h:45:8: error: redefinition of ‘struct sched_attr’
> >    45 | struct sched_attr {
> >       |        ^~~~~~~~~~
> > In file included from /usr/include/x86_64-linux-gnu/bits/sched.h:63,
> >                  from /usr/include/sched.h:43,
> >                  from src/lib/rt-utils.c:14:
> > /usr/include/linux/sched/types.h:98:8: note: originally defined here
> >    98 | struct sched_attr {
> >       |        ^~~~~~~~~~
> > src/include/rt-sched.h:62:5: error: conflicting types for ‘sched_setattr’; 
> > have ‘int(pid_t,  const struct sched_attr *, unsigned int)’ {aka ‘int(int,  
> > const struct sched_attr *, unsigned int)’}
> >    62 | int sched_setattr(pid_t pid,
> >       |     ^~~~~~~~~~~~~
> > /usr/include/x86_64-linux-gnu/bits/sched.h:148:5: note: previous 
> > declaration of ‘sched_setattr’ with type ‘int(pid_t,  struct sched_attr *, 
> > unsigned int)’ {aka ‘int(int,  struct sched_attr *, unsigned int)’}
> >   148 | int sched_setattr (pid_t tid, struct sched_attr *attr, unsigned int 
> > flags)
> >       |     ^~~~~~~~~~~~~
> > src/include/rt-sched.h:66:5: error: conflicting types for ‘sched_getattr’; 
> > have ‘int(pid_t,  struct sched_attr *, unsigned int,  unsigned int)’ {aka 
> > ‘int(int,  struct sched_attr *, unsigned int,  unsigned int)’}
> >    66 | int sched_getattr(pid_t pid,
> >       |     ^~~~~~~~~~~~~
> > /usr/include/x86_64-linux-gnu/bits/sched.h:153:5: note: previous 
> > declaration of ‘sched_getattr’ with type ‘int(pid_t,  struct sched_attr *, 
> > unsigned int,  unsigned int)’ {aka ‘int(int,  struct sched_attr *, unsigned 
> > int,  unsigned int)’}
> >   153 | int sched_getattr (pid_t tid, struct sched_attr *attr, unsigned int 
> > size,
> >       |     ^~~~~~~~~~~~~
> > src/lib/rt-utils.c: In function ‘tracemark’:
> > src/lib/rt-utils.c:480:9: warning: ignoring return value of ‘write’ 
> > declared with attribute ‘warn_unused_result’ [-Wunused-result]
> >   480 |         write(tracemark_fd, tracebuf, len);
> >       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > src/lib/rt-utils.c:483:9: warning: ignoring return value of ‘write’ 
> > declared with attribute ‘warn_unused_result’ [-Wunused-result]
> >   483 |         write(trace_fd, "0\n", 2);
> >       |         ^~~~~~~~~~~~~~~~~~~~~~~~~
> > make[1]: *** [Makefile:97: bld/rt-utils.o] Error 1
> > make[1]: *** Waiting for unfinished jobs....
> > make[1]: Leaving directory '/<<PKGBUILDDIR>>'
> > dh_auto_build: error: make -j2 "INSTALL=install --strip-program=true" 
> > returned exit code 2
> > make: *** [debian/rules:21: build-arch-stamp] Error 25
> > dpkg-buildpackage: error: debian/rules binary subprocess returned exit 
> > status 2
> 
> This build failure is due to glibc 2.41 which started to define
> sched_setattr() and struct sched_attr. I am sorry I missed this when
> preparing this version.
> 
> There is a patch available upstream fixing this issue:
> https://web.git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/commit/?id=d3a23a0cc76789c3083df3bad78982cd49bc4c5e

This issue, introduced by glibc 2.41, is going to cause rt-tests to get
removed from testing, and thus to not get released with Trixie. I have
therefore prepared a non-maintainer upload using the upstream patch and
uploaded it to DELAYED/15. Please find the corresponding debdiff
attached.

Please feel free to upload a different fix in the meantime, ask me to
delay further the NMU or to cancel it.

Regards,
Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurel...@aurel32.net                     http://aurel32.net
diff -Nru rt-tests-2.6/debian/changelog rt-tests-2.6/debian/changelog
--- rt-tests-2.6/debian/changelog       2024-03-24 16:22:27.000000000 +0100
+++ rt-tests-2.6/debian/changelog       2025-03-14 21:57:56.000000000 +0100
@@ -1,3 +1,11 @@
+rt-tests (2.6-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload
+  * Add patch 0007-Fix-rt-tests-build-with-glibc-2.41.patch from upstream to
+    fix build with glibc 2.41.  Closes: #1099287
+
+ -- Aurelien Jarno <aure...@debian.org>  Fri, 14 Mar 2025 21:57:56 +0100
+
 rt-tests (2.6-1) unstable; urgency=medium
 
   * Update to new upstream release v2.6
diff -Nru 
rt-tests-2.6/debian/patches/0007-Fix-rt-tests-build-with-glibc-2.41.patch 
rt-tests-2.6/debian/patches/0007-Fix-rt-tests-build-with-glibc-2.41.patch
--- rt-tests-2.6/debian/patches/0007-Fix-rt-tests-build-with-glibc-2.41.patch   
1970-01-01 01:00:00.000000000 +0100
+++ rt-tests-2.6/debian/patches/0007-Fix-rt-tests-build-with-glibc-2.41.patch   
2025-03-14 21:57:49.000000000 +0100
@@ -0,0 +1,52 @@
+From: Yaakov Selkowitz <yselk...@redhat.com>
+Date: Wed, 29 Jan 2025 16:46:11 -0500
+Subject: Fix rt-tests build with glibc-2.41
+
+The sched_*attr APIs were added to glibc
+https://sourceware.org/git/?p=glibc.git;a=commit;h=21571ca0d70302909cf72707b2a7736cf12190a0
+
+This fixes the build conflict in rt-tests with glibc-2.4
+
+Signed-off-by: Yaakov Selkowitz <yselk...@redhat.com>
+Signed-off-by: John Kacur <jka...@redhat.com>
+---
+ src/include/rt-sched.h | 2 ++
+ src/lib/rt-sched.c     | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/src/include/rt-sched.h b/src/include/rt-sched.h
+index 80171c7..dfd7f45 100644
+--- a/src/include/rt-sched.h
++++ b/src/include/rt-sched.h
+@@ -42,6 +42,7 @@
+ #define __NR_sched_getattr            275
+ #endif
+ 
++#if ! __GLIBC_PREREQ(2, 41)
+ struct sched_attr {
+       uint32_t size;
+       uint32_t sched_policy;
+@@ -67,5 +68,6 @@ int sched_getattr(pid_t pid,
+                 struct sched_attr *attr,
+                 unsigned int size,
+                 unsigned int flags);
++#endif
+ 
+ #endif /* __RT_SCHED_H__ */
+diff --git a/src/lib/rt-sched.c b/src/lib/rt-sched.c
+index 8023bc7..2500abd 100644
+--- a/src/lib/rt-sched.c
++++ b/src/lib/rt-sched.c
+@@ -14,6 +14,7 @@
+ 
+ #include "rt-sched.h"
+ 
++#if ! __GLIBC_PREREQ(2, 41)
+ int sched_setattr(pid_t pid,
+                 const struct sched_attr *attr,
+                 unsigned int flags)
+@@ -28,3 +29,4 @@ int sched_getattr(pid_t pid,
+ {
+       return syscall(__NR_sched_getattr, pid, attr, size, flags);
+ }
++#endif
diff -Nru rt-tests-2.6/debian/patches/series rt-tests-2.6/debian/patches/series
--- rt-tests-2.6/debian/patches/series  2024-03-24 16:22:27.000000000 +0100
+++ rt-tests-2.6/debian/patches/series  2025-03-14 21:57:49.000000000 +0100
@@ -4,3 +4,4 @@
 0004-Don-t-use-.sh-suffix-for-shell-scripts-to-adhere-to-.patch
 0005-rt-tests-install-get_cyclictest_snapshotdirectly-int.patch
 0006-hwlatdetech-get_cyclictest_snapshot-Always-install-m.patch
+0007-Fix-rt-tests-build-with-glibc-2.41.patch

Attachment: signature.asc
Description: PGP signature

Reply via email to