Re: 2.2.0 make check failures on Solaris 10 sparc32 (problems with zlib?)

2009-09-15 Thread Kenton Varda
Committed as rev 228.  Thanks.

On Mon, Sep 14, 2009 at 7:46 PM, Oliver Jowett oliver.jow...@gmail.comwrote:


 Kenton Varda wrote:
  Can you review the diff, too?  At Google we have a policy of reviewing
  all changes.  Just tell me if it looks OK to you, or if there's anything
  you'd recommend changing (probably not since it's quite short).

 I looked at the diff and it seemed ok, but I'm no autoconf expert!

 -O

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: 2.2.0 make check failures on Solaris 10 sparc32 (problems with zlib?)

2009-08-28 Thread Kenton Varda
I'm planning to submit this when I get a free moment (it's been a very busy
week).  In the meantime, have you signed the CLA?
http://code.google.com/legal/individual-cla-v1.0.html -- If you own
copyright on this patch.
 http://code.google.com/legal/individual-cla-v1.0.html
http://code.google.com/legal/corporate-cla-v1.0.html -- If your employer
does.

On Sat, Aug 22, 2009 at 6:46 PM, Oliver Jowett oliver.jow...@gmail.comwrote:

 Kenton Varda wrote:
  Run configure --without-zlib to disable zlib support.  Alternatively,
  fix it and send me a patch.  :)

 I took a look at fixing it in gzip_stream.{cc,h} (conditionally removing
 GZIP format so you'd get compile errors if you tried to use that on a
 system with an old zlib), but it was going to be awkward without
 breaking backwards compatibility because the default format if not
 specified is GZIP.

 So here's a patch that just detects old zlib versions and disables zlib
 support entirely in that case.

 I have approximately zero experience in writing autoconf files, so this
 may be completely the wrong approach! I did test it on a couple of
 systems (one with zlib 1.2.3.3, one with zlib 1.1.4) and it appeared to
 do the right thing.

 -O

 Index: configure.ac
 ===
 --- configure.ac(revision 221)
 +++ configure.ac(working copy)
 @@ -82,14 +82,24 @@
  AC_FUNC_STRTOD
  AC_CHECK_FUNCS([ftruncate memset mkdir strchr strerror strtol])

 +# Checks for a sufficiently recent zlib
  HAVE_ZLIB=0
  AS_IF([test $with_zlib != no],
   [AC_SEARCH_LIBS([zlibVersion], [z],
 -[AC_DEFINE([HAVE_ZLIB], [1], [Enable classes using zlib compression.])
 - HAVE_ZLIB=1],
 -[if test $with_zlib != check; then
 -  AC_MSG_FAILURE([--with-zlib was given, but test for zlib failed])
 - fi])])
 +[AC_MSG_CHECKING([the zlib version])
 + AC_COMPILE_IFELSE(
 +   AC_LANG_PROGRAM([[
 +#include zlib.h
 +#if !defined(ZLIB_VERNUM) || (ZLIB_VERNUM  0x1204)
 +# error zlib version too old
 +#endif
 +]], []),
 +  [AC_MSG_RESULT([ok (1.2.0.4 or later)])
 +   AC_DEFINE([HAVE_ZLIB], [1], [Enable classes using zlib
 compression.])
 +   HAVE_ZLIB=1],
 +  [AC_MSG_RESULT([too old (1.2.0.3 or earlier)])])])])
 +AS_IF([test $with_zlib != check  test $HAVE_ZLIB = 0],
 +  [AC_MSG_FAILURE([--with-zlib was given, but test for zlib failed])])
  AM_CONDITIONAL([HAVE_ZLIB], [test $HAVE_ZLIB = 1])

  AS_IF([test $with_protoc != no], [



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: 2.2.0 make check failures on Solaris 10 sparc32 (problems with zlib?)

2009-08-22 Thread Kenton Varda
Run configure --without-zlib to disable zlib support.  Alternatively, fix it
and send me a patch.  :)

On Fri, Aug 21, 2009 at 8:44 PM, Oliver Jowett oliver.jow...@gmail.comwrote:


 Oliver Jowett wrote:

  The tests start failing here:
 
  [--] 14 tests from IoTest
  [ RUN  ] IoTest.ArrayIo
  [   OK ] IoTest.ArrayIo (4 ms)
  [ RUN  ] IoTest.GzipIo
  google/protobuf/io/zero_copy_stream_unittest.cc:194: Failure
  Value of: WriteToOutput(output, str.c_str(), str.size())
Actual: false
  Expected: true
  google/protobuf/io/zero_copy_stream_unittest.cc:194: Failure
  Value of: WriteToOutput(output, str.c_str(), str.size())
Actual: false
  Expected: true
  google/protobuf/io/zero_copy_stream_unittest.cc:194: Failure
  Value of: WriteToOutput(output, str.c_str(), str.size())
Actual: false
  Expected: true
 
  and it all goes downhill from there.
 
  zlib is the system-installed /usr/lib/libz.so, which appears to be zlib
  1.1.4.

 I added some tracing to gzip_stream.cc and the problem appears to be
 that deflateInit2() is returning Z_STREAM_ERROR.

 Looking at the headers for zlib 1.1.4 it appears that older versions
 don't support the gzip wrapper encoding bits being passed as part of
 windowBits. The zlib changelog says that feature was only introduced in
 1.2.0.4

 Perhaps protobuf could check for (defined(ZLIB_VERNUM)  ZLIB_VERNUM =
 0x1204) or similar before using the magic windowBits feature?

 -O

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: 2.2.0 make check failures on Solaris 10 sparc32 (problems with zlib?)

2009-08-22 Thread Oliver Jowett
Kenton Varda wrote:
 Run configure --without-zlib to disable zlib support.  Alternatively,
 fix it and send me a patch.  :)

