[Pkg-zsh-devel] Bug#1075708: zsh: FTBFS with GCC-14

Simon McVittie smcv at debian.org
Sat Aug 3 17:56:30 BST 2024


On Wed, 03 Jul 2024 at 12:50:04 +0000, Matthias Klose wrote:
> The package fails to build in a test rebuild on at least amd64 with
> gcc-14/g++-14, but succeeds to build with gcc-13/g++-13.
...
> ../../../Src/Modules/termcap.c:45:14: error: conflicting types for ‘boolcodes’; have ‘char *[]’
>    45 | static char *boolcodes[] = {
>       |              ^~~~~~~~~
> In file included from ../../Src/zshterm.h:1,
>                  from ../../../Src/zsh_system.h:932,
>                  from ./../../Src/zsh.mdh:15,
>                  from ./termcap.mdh:15,
>                  from ../../../Src/Modules/termcap.c:38:
> /usr/include/term.h:783:56: note: previous declaration of ‘boolcodes’ with type ‘const char * const[]’
>   783 | extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[];
>       |                                                        ^~~~~~~~~

Please consider applying the attached patch, taken from upstream git.
gcc 14 also produces several compiler warnings which I think would be
useful to look into, but those don't break the build and hopefully don't
indicate serious bugs.

I tried compiling this in my usual build environment (sbuild inside
an amd64 Debian 12 VM) and on the amd64 porterbox barriere, and the
dh_auto_build step finishes successfully.

Unfortunately, while this patch fixes the issue that Matthias reported, it
doesn't seem to be a complete solution to making zsh build successfully:
there are at least two other reasons why it fails to build from source
with `debuild -B`, described below.

`debuild -A` (Architecture: all only) does succeed with the attached
patch.

Hang during build-time tests
============================

During dh_auto_test, the test hangs for a significant time, with no
obvious CPU load, and this output:

>    debian/rules override_dh_auto_test-arch
> make[1]: Entering directory '/home/smcv/zsh'
> if dpkg-architecture -qDEB_BUILD_ARCH_OS | grep -qv hurd; then \
>         HOME="/home/smcv/zsh/obj/testhome" ZTST_verbose=1 dh_auto_test -B obj; \
> fi
>         cd obj && make -j4 test "TESTSUITEFLAGS=-j4 --verbose" VERBOSE=1
> make[2]: Entering directory '/home/smcv/zsh/obj'
> cd Test ; make check
> make[3]: Entering directory '/home/smcv/zsh/obj/Test'
> if test -n "ld"; then \
>   cd .. && DESTDIR= \
>   make MODDIR=`pwd`/Test/Modules install.modules > /dev/null; \
> fi
> if test -z "$ZTST_handler"; then \
>   ZTST_handler=runtests.zsh; \
> fi; \
> if ZTST_testlist="`for f in ../../Test/*.ztst; \
>            do echo $f; done`" \
>  ZTST_srcdir="../../Test" \
>  ZTST_exe=../Src/zsh \
>  ../Src/zsh +Z -f ../../Test/$ZTST_handler; then \
>  stat=0; \
> else \
>  stat=1; \
> fi; \
> sleep 1; \
> rm -rf Modules .zcompdump; \
> exit $stat
> ../../Test/A01grammar.ztst: starting.
> Running test: Test skipping if ZTST_test_skip is set

This is reproducible on barriere.

I see that there is already a patch applied,
debian/patches/further-mitigate-test-suite-hangs.patch.
Perhaps it will be necessary to further further mitigate test-suite hangs...

Or perhaps the affected tests could be skipped without harming coverage
too much?

missing files: obj/Src/Modules/*.h
==================================

If I skip the build-time tests with DEB_BUILD_OPTIONS=nocheck, instead
I get this build failure:

>    dh_install
> dh_install: warning: Cannot find (any matches for) "obj/Src/Modules/*.h" (tried in ., debian/tmp)
>
> dh_install: warning: zsh-dev missing files: obj/Src/Modules/*.h
> dh_install: error: missing files, aborting

This is also reproducible on barriere. I don't know what has changed to
stop these headers from being generated.

I'm sorry I couldn't fully fix the build of this package, but I hope the
patch I attached is a useful step in the right direction.

    smcv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 52383-Avoid-incompatible-pointer-types-in-terminfo-global.patch
Type: text/x-diff
Size: 3021 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-zsh-devel/attachments/20240803/330f2a1f/attachment.patch>


More information about the Pkg-zsh-devel mailing list