[Pkg-nginx-maintainers] Bug#1068207: Missing header from ngx_feature_test='printf("hello"); '

Ervin Hegedüs airween at gmail.com
Mon Apr 1 22:55:41 BST 2024


Package: libnginx-mod-http-ndk-dev
Version: 1:0.3.3-1

There is a module package for Nginx, which worked as well since
this FTBFS bug:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1067364

The upstream contains this section in config:

https://github.com/owasp-modsecurity/ModSecurity-nginx/blob/master/config#L15

ngx_feature_test='printf("hello");'

The problem is when the buildpackage process starts, I got this
error:

hecking for ModSecurity library ... not found
checking for ModSecurity library in /usr/local/modsecurity ... not found
 ./configure: error: ngx_http_modsecurity_module requires the ModSecurity library.

see sbuild.log:

http://qa-logs.debian.net/2024/03/19/libnginx-mod-http-modsecurity_1.0.3-1_unstable.log

I investigated the root issue, and I found this message in
obj-x86_64-linux-gnu/autoconf.err:

/home/airween/src/libnginx-mod-http-modsecurity-1.0.3/obj-x86_64-linux-gnu/autotest.c:7:5: note: include '<stdio.h>' or provide a declaration of 'printf'
cc1: some warnings being treated as errors
----------

#include <sys/types.h>
#include <unistd.h>
#include <modsecurity/modsecurity.h>

int main(void) {
    printf("hello");;
    return 0;
}
...
checking for ModSecurity library in /usr/local/modsecurity

/home/airween/src/libnginx-mod-http-modsecurity-1.0.3/obj-x86_64-linux-gnu/autotest.c: In function 'main':
/home/airween/src/libnginx-mod-http-modsecurity-1.0.3/obj-x86_64-linux-gnu/autotest.c:7:5: error: implicit declaration of function 'printf' [-Werror=implicit-function-declaration]
    7 |     printf("hello");;
      |     ^~~~~~
/home/airween/src/libnginx-mod-http-modsecurity-1.0.3/obj-x86_64-linux-gnu/autotest.c:5:1: note: include '<stdio.h>' or provide a declaration of 'printf'
    4 | #include <modsecurity/modsecurity.h>
  +++ |+#include <stdio.h>
    5 | 
/home/airween/src/libnginx-mod-http-modsecurity-1.0.3/obj-x86_64-linux-gnu/autotest.c:7:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
    7 |     printf("hello");;
      |     ^~~~~~
/home/airween/src/libnginx-mod-http-modsecurity-1.0.3/obj-x86_64-linux-gnu/autotest.c:7:5: note: include '<stdio.h>' or provide a declaration of 'printf'
cc1: some warnings being treated as errors
----------

#include <sys/types.h>
#include <unistd.h>
#include <modsecurity/modsecurity.h>

int main(void) {
    printf("hello");;
    return 0;
}

If I add a patch (via d/series) which adds this header correctly,
then everything is fine, the package builds as well.

The upstream isn't touched since 6 years (the mentioned file), so
I guess something is changed in libnginx-mod-http-ndk-dev (if it
is responsible to produce the test codes - I guess).

Note, that there isn't any user report in upstream regarding this
problem, actually I can reproduce this only in Debian.


Sorry if I'm wrong.


Thanks,


a.



More information about the Pkg-nginx-maintainers mailing list