Bug#1066292: createrepo-c: FTBFS: xml_file.c:338:36: error: implicit declaration of function ‘rasprintf’; did you mean ‘g_sprintf’? [-Werror=implicit-function-declaration]

2024-03-21 Thread Michael Hudson-Doyle
Package: createrepo-c
Followup-For: Bug #1066292
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu noble ubuntu-patch
X-Debbugs-Cc: michael.hud...@ubuntu.com
Control: tags -1 patch

Dear Maintainer,


In Ubuntu, the attached patch was applied to achieve the following:


  * Fix printing time_t and missing prototypes.


Thanks for considering the patch.


-- System Information:
Debian Release: trixie/sid
  APT prefers mantic-updates
  APT policy: (500, 'mantic-updates'), (500, 'mantic-security'), (500, 
'mantic'), (100, 'mantic-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.5.0-25-generic (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_NZ.UTF-8:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru createrepo-c-0.17.3/debian/patches/ftbfs.patch 
createrepo-c-0.17.3/debian/patches/ftbfs.patch
--- createrepo-c-0.17.3/debian/patches/ftbfs.patch  1970-01-01 
12:00:00.0 +1200
+++ createrepo-c-0.17.3/debian/patches/ftbfs.patch  2024-03-22 
15:53:53.0 +1300
@@ -0,0 +1,21 @@
+--- a/src/xml_dump_repomd.c
 b/src/xml_dump_repomd.c
+@@ -143,7 +143,7 @@
+BAD_CAST repomd->revision);
+ } else {
+ // Use the current time if no revision was explicitly specified
+-gchar *rev = g_strdup_printf("%ld", time(NULL));
++gchar *rev = g_strdup_printf("%lld", (long long)time(NULL));
+ xmlNewChild(root, NULL, BAD_CAST "revision", BAD_CAST rev);
+ g_free(rev);
+ }
+--- a/src/xml_file.c
 b/src/xml_file.c
+@@ -20,6 +20,7 @@
+ #include 
+ #include 
+ #include 
++#include 
+ #include "xml_file.h"
+ #include 
+ #include "error.h"
diff -Nru createrepo-c-0.17.3/debian/patches/series 
createrepo-c-0.17.3/debian/patches/series
--- createrepo-c-0.17.3/debian/patches/series   2023-01-06 11:16:32.0 
+1300
+++ createrepo-c-0.17.3/debian/patches/series   2024-03-22 15:52:17.0 
+1300
@@ -1,3 +1,4 @@
 python-path.patch
 python-skbuild-path.patch
 python-platlib-debian.patch
+ftbfs.patch


Bug#1066292: createrepo-c: FTBFS: xml_file.c:338:36: error: implicit declaration of function ‘rasprintf’; did you mean ‘g_sprintf’? [-Werror=implicit-function-declaration]

2024-03-13 Thread Lucas Nussbaum
Source: createrepo-c
Version: 0.17.3-2
Severity: serious
Justification: FTBFS
Tags: trixie sid ftbfs
User: lu...@debian.org
Usertags: ftbfs-20240313 ftbfs-trixie ftbfs-impfuncdef

Hi,

During a rebuild of all packages in sid, your package failed to build
on amd64.

This is most likely caused by a change in dpkg 1.22.6, that enabled
-Werror=implicit-function-declaration. For more information, see
https://wiki.debian.org/qa.debian.org/FTBFS#A2024-03-13_-Werror.3Dimplicit-function-declaration

