[Git][debian-gis-team/libosmium][master] 4 commits: Ignore test failures on sh4.

Bas Couwenberg gitlab at salsa.debian.org
Mon Jul 23 16:02:45 BST 2018


Bas Couwenberg pushed to branch master at Debian GIS Project / libosmium


Commits:
80329d46 by Bas Couwenberg at 2018-07-23T12:07:17+02:00
Ignore test failures on sh4.

- - - - -
463f6583 by Bas Couwenberg at 2018-07-23T14:02:37+02:00
Don't ignore test failures on architectures arm*/mips*/ppc*/sparc*.

- - - - -
6832a7f7 by Bas Couwenberg at 2018-07-23T16:40:13+02:00
Add upstream patch to fix test failure on big endian architectures.

- - - - -
4795bc0c by Bas Couwenberg at 2018-07-23T16:40:24+02:00
Set distribution to unstable.

- - - - -


4 changed files:

- debian/changelog
- + debian/patches/0001-Rewrite-code-to-be-byte-order-independent.patch
- + debian/patches/series
- debian/rules


Changes:

=====================================
debian/changelog
=====================================
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+libosmium (2.14.1-2) unstable; urgency=medium
+
+  * Ignore test failures on sh4.
+  * Don't ignore test failures on architectures arm*/mips*/ppc*/sparc*.
+  * Add upstream patch to fix test failure on big endian architectures.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Mon, 23 Jul 2018 16:40:14 +0200
+
 libosmium (2.14.1-1) unstable; urgency=medium
 
   * New upstream release.


=====================================
debian/patches/0001-Rewrite-code-to-be-byte-order-independent.patch
=====================================
--- /dev/null
+++ b/debian/patches/0001-Rewrite-code-to-be-byte-order-independent.patch
@@ -0,0 +1,74 @@
+Description: Rewrite code to be byte-order independent.
+Author: Jochen Topf <jochen at topf.org>
+Origin: https://github.com/osmcode/libosmium/commit/ff16782fb7421d1af8120d5f519bc1b4e6453e71
+Bug: https://github.com/osmcode/libosmium/issues/263
+
+--- a/include/osmium/io/detail/pbf_input_format.hpp
++++ b/include/osmium/io/detail/pbf_input_format.hpp
+@@ -44,7 +44,6 @@ DEALINGS IN THE SOFTWARE.
+ #include <osmium/thread/util.hpp>
+ #include <osmium/util/config.hpp>
+ 
+-#include <protozero/byteswap.hpp>
+ #include <protozero/pbf_message.hpp>
+ #include <protozero/types.hpp>
+ 
+@@ -97,18 +96,20 @@ namespace osmium {
+                  * the length of the following BlobHeader.
+                  */
+                 uint32_t read_blob_header_size_from_file() {
+-                    uint32_t size_in_network_byte_order;
++                    uint32_t size;
+ 
+                     try {
+-                        const std::string input_data{read_from_input_queue(sizeof(size_in_network_byte_order))};
+-                        size_in_network_byte_order = *reinterpret_cast<const uint32_t*>(input_data.data());
++                        // size is encoded in network byte order
++                        const std::string input_data{read_from_input_queue(sizeof(size))};
++                        const char* d = input_data.data();
++                        size = (static_cast<uint32_t>(d[3])) |
++                               (static_cast<uint32_t>(d[2]) << 8u) |
++                               (static_cast<uint32_t>(d[1]) << 16u) |
++                               (static_cast<uint32_t>(d[0]) << 24u);
+                     } catch (const osmium::pbf_error&) {
+                         return 0; // EOF
+                     }
+ 
+-                    uint32_t size = size_in_network_byte_order;
+-                    ::protozero::byteswap_inplace(&size);
+-
+                     if (size > static_cast<uint32_t>(max_blob_header_size)) {
+                         throw osmium::pbf_error{"invalid BlobHeader size (> max_blob_header_size)"};
+                     }
+--- a/include/osmium/io/detail/pbf_output_format.hpp
++++ b/include/osmium/io/detail/pbf_output_format.hpp
+@@ -62,7 +62,6 @@ DEALINGS IN THE SOFTWARE.
+ #include <osmium/util/misc.hpp>
+ #include <osmium/visitor.hpp>
+ 
+-#include <protozero/byteswap.hpp>
+ #include <protozero/pbf_builder.hpp>
+ #include <protozero/pbf_writer.hpp>
+ #include <protozero/types.hpp>
+@@ -193,13 +192,16 @@ namespace osmium {
+                     // data plus a few header bytes (https://zlib.net/zlib_tech.html).
+                     pbf_blob_header.add_int32(FileFormat::BlobHeader::required_int32_datasize, static_cast<int32_t>(blob_data.size()));
+ 
+-                    auto sz = static_cast<uint32_t>(blob_header_data.size());
+-                    ::protozero::byteswap_inplace(&sz);
++                    const auto size = static_cast<uint32_t>(blob_header_data.size());
+ 
+-                    // write to output: the 4-byte BlobHeader-Size followed by the BlobHeader followed by the Blob
++                    // write to output: the 4-byte BlobHeader size in network
++                    // byte order followed by the BlobHeader followed by the Blob
+                     std::string output;
+-                    output.reserve(sizeof(sz) + blob_header_data.size() + blob_data.size());
+-                    output.append(reinterpret_cast<const char*>(&sz), sizeof(sz));
++                    output.reserve(4 + blob_header_data.size() + blob_data.size());
++                    output += static_cast<char>((size >> 24u) & 0xffu);
++                    output += static_cast<char>((size >> 16u) & 0xffu);
++                    output += static_cast<char>((size >>  8u) & 0xffu);
++                    output += static_cast<char>( size         & 0xffu);
+                     output.append(blob_header_data);
+                     output.append(blob_data);
+ 


=====================================
debian/patches/series
=====================================
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Rewrite-code-to-be-byte-order-independent.patch


=====================================
debian/rules
=====================================
--- a/debian/rules
+++ b/debian/rules
@@ -21,7 +21,7 @@ override_dh_auto_build-indep:
 
 override_dh_auto_test-arch:
 # Ignore test failures on problematic architectures only
-ifneq (,$(filter $(DEB_BUILD_ARCH),arm64 mips mipsel ppc64 ppc64el sparc64))
+ifneq (,$(filter $(DEB_BUILD_ARCH),sh4))
 	(cd build && ctest -V || echo "Ignoring test failures")
 else
 	(cd build && ctest -V)



View it on GitLab: https://salsa.debian.org/debian-gis-team/libosmium/compare/f590ab641ba485a7f4b55bd4a0f7dccdf5312500...4795bc0ccac185216d0d58b9943384ff27a1cfee

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/libosmium/compare/f590ab641ba485a7f4b55bd4a0f7dccdf5312500...4795bc0ccac185216d0d58b9943384ff27a1cfee
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20180723/17a98cf4/attachment-0001.html>


More information about the Pkg-grass-devel mailing list