[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Backporting zlib 1.2.11 to Stretch



On 17.07.2018 22:35, Andreas Tille wrote:
Hi Yuriy,

thanks a lot for your patch suggestions.

On Tue, Jul 17, 2018 at 04:55:48PM +0300, Yuriy M. Kaminskiy wrote:
On 17.07.2018 16:37, Yuriy M. Kaminskiy wrote:
which means line 248 and 357 of this file

       https://salsa.debian.org/med-team/libbioparser-dev/blob/master/include/bioparser/bioparser.hpp



... okey, that was still broken, so I taken it more seriously, and actually compile tested it :-), see attached.

I noticed that

1) it requires libgtest-dev from buster (already available in stretch-backports) --- I added versioned dependency.

2) while this package *compiles* self-test, it does not actually *run* it --- I added some code (no idea if it is correct way to invoke it).

3) patched packages builds in pbuilder, self-test passes on amd64, but *FAILS* on i386. Have no idea if it is problem of my zlib compatibility patch, or upstream problem (see (2) above).

[----------] 6 tests from BioparserMhapTest
[ RUN      ] BioparserMhapTest.ParseWhole
/build/libbioparser-dev-1.2.0/test/bioparser_test.cpp:506: Failure
      Expected: 7822873U
      Which is: 7822873
To be equal to: total_value
      Which is: 7822813
[  FAILED  ] BioparserMhapTest.ParseWhole (1 ms)
[ RUN      ] BioparserMhapTest.CompressedParseWhole
/build/libbioparser-dev-1.2.0/test/bioparser_test.cpp:521: Failure
      Expected: 7822873U
      Which is: 7822873
To be equal to: total_value
      Which is: 7822813
[  FAILED  ] BioparserMhapTest.CompressedParseWhole (0 ms)
[ RUN      ] BioparserMhapTest.ParseInChunks
/build/libbioparser-dev-1.2.0/test/bioparser_test.cpp:538: Failure
      Expected: 7822873U
      Which is: 7822873
To be equal to: total_value
      Which is: 7822813
[  FAILED  ] BioparserMhapTest.ParseInChunks (0 ms)
[ RUN      ] BioparserMhapTest.CompressedParseInChunks
/build/libbioparser-dev-1.2.0/test/bioparser_test.cpp:555: Failure
      Expected: 7822873U
      Which is: 7822873
To be equal to: total_value
      Which is: 7822813
[  FAILED  ] BioparserMhapTest.CompressedParseInChunks (1 ms)
[ RUN      ] BioparserMhapTest.FormatError
[       OK ] BioparserMhapTest.FormatError (1 ms)
[ RUN      ] BioparserMhapTest.CompressedFormatError
[       OK ] BioparserMhapTest.CompressedFormatError (2 ms)
[----------] 6 tests from BioparserMhapTest (5 ms total)
...
[==========] 37 tests from 6 test cases ran. (658 ms total)
[  PASSED  ] 33 tests.
[  FAILED  ] 4 tests, listed below:
[  FAILED  ] BioparserMhapTest.ParseWhole
[  FAILED  ] BioparserMhapTest.CompressedParseWhole
[  FAILED  ] BioparserMhapTest.ParseInChunks
[  FAILED  ] BioparserMhapTest.CompressedParseInChunks

 4 FAILED TESTS
debian/rules:13: recipe for target 'override_dh_auto_test' failed


I've commited my attempts to Git[1].  Any further hints are welcome
and thanks again anyway

      Andreas.


[1] https://salsa.debian.org/med-team/libbioparser-dev


