• Bug#1066397: lgeneral: FTBFS: ../config.h:566:12: fatal error: direct.h

    From Lucas Nussbaum@21:1/5 to All on Wed Mar 13 13:10:03 2024
    Source: lgeneral
    Version: 1.4.4-2
    Severity: serious
    Justification: FTBFS
    Tags: trixie sid ftbfs
    User: lucas@debian.org
    Usertags: ftbfs-20240313 ftbfs-trixie

    Hi,

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


    Relevant part (hopefully):
    gcc -DHAVE_CONFIG_H -DDATADIR=\"/usr/share/games\" -DPREFIX=\"/usr\" -I. -I.. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -
    Wformat -Werror=format-security -fcf-protection -Wall -std=gnu89 -O0 -g -c -o portability.o portability.c
    In file included from localize.h:31,
    from localize.c:27:
    ../config.h:566:12: fatal error: direct.h: No such file or directory
    566 | # include <direct.h>
    | ^~~~~~~~~~
    In file included from portability.c:27:
    ../config.h:566:12: fatal error: direct.h: No such file or directory
    566 | # include <direct.h>
    | ^~~~~~~~~~
    compilation terminated.
    compilation terminated.
    make[3]: *** [Makefile:418: portability.o] Error 1


    The full build log is available from: http://qa-logs.debian.net/2024/03/13/lgeneral_1.4.4-2_unstable.log

    All bugs filed during this archive rebuild are listed at: https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=ftbfs-20240313;users=lucas@debian.org
    or: https://udd.debian.org/bugs/?release=na&merged=ign&fnewerval=7&flastmodval=7&fusertag=only&fusertagtag=ftbfs-20240313&fusertaguser=lucas@debian.org&allbugs=1&cseverity=1&ctags=1&caffected=1#results

    A list of current common problems and possible solutions is available at http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!

    If you reassign this bug to another package, please mark it as 'affects'-ing this package. See https://www.debian.org/Bugs/server-control#affects

    If you fail to reproduce this, please provide a build log and diff it with mine so that we can identify if something relevant changed in the meantime.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Guillem Jover@21:1/5 to Lucas Nussbaum on Fri May 3 21:10:01 2024
    Control: tag -1 patch

    Hi!

    On Wed, 2024-03-13 at 13:03:23 +0100, Lucas Nussbaum wrote:
    Source: lgeneral
    Version: 1.4.4-2
    Severity: serious
    Justification: FTBFS
    Tags: trixie sid ftbfs
    User: lucas@debian.org
    Usertags: ftbfs-20240313 ftbfs-trixie

    Relevant part (hopefully):
    gcc -DHAVE_CONFIG_H -DDATADIR=\"/usr/share/games\" -DPREFIX=\"/usr\" -I. -I.. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -
    Wformat -Werror=format-security -fcf-protection -Wall -std=gnu89 -O0 -g -c -o portability.o portability.c
    In file included from localize.h:31,
    from localize.c:27:
    ../config.h:566:12: fatal error: direct.h: No such file or directory
    566 | # include <direct.h>
    | ^~~~~~~~~~
    In file included from portability.c:27:
    ../config.h:566:12: fatal error: direct.h: No such file or directory
    566 | # include <direct.h>
    | ^~~~~~~~~~
    compilation terminated.
    compilation terminated.
    make[3]: *** [Makefile:418: portability.o] Error 1

    The attached patch should workaround this problem. From the patch
    description:

    Fix missing declaration for mkdir(2)

    The header where mkdir(2) is declared is <sys/stat.h> not <unistd.h>,
    which means that with new compilers that default to set
    -Werror=implicit-function-declaration, the configure check fails and
    causes the code to try to include a <direct.h> header that does not·
    exist on the system
    .
    We currently need to only change the generated configure because
    the package disables the autoreconf sequence, due to the upstream
    build system being out-of-date and failing to autoreconf cleanly.
    To fix this properly the build system should get updated, then the
    sequence re-enabled, and the change from here applied to the
    configure.ac instead.

    Thanks,
    Guillem

    diff -Nru lgeneral-1.4.4/debian/patches/implicit-decls.patch lgeneral-1.4.4/debian/patches/implicit-decls.patch
    --- lgeneral-1.4.4/debian/patches/implicit-decls.patch 1970-01-01 01:00:00.000000000 +0100
    +++ lgeneral-1.4.4/debian/patches/implicit-decls.patch 2024-05-03 20:54:06.000000000 +0200
    @@ -0,0 +1,31 @@
    +Description: Fix missing declaration for mkdir(2)
    + The header where mkdir(2) is declared is <sys/stat.h> not <unistd.h>,
    + which means that with new compilers that default to set
    + -Werror=implicit-function-declaration, the configure check fails and
    + causes the code to try to include a <direct.h> header that does not
    + exist on the system
    + .
    + We currently need to only change the generated configure because the
    + package disables the autoreconf sequence, due to the upstream build system
    + being out-of-date and failing to autoreconf cleanly. To fix this properly
    + the build system should get updated, then the sequence re-enabled, and the
    + change from here applied to the configure.ac instead.
    +Author: Guillem Jover <guillem@debian.org>
    +Origin: vendor
    +Forwarded: not-needed
    +
    +---
    + configur