Relevant part (hopefully):
> cd /<>/obj-x86_64-linux-gnu/src && /usr/bin/cc 
> -DCR_DELTA_RPM_SUPPORT -DENABLE_LEGACY_WEAKDEPS=1 
> -DG_LOG_DOMAIN=\"C_CREATEREPOLIB\" -Dlibcreaterepo_c_EXPORTS 
> -I/<> -I/usr/include/glib-2.0 
> -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libxml2 
> -I/usr/include/modulemd-2.0 -g -O2 -Werror=implicit-function-declaration 
> -ffile-prefix-map=/<>=. -fstack-protector-strong 
> -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection 
> -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -DWITH_ZCHUNK -DWITH_LIBMODULEMD 
> -fPIC -MD -MT src/CMakeFiles/libcreaterepo_c.dir/xml_parser_other.c.o -MF 
> CMakeFiles/libcreaterepo_c.dir/xml_parser_other.c.o.d -o 
> CMakeFiles/libcreaterepo_c.dir/xml_parser_other.c.o -c 
> /<>/src/xml_parser_other.c
> /<>/src/xml_file.c: In function ‘write_modified_header’:
> /<>/src/xml_file.c:338:36: error: implicit declaration of 
> function ‘rasprintf’; did you mean ‘g_sprintf’? 
> [-Werror=implicit-function-declaration]
>   338 | int package_count_string_len = rasprintf(_count_string, 
> "packages=\"%i\"", package_count);
>   |^
>   |g_sprintf
> [ 44%] Building C object 
> src/CMakeFiles/libcreaterepo_c.dir/xml_parser_primary.c.o
> cd /<>/obj-x86_64-linux-gnu/src && /usr/bin/cc 
> -DCR_DELTA_RPM_SUPPORT -DENABLE_LEGACY_WEAKDEPS=1 
> -DG_LOG_DOMAIN=\"C_CREATEREPOLIB\" -Dlibcreaterepo_c_EXPORTS 
> -I/<> -I/usr/include/glib-2.0 
> -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libxml2 
> -I/usr/include/modulemd-2.0 -g -O2 -Werror=implicit-function-declaration 
> -ffile-prefix-map=/<>=. -fstack-protector-strong 
> -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection 
> -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -DWITH_ZCHUNK -DWITH_LIBMODULEMD 
> -fPIC -MD -MT src/CMakeFiles/libcreaterepo_c.dir/xml_parser_primary.c.o -MF 
> CMakeFiles/libcreaterepo_c.dir/xml_parser_primary.c.o.d -o 
> CMakeFiles/libcreaterepo_c.dir/xml_parser_primary.c.o -c 
> /<>/src/xml_parser_primary.c
> [ 46%] Building C object 
> src/CMakeFiles/libcreaterepo_c.dir/xml_parser_repomd.c.o
> cd /<>/obj-x86_64-linux-gnu/src && /usr/bin/cc 
> -DCR_DELTA_RPM_SUPPORT -DENABLE_LEGACY_WEAKDEPS=1 
> -DG_LOG_DOMAIN=\"C_CREATEREPOLIB\" -Dlibcreaterepo_c_EXPORTS 
> -I/<> -I/usr/include/glib-2.0 
> -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libxml2 
> -I/usr/include/modulemd-2.0 -g -O2 -Werror=implicit-function-declaration 
> -ffile-prefix-map=/<>=. -fstack-protector-strong 
> -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection 
> -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -DWITH_ZCHUNK -DWITH_LIBMODULEMD 
> -fPIC -MD -MT src/CMakeFiles/libcreaterepo_c.dir/xml_parser_repomd.c.o -MF 
> CMakeFiles/libcreaterepo_c.dir/xml_parser_repomd.c.o.d -o 
> CMakeFiles/libcreaterepo_c.dir/xml_parser_repomd.c.o -c 
> /<>/src/xml_parser_repomd.c
> [ 47%] Building C object 
> src/CMakeFiles/libcreaterepo_c.dir/xml_parser_updateinfo.c.o
> cd /<>/obj-x86_64-linux-gnu/src && /usr/bin/cc 
> -DCR_DELTA_RPM_SUPPORT -DENABLE_LEGACY_WEAKDEPS=1 
> -DG_LOG_DOMAIN=\"C_CREATEREPOLIB\" -Dlibcreaterepo_c_EXPORTS 
> -I/<> -I/usr/include/glib-2.0 
> -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libxml2 
> -I/usr/include/modulemd-2.0 -g -O2 -Werror=implicit-function-declaration 
> -ffile-prefix-map=/<>=. -fstack-protector-strong 
> -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection 
> -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -DWITH_ZCHUNK -DWITH_LIBMODULEMD 
> -fPIC -MD -MT src/CMakeFiles/libcreaterepo_c.dir/xml_parser_updateinfo.c.o 
> -MF CMakeFiles/libcreaterepo_c.dir/xml_parser_updateinfo.c.o.d -o 
> CMakeFiles/libcreaterepo_c.dir/xml_parser_updateinfo.c.o -c 
> /<>/src/xml_parser_updateinfo.c
> [ 49%] Building C object src/CMakeFiles/libcreaterepo_c.dir/koji.c.o
> cd /<>/obj-x86_64-linux-gnu/src && /usr/bin/cc 
> -DCR_DELTA_RPM_SUPPORT -DENABLE_LEGACY_WEAKDEPS=1 
> -DG_LOG_DOMAIN=\"C_CREATEREPOLIB\" -Dlibcreaterepo_c_EXPORTS 
> -I/<> -I/usr/include/glib-2.0 
> -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libxml2 
> -I/usr/include/modulemd-2.0 -g -O2 -Werror=implicit-function-declaration 
> -ffile-prefix-map=/<>=. -fstack-protector-strong 
> -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection 
> -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -DWITH_ZCHUNK -DWITH_LIBMODULEMD 
>