Bug#844789: GAP: issue related to compressed manual.six: PATCHES

2016-12-06 Thread Bill Allombert
On Fri, Dec 02, 2016 at 05:39:24AM +, Jerome BENOIT wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA512
> 
> Hello All,
> 
> finally I figured out a way to implement compression (gz) with the help
> of the zlib library rather than through gzip pipes. So snow Sage no more
> emits failures concerning GAP. Please find in attachment a patch that replaces
> gzip pipes with zlib high level functions, as well concomitant patches.
> I have also attached an updated d/p/series files: note that the patch
> d/p/fix-compressed-six-files is no more necessary and that some autoconf
> scripts have to be regenerated (I followed the hint given by 
> dpkg-builpackage).
> 
> The material could not be deposited at Alioth as there is no GAP repository 
> there.
> On the other hand, I have just uploaded the source ball, the debian stuff
> and the debballs at the Sage repository deb-sci-sage (see the Debain Sage page
> [1] for more inrmation); therefore it can be easily tested within a schroot 
> environment.
> 
> At last, as the main patch, namely fix-zlib-stringfile,  slightly improves
> the GAP kernel itself, it must also be applied to the libGAP package:
> I will do if it is effectively applied to GAP.

I am sorry, but I cannot apply that to gap. We are already during the
freeze.  This is too intrusive and does not solve any issue with gap.

However you can send this upstream.

But more importantly, this does not fix the underlying Sage bug that it
messes with signal of subprocesses. There are other uses of pipes in
GAP, and there are other software in Sage that use pipes+gzip (PARI/GP
at least).  So this patch is fixing the symptom and not the problem.
Using pipes is perfectly legitimate and has to be supported by Sage.

This bug should be reassigned to sage.

Cheers,
Bill.



Bug#844789: GAP: issue related to compressed manual.six: PATCHES

2016-12-01 Thread Jerome BENOIT
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Hello All,

finally I figured out a way to implement compression (gz) with the help
of the zlib library rather than through gzip pipes. So snow Sage no more
emits failures concerning GAP. Please find in attachment a patch that replaces
gzip pipes with zlib high level functions, as well concomitant patches.
I have also attached an updated d/p/series files: note that the patch
d/p/fix-compressed-six-files is no more necessary and that some autoconf
scripts have to be regenerated (I followed the hint given by dpkg-builpackage).

The material could not be deposited at Alioth as there is no GAP repository 
there.
On the other hand, I have just uploaded the source ball, the debian stuff
and the debballs at the Sage repository deb-sci-sage (see the Debain Sage page
[1] for more inrmation); therefore it can be easily tested within a schroot 
environment.

At last, as the main patch, namely fix-zlib-stringfile,  slightly improves
the GAP kernel itself, it must also be applied to the libGAP package:
I will do if it is effectively applied to GAP.

Looking forward for comments.

Thanks,
Jerome



[1] https://wiki.debian.org/DebianScience/Sage
- -- 
Jerome BENOIT | calculus+at-rezozer^dot*net
https://qa.debian.org/developer.php?login=calcu...@rezozer.net
AE28 AE15 710D FF1D 87E5  A762 3F92 19A6 7F36 C68B
-BEGIN PGP SIGNATURE-