I took a look at fixing it in gzip_stream.{cc,h} (conditionally removing
GZIP format so you'd get compile errors if you tried to use that on a
system with an old zlib), but it was going to be awkward without
breaking backwards compatibility because the default format if not
specified is GZIP.

So here's a patch that just detects old zlib versions and disables zlib
support entirely in that case.

I have approximately zero experience in writing autoconf files, so this
may be completely the wrong approach! I did test it on a couple of
systems (one with zlib 1.2.3.3, one with zlib 1.1.4) and it appeared to
do the right thing.

-O

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---

Index: configure.ac
===
--- configure.ac(revision 221)
+++ configure.ac(working copy)
@@ -82,14 +82,24 @@
 AC_FUNC_STRTOD
 AC_CHECK_FUNCS([ftruncate memset mkdir strchr strerror strtol])
 
+# Checks for a sufficiently recent zlib
 HAVE_ZLIB=0
 AS_IF([test $with_zlib != no],
   [AC_SEARCH_LIBS([zlibVersion], [z],
-[AC_DEFINE([HAVE_ZLIB], [1], [Enable classes using zlib compression.])
- HAVE_ZLIB=1],
-[if test $with_zlib != check; then
-  AC_MSG_FAILURE([--with-zlib was given, but test for zlib failed])
- fi])])
+[AC_MSG_CHECKING([the zlib version])
+ AC_COMPILE_IFELSE(
+   AC_LANG_PROGRAM([[
+#include zlib.h
+#if !defined(ZLIB_VERNUM) || (ZLIB_VERNUM  0x1204)
+# error zlib version too old
+#endif
+]], []),
+  [AC_MSG_RESULT([ok (1.2.0.4 or later)])
+   AC_DEFINE([HAVE_ZLIB], [1], [Enable classes using zlib compression.])
+   HAVE_ZLIB=1],
+  [AC_MSG_RESULT([too old (1.2.0.3 or earlier)])])])])
+AS_IF([test $with_zlib != check  test $HAVE_ZLIB = 0],
+  [AC_MSG_FAILURE([--with-zlib was given, but test for zlib failed])])
 AM_CONDITIONAL([HAVE_ZLIB], [test $HAVE_ZLIB = 1])
 
 AS_IF([test $with_protoc != no], [