diff --git a/debian/changelog b/debian/changelog
index 923a3ad..689427b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libbioparser-dev (1.2.0-1~bpo9+1) stretch-backports; urgency=medium
+
+  * Rebuild for stretch-backports.
+
+ -- Yuriy M. Kaminskiy <yumkam+debian@gmail.com>  Tue, 17 Jul 2018 23:32:46 +0300
+
 libbioparser-dev (1.2.0-1) unstable; urgency=medium
 
   * Initial release (Closes: #901064)
diff --git a/debian/control b/debian/control
index 63fab05..b8caf7a 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@ Priority: optional
 Build-Depends: debhelper (>= 11~),
                cmake,
                zlib1g-dev,
-               libgtest-dev
+               libgtest-dev (>> 1.8.0-10~)
 Standards-Version: 4.1.4
 Vcs-Browser: https://salsa.debian.org/med-team/libibioparser-dev
 Vcs-Git: https://salsa.debian.org/med-team/libbioparser-dev.git
diff --git a/debian/patches/gzip-128.patch b/debian/patches/gzip-128.patch
new file mode 100644
index 0000000..d00eb78
--- /dev/null
+++ b/debian/patches/gzip-128.patch
@@ -0,0 +1,77 @@
+diff --git a/include/bioparser/bioparser.hpp b/include/bioparser/bioparser.hpp
+index 9b74e3d..7c13c85 100644
+--- a/include/bioparser/bioparser.hpp
++++ b/include/bioparser/bioparser.hpp
+@@ -11,6 +11,7 @@
+ #include <memory>
+ #include <string>
+ #include <vector>
++#include <climits>
+ 
+ #include "zlib.h"
+ 
+@@ -245,8 +246,10 @@ bool FastaParser<T>::parse_objects(std::vector<std::unique_ptr<T>>& dst,
+ 
+     while (!is_end) {
+ 
+-        uint64_t read_bytes = gzfread(this->buffer_.data(), sizeof(char),
+-            this->buffer_.size(), input_file);
++        uint64_t read_bytes = std::max(0,
++                gzread(input_file, this->buffer_.data(),
++                    static_cast<unsigned>(std::min(this->buffer_.size(),
++                            static_cast<size_t>(INT_MAX)))));
+         is_end = gzeof(input_file);
+ 
+         total_bytes += read_bytes;
+@@ -354,8 +357,10 @@ bool FastqParser<T>::parse_objects(std::vector<std::unique_ptr<T>>& dst,
+ 
+     while (!is_end) {
+ 
+-        uint64_t read_bytes = gzfread(this->buffer_.data(), sizeof(char),
+-            this->buffer_.size(), input_file);
++        uint64_t read_bytes = std::max(0,
++                gzread(input_file, this->buffer_.data(),
++                    static_cast<unsigned>(std::min(this->buffer_.size(),
++                            static_cast<size_t>(INT_MAX)))));
+         is_end = gzeof(input_file);
+ 
+         total_bytes += read_bytes;
+@@ -478,8 +483,10 @@ bool MhapParser<T>::parse_objects(std::vector<std::unique_ptr<T>>& dst,
+ 
+     while (!is_end) {
+ 
+-        uint64_t read_bytes = gzfread(this->buffer_.data(), sizeof(char),
+-            this->buffer_.size(), input_file);
++        uint64_t read_bytes = std::max(0,
++                gzread(input_file, this->buffer_.data(),
++                    static_cast<unsigned>(std::min(this->buffer_.size(),
++                            static_cast<size_t>(INT_MAX)))));
+         is_end = gzeof(input_file);
+ 
+         total_bytes += read_bytes;
+@@ -621,8 +628,10 @@ bool PafParser<T>::parse_objects(std::vector<std::unique_ptr<T>>& dst,
+ 
+     while (!is_end) {
+ 
+-        uint64_t read_bytes = gzfread(this->buffer_.data(), sizeof(char),
+-            this->buffer_.size(), input_file);
++        uint64_t read_bytes = std::max(0,
++                gzread(input_file, this->buffer_.data(),
++                    static_cast<unsigned>(std::min(this->buffer_.size(),
++                            static_cast<size_t>(INT_MAX)))));
+         is_end = gzeof(input_file);
+ 
+         total_bytes += read_bytes;
+@@ -780,8 +789,10 @@ bool SamParser<T>::parse_objects(std::vector<std::unique_ptr<T>>& dst,
+ 
+     while (!is_end) {
+ 
+-        uint64_t read_bytes = gzfread(this->buffer_.data(), sizeof(char),
+-            this->buffer_.size(), input_file);
++        uint64_t read_bytes = std::max(0,
++                gzread(input_file, this->buffer_.data(),
++                    static_cast<unsigned>(std::min(this->buffer_.size(),
++                            static_cast<size_t>(INT_MAX)))));
+         is_end = gzeof(input_file);
+ 
+         total_bytes += read_bytes;
diff --git a/debian/patches/series b/debian/patches/series
index 866f5f9..f74ea46 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 use_debian_packaged_libs.patch
+gzip-128.patch
diff --git a/debian/rules b/debian/rules
index 475e05b..b4a3f41 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,3 +9,5 @@ DEB_CMAKE_EXTRA_FLAGS = -Dbioparser_build_tests=ON
 
 override_dh_auto_configure:
 	dh_auto_configure -- $(DEB_CMAKE_EXTRA_FLAGS)
+override_dh_auto_test:
+	set -e -x; for f in obj-*/bin/*_test; do [ ! -x $$f ] || $$f; done

Reply to: