Bug#1059723: xsnow FTCBFS: fails running toascii

2024-03-06 Thread Willem Vermin

Bug is solved in version 3.7.8

Willem



Bug#1059723: xsnow FTCBFS: fails running toascii

2023-12-31 Thread Helmut Grohne
Hi Willem,

On Sun, Dec 31, 2023 at 12:13:31PM +0100, Willem Vermin wrote:
> I made a proof of concept based on compiling a small xsnow using
> the build architecture compiler, only capable of producing the man page.

Cool!

> After finishing the new version, what should I do? Can I send you a tar
> or deb, or should I just upload to mentors?

As a sponsored package maintainer, I recommend continuing your usual
workflow which probably involves mentors.d.n. If the diff is not too big
and you have trouble finding a sponsor, you may Cc me on your RFS bug.

Helmut



Bug#1059723: xsnow FTCBFS: fails running toascii

2023-12-31 Thread Willem Vermin

Hi Helmut,

thanks for mentioning, suggestions and patch.
I made a proof of concept based on compiling a small xsnow using
the build architecture compiler, only capable of producing the man page.

After finishing the new version, what should I do? Can I send you a tar
or deb, or should I just upload to mentors?

Regards,

Willem

On 12/29/23 12:23, Helmut Grohne wrote:

Source: xsnow
Version: 1:3.7.6-1
Tags: patch upstream
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

xsnow fails to cross build from source, because it fails running toascii
with an Exec format error. Actually the failure is swept under the rug
and it only fails later on a negative array size as consequence. Such
continuing is a policy 4.6 violation and I encourage you to fix it.

That said, what really is the problem here is that toascii needs to be
built with the build architecture compiler. This is done with _FOR_BUILD
variants of the compiler. I'm attaching a patch, but you'll need a
dependency on autoconf-archive or update aclocal.m4 to use it.

Even with the patch applied, xsnow will not succeed in cross building as
it runs the build xsnow to generate its manual page. I don't have a good
solution to this. All options are annoying in some way:
  * Move the manual page to an Arch:all package.
  * Generate the manual page when creating a source package.
  * Make the cross build unreproducible and skip installing a manual page
there.
  * Build-Depend on xsnow:native  and run that.
  * Actually write a manual page rather than generating it from help
output.

Do you have a preference? In the mean time, please close this bug when
addressing just the toascii matter.

Helmut




Bug#1059723: xsnow FTCBFS: fails running toascii

2023-12-30 Thread Helmut Grohne
Source: xsnow
Version: 1:3.7.6-1
Tags: patch upstream
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

xsnow fails to cross build from source, because it fails running toascii
with an Exec format error. Actually the failure is swept under the rug
and it only fails later on a negative array size as consequence. Such
continuing is a policy 4.6 violation and I encourage you to fix it.

That said, what really is the problem here is that toascii needs to be
built with the build architecture compiler. This is done with _FOR_BUILD
variants of the compiler. I'm attaching a patch, but you'll need a
dependency on autoconf-archive or update aclocal.m4 to use it.

Even with the patch applied, xsnow will not succeed in cross building as
it runs the build xsnow to generate its manual page. I don't have a good
solution to this. All options are annoying in some way:
 * Move the manual page to an Arch:all package.
 * Generate the manual page when creating a source package.
 * Make the cross build unreproducible and skip installing a manual page
   there.
 * Build-Depend on xsnow:native  and run that.
 * Actually write a manual page rather than generating it from help
   output.

Do you have a preference? In the mean time, please close this bug when
addressing just the toascii matter.

Helmut
--- xsnow-3.7.6.orig/configure.ac
+++ xsnow-3.7.6/configure.ac
@@ -114,6 +114,7 @@
 AC_PROG_CXX([c++ g++])
 AC_PROG_INSTALL
 AC_PROG_RANLIB
+AC_PROG_CC_FOR_BUILD
 
 LIBS="-lm"
 # Checks for header files.
--- xsnow-3.7.6.orig/src/Makefile.am
+++ xsnow-3.7.6/src/Makefile.am
@@ -88,10 +88,10 @@
 tarfile.inc: $(tarfile) $(TOASCII)
 	@echo "Converting tarfile:"
 	ls -l $(tarfile)
-	export CC="$(CC)"; export CFLAGS="$(CFLAGS)"; $(TOASCII) < $(tarfile) > $@ 
+	env CC="$(CC_FOR_BUILD)" CFLAGS="$(CFLAGS_FOR_BUILD)" $(TOASCII) < $(tarfile) > $@ 
 else
 	tarfile.inc: 
-	echo "No selfrep compiled in" | $(TOASCII) > $@
+	echo "No selfrep compiled in" | env "CC=$(CC_FOR_BUILD)" CFLAGS="$(CFLAGS_FOR_BUILD)" $(TOASCII) > $@
 endif