iQQcBAEBCgAGBQJYQQkMAAoJED+SGaZ/NsaL/d4gAM9e8EYvCgQjPRKh3nN14vNV
yFCO7NsIvQx9Kl5ptKHZu/HGWF++1Ek7qzFkiESB52O0CrF+ZOtcDpH9TNZ+2IC1
LWL5PZucwfNBGbL243My95ye3oz2Zl19FaFonBlUmQ9PMpc3OLNQbFSFsFm+QzhU
qVmrvUMe04gM/cm2i9iDd9QDkGyC/57Sr/4QNyYO+AEH8EdbEIg67Skbq+zaNqJI
nFOByHH8BpbXvl8nWwSlXO+q8Ac6wnpAWH3xc04g9s3lYWqehpNRQXA0XyYeMxSv
dALK4bEjas8yR+HEkui6zzNZ3KOsvW90Y3Q8SN36teXtO7czz82HYS8hsYLbvb0S
k3ADvZqTJ0/khS3BrIsvApoEFwtVp5Qz5vwUuc31yhb8HlxBPtSHsSdKAzFOgmfL
RtDJIuADOlGgiPgGrh5jsTV+BI9QoNXEvaJG0Mn9BdRyCEqnn4+kcjdoWS8FAOqX
42uI2YrgvL0JBf5HhQkZ+uFG/WDUyGDLJhnQH1kXOVXprEBRzGHoR6snH1+QwYe7
a7YScVGt4M96sO6LY2vPpdigWkCkLx7p57k1V23WTxBG/2xpXkMhuE/xpakTIFhG
ms9d69n9PK3/jvjBRCtXdFqNjJ5LjWpOcw0NkM1OL60RbeEmijAD0ddM9TtUc7Be
6NtIXkMNxLb4fBOeEHbffbsPWPz02E67w+wKyBV/FY5RRWFToE9u3Umse5pk5SM/
2aJ5BDuy5granxQJBe9tDauWzq6T1bRAqxDqF4beugrS4MX3hxKod06P8Ley49CB
BEAw8y6uOsXt7hLiZzVX5ZpaAqnyo2lPudFM5XjusRRVkXlaszxQcGkrK3uAahjF
9MH3c2wBe7NM52L5Mrm61BnC/FuY26t5qxS3Hms8VsMk8vESAnWd94NT+6F7UhYr
I0j5ys+hb5sJZeWKcBfWu+xksY81IsHKoUw0hwRCSjg6nfaVGmsUg+361B2yJ7Tj
lwzM7r0oqgk8sgqvfp84BdA2UfRXGTP5tioy0IcSuS07uyN0DbStQoLaU1fcuczz
i/suxvjxEDxAfuwXmIfoQqiE/Y6aHqlzegc1Q6BrO+QZIekc5CT6KsuFim2jHEUX
AAr2Pi7RqGqtNhlPH8qdUjyrh5N1FXJuA1gED5sK3YndULb7v5IrBNLxXCHy0NDA
fnHH2f/rvRtRCR/E+pr7kp6U4Oydx2xROU9XhgED969FcwUHgyJkE5Q+PWv/8PO4
aTy8BQhRO0c5pinp/Qy24QGq1NLP1zyCboNQg5JalaheS9GlqTNbk5LE2frWsq3z
EB3uBejD+CYdVuSlbJLr7qkBcCyyz+TWn5OLqrnEbnBDw8Yrjwtp19fu5sjiu4s=
=LjqH
-END PGP SIGNATURE-
Description: zlib support
 Uncompressing .gz files on the fly through pipes causes the doctests failures
 related to GAP. This patch suggest to uncompress directly with zlib to avoid
 the underlying EPIPE signal mess that creates `Boken pipes'. The zlib support
 is implemented as custom stream through the GNU cookie facility. Furhtermore,
 besides the .gz compression format, other compression format (e.g., xz) can be
 easily compressed.
Origin: vendor, Debian
Forwarded: not-yet
Author: Jerome Benoit 
Last-Update: 2016-12-02

--- a/configure.in
+++ b/configure.in
@@ -152,6 +152,45 @@
   esac
 fi
 
+AC_ARG_WITH(zlib,
+  AC_HELP_STRING( [--with-zlib],
+[ Use ZLIB library.
+  If the argument you supply is "yes" or , then the version of ZLIB 
bundled with this GAP will be used (default).
+  If the argument is "system" that means the library is reachable with the 
standard search path "/usr" or "/usr/local".
+  Otherwise you give the  to the directory which contains the 
library.
+  If the argument is no, use original piping through gunzip instead of 
ZLIB.
+  [[default=yes]]
+]),
+  [ ],
+  [ with_zlib=yes ]
+)
+
+USE_ZLIB=yes
+case "$with_zlib" in
+  no)
+ZLIB_CFLAGS=""
+ZLIB_LIBS=""
+USE_ZLIB=no
+;;
+  yes)
+PKG_CHECK_MODULES(ZLIB,zlib >= 1.2.8,[],[])
+;;
+  system)
+ZLIB_CFLAGS=""
+ZLIB_LIBS="-lz"
+;;
+  *)
+# user specified directory
+ZLIB_HOME="$with_zlib"
+   if test -f ${ZLIB_HOME}/include/zlib.h && test -f 
${ZLIB_HOME}/lib/libz.a ; then
+  ZLIB_CFLAGS="-I${ZLIB_HOME}/include"
+  ZLIB_LIBS="${ZLIB_HOME}/lib/libz.a"
+else
+  AC_MSG_ERROR([Could not locate ZLIB in the specified location])
+fi;
+;;
+esac
+
 # Enabling/disabling readline is handled by the "inner" configure
 # script in cnf/, so we do nothing here (the command line flag
 # is automatically passed on to the "inner" configure script anyway.
@@ -164,6 +203,9 @@
 AC_SUBST(MAKE_GMP)
 AC_SUBST(USE_GMP)
 AC_SUBST(GMP_VER)
+AC_SUBST(ZLIB_CFLAGS)
+AC_SUBST(ZLIB_LIBS)
+AC_SUBST(USE_ZLIB)
 
 mkdir -p bin