#1081085 nim-docopt: FTBFS: src/docopt.nim:237:18: error: assignment to ‘tyObject_PatterncolonObjectType___PCofIhTSzvWNUhpfrBhs0w *’ from incompatible pointer type ‘tyObject_ArgumentcolonObjectType___dYdIF3WfZnSQVqfaNmhqRg *’ [-Wincompatible-pointer-types]

#1081085#5
Date:
2024-09-07 23:53:13 UTC
From:
To:
Dear maintainer:

During a rebuild of all packages in unstable, your package failed to build:
--------------------------------------------------------------------------------
[...]
  debian/rules binary
dh binary
    dh_update_autotools_config
    dh_autoreconf
    debian/rules override_dh_auto_test
make[1]: Entering directory '/<<PKGBUILDDIR>>'
nim c -p=/usr/share/nimble/unicodedb/ -p=/usr/share/nimble/unicodeplus/ -p=/usr/share/nimble/regex/ --nimcache:/<<PKGBUILDDIR>>/tests/nimcache test/test.nim
/<<PKGBUILDDIR>>/src/docopt.nim(16, 28) Warning: inherit from a more precise exception type like ValueError, IOError or OSError. If these don't suit, inherit from CatchableError or Defect. [InheritFromException]
/<<PKGBUILDDIR>>/src/docopt.nim(18, 19) Warning: inherit from a more precise exception type like ValueError, IOError or OSError. If these don't suit, inherit from CatchableError or Defect. [InheritFromException]
/<<PKGBUILDDIR>>/src/docopt.nim(145, 30) Warning: use `delete(s, first..last)`; delete is deprecated [Deprecated]
/<<PKGBUILDDIR>>/test/test.nim(28, 12) Warning: See corresponding Defect; AssertionError is deprecated [Deprecated]
/<<PKGBUILDDIR>>/src/docopt.nim: In function ‘single_match__test_1628’:
/<<PKGBUILDDIR>>/src/docopt.nim:237:18: error: assignment to ‘tyObject_PatterncolonObjectType___PCofIhTSzvWNUhpfrBhs0w *’ from incompatible pointer type ‘tyObject_ArgumentcolonObjectType___dYdIF3WfZnSQVqfaNmhqRg *’ [-Wincompatible-pointer-types]
   237 |             return (n, argument(self.name, pattern.value))
       |                  ^
/<<PKGBUILDDIR>>/src/docopt.nim: In function ‘single_match__test_1640’:
/<<PKGBUILDDIR>>/src/docopt.nim:244:19: error: assignment to ‘tyObject_PatterncolonObjectType___PCofIhTSzvWNUhpfrBhs0w *’ from incompatible pointer type ‘tyObject_CommandcolonObjectType___dAahPpfcKoNHbIKh7y5kNg *’ [-Wincompatible-pointer-types]
   244 |                 return (n, command(self.name, val(true)))
       |                   ^
Error: execution of an external compiler program 'gcc -c  -w -fmax-errors=3 -pthread -g3 -Og   -I/usr/lib/nim/lib -I/<<PKGBUILDDIR>>/test -o /<<PKGBUILDDIR>>/tests/nimcache/@mtest.nim.c.o /<<PKGBUILDDIR>>/tests/nimcache/@mtest.nim.c' failed with exit code: 1


make[1]: *** [debian/rules:10: override_dh_auto_test] Error 1
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:5: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
--------------------------------------------------------------------------------

The above is just how the build ends and not necessarily the most relevant part.
If required, the full build log is available here:

https://people.debian.org/~sanvila/build-logs/202409/

About the archive rebuild: The build was made on virtual machines
of type m6a.large and r6a.large from AWS, using sbuild and a
reduced chroot with only build-essential packages.

If you could not reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and affects, so that this is still visible in the BTS web
page for this package.

Thanks.

#1081085#10
Date:
2024-09-11 20:52:57 UTC
From:
To:
Hello there,

If I trust Nim forum upstream[1], the nim compiler is failing to
operate properly with gcc-14.  Until a newer Nim version fixing
these issues is released, the best approach to work around these
build failure might be to build the packages with CFLAGS set to
downgrade the severity of the warnings.

[1]: https://forum.nim-lang.org/t/11587

For all I can tell, if accomodating all the warnings gone fatal
by default in gcc-14 is a problem for the nim compiler, gcc-14
porting guide[2] suggests to inline pragmas this way in its
section "Accomodating C code generators":

	#if defined __GNUC__ && __GNUC__ >= 14
	#pragma GCC diagnostic warning "-Wimplicit-function-declaration"
	#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
	#pragma GCC diagnostic warning "-Wint-conversion"
	#pragma GCC diagnostic warning "-Wreturn-mismatch"
	#endif

but that would be something to apply to the nim compiler itself,
unless they're after solutions, not workarounds.

[2]: https://gcc.gnu.org/gcc-14/porting_to.html

Have a nice day,  :)