Bug#1067564: bookworm-pu: package cpu/1.4.3-14~deb12u1

2024-03-25 Thread Adam D. Barratt
Control: tags -1 + confirmed

On Sat, 2024-03-23 at 18:40 +0100, Andreas Beckmann wrote:
> The last QA upload four years ago fixed a FTBFS (multiple definitions
> of
> a global variable) by replacing that variable with an extern
> declaration
> and zero definitions. This didn't result in a linker error (missing
> symbol) because it happens in a plugin library and thus is only
> detected
> at runtime when the plugin gets loaded (i.e. always).

Oh dear...

Please go ahead.

Regards,

Adam



Bug#1067564: bookworm-pu: package cpu/1.4.3-14~deb12u1

2024-03-23 Thread Andreas Beckmann
Package: release.debian.org
Severity: normal
Tags: bookworm
User: release.debian@packages.debian.org
Usertags: pu
Control: block 1067439 withh -1
Control: affects -1 + src:cpu

[ Reason ]
The last QA upload four years ago fixed a FTBFS (multiple definitions of
a global variable) by replacing that variable with an extern declaration
and zero definitions. This didn't result in a linker error (missing
symbol) because it happens in a plugin library and thus is only detected
at runtime when the plugin gets loaded (i.e. always).
So let's ship the plugin with *one* definition of the global variable
;-)

[ Impact ]
cpu stays unusable, but nobody noticed that for the last 4 years and two
stable releases ...

[ Tests ]
Added a smoke test autopkgtest that detects the current failure.

[ Risks ]
We can't make the current situation much worse ;-)

[ Checklist ]
  [*] *all* changes are documented in the d/changelog
  [*] I reviewed all changes and I approve them
  [*] attach debdiff against the package in (old)stable
  [*] the issue is verified as fixed in unstable

[ Changes ]
  * Actually provide a definition of globalLdap.  (Closes: #1067439)

[ Other info ]
n/a

Andreas
diff --git a/debian/changelog b/debian/changelog
index ec0f291..a5aa4a2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,18 @@
+cpu (1.4.3-14~deb12u1) bookworm; urgency=medium
+
+  * QA upload.
+  * Rebuild or bookworm.
+
+ -- Andreas Beckmann   Sat, 23 Mar 2024 18:03:59 +0100
+
+cpu (1.4.3-14) unstable; urgency=medium
+
+  * QA upload.
+  * Actually provide a definition of globalLdap.  (Closes: #1067439)
+  * Add smoke test.
+
+ -- Andreas Beckmann   Sat, 23 Mar 2024 14:39:06 +0100
+
 cpu (1.4.3-13) unstable; urgency=medium
 
   * QA upload.
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644
index 000..9048820
--- /dev/null
+++ b/debian/gbp.conf
@@ -0,0 +1,2 @@
+[DEFAULT]
+debian-branch = main
diff --git a/debian/patches/14_use-extern.patch 
b/debian/patches/14_use-extern.patch
index 774b581..26b0b19 100644
--- a/debian/patches/14_use-extern.patch
+++ b/debian/patches/14_use-extern.patch
@@ -1,10 +1,11 @@
 Description: Fix ftbfs with GCC-10
 
 Bug-Debian: https://bugs.debian.org/957106
+Bug-Debian: https://bugs.debian.org/1067439
 ---
 
 cpu-1.4.3.orig/src/include/plugins/ldap/ldap.h
-+++ cpu-1.4.3/src/include/plugins/ldap/ldap.h
+--- a/src/include/plugins/ldap/ldap.h
 b/src/include/plugins/ldap/ldap.h
 @@ -106,7 +106,7 @@ typedef struct CPU_ldap {
Parser * parse;
  } CPU_ldap;
@@ -14,3 +15,14 @@ Bug-Debian: https://bugs.debian.org/957106
  
  int parseCommand(int argc, char *argv[]);
  void printHelp(int op);
+--- a/src/plugins/ldap/ldap.c
 b/src/plugins/ldap/ldap.c
+@@ -26,6 +26,8 @@
+ #include 
+ #include "plugins/ldap/ldap.h"
+ 
++CPU_ldap * globalLdap;
++
+ int verbose;
+ int operation;
+ 
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 000..7633658
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,8 @@
+Test-Command: /usr/sbin/cpu || /usr/sbin/cpu 2>&1 | grep ^usage:
+Features: test-name=smoketest
+Depends:
+ cpu,
+Restrictions:
+ superficial,
+ needs-root,
+ allow-stderr,