Control: tags -1 + patch On Sun, 25 Dec 2016 09:53:15 +0000 Chris Lamb <[email protected]> wrote: > Source: ruby-rabl > Version: 0.13.0-1 > Severity: serious > Justification: fails to build from source > User: [email protected] > Usertags: ftbfs > X-Debbugs-Cc: [email protected] > > Dear Maintainer, > > ruby-rabl fails to build from source in unstable/amd64: > > [â¦] > > at «BUILDDIR»/lib/rabl/template.rb:15:in `evaluate' > at «BUILDDIR»/lib/rabl/engine.rb:47:in `render' > at «BUILDDIR»/lib/rabl/engine.rb:380:in `cache_results' > at «BUILDDIR»/lib/rabl/engine.rb:48:in `block in render' > at «BUILDDIR»/lib/rabl/engine.rb:154:in `to_bson' > > [31mERROR[0m > Rabl::Engine without bson root #collection asserts that it sets root node > for objects => undefined method `serialize' for BSON:Module occured [snip]
This is caused by upgrade of ruby-bson from v1.10.0 to v4.2.x. From
ruby-bson upstream's changelog:
2.0.0
Backwards Incompatible Changes
...
BSON.serialize is no longer the entry point to serialize a BSON
document into its raw bytes.
Patch proposal attached.
Thanks,
_g.
diff -Nru ruby-rabl-0.13.0/debian/changelog ruby-rabl-0.13.0/debian/changelog --- ruby-rabl-0.13.0/debian/changelog 2016-08-24 12:43:46.000000000 +0200 +++ ruby-rabl-0.13.0/debian/changelog 2017-02-05 16:02:01.000000000 +0100 @@ -1,3 +1,11 @@ +ruby-rabl (0.13.0-1.1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * def-bson-serialize.patch: reintroduce BSON.serialize method dropped + from ruby-bson since release 2.0.0 (closes: #849315) + + -- Gilles Filippini <[email protected]> Sun, 05 Feb 2017 16:02:01 +0100 + ruby-rabl (0.13.0-1) unstable; urgency=medium * Imported Upstream version 0.13.0 diff -Nru ruby-rabl-0.13.0/debian/patches/def-bson-serialize.patch ruby-rabl-0.13.0/debian/patches/def-bson-serialize.patch --- ruby-rabl-0.13.0/debian/patches/def-bson-serialize.patch 1970-01-01 01:00:00.000000000 +0100 +++ ruby-rabl-0.13.0/debian/patches/def-bson-serialize.patch 2017-02-05 16:02:01.000000000 +0100 @@ -0,0 +1,36 @@ +Description: From ruby-bson upstream changelog [1]: + 2.0.0 + Backwards Incompatible Changes + ... + BSON.serialize is no longer the entry point to serialize a BSON + document into its raw bytes. + For Ruby runtimes that support ordered hashes, you may simply call + `to_bson` on the hash instance (Alternatively a `BSON::Document` is + also a hash: + { key: "value" }.to_bson + BSON::Document[:key, "value"].to_bson + For Ruby runtimes that do not support ordered hashes, then you must + instantiate an instance of a `BSON::Document` (which is a subclass of + hash) and call `to_bson` on that, since the BSON specification + guarantees order of the fields: + BSON::Document[:key, "value"].to_bson + . + [1] https://github.com/mongodb/bson-ruby/blob/master/CHANGELOG.md + . + This patch re-introduces BSON.serialize. +Author: Gilles Filippini <[email protected]> +Bug-Debian: https://bugs.debian.org/849315 +Index: ruby-rabl-0.13.0/lib/rabl/configuration.rb +=================================================================== +--- ruby-rabl-0.13.0.orig/lib/rabl/configuration.rb ++++ ruby-rabl-0.13.0/lib/rabl/configuration.rb +@@ -7,6 +7,9 @@ end + # We load the bson library if it is available. + begin + require 'bson' ++ def BSON.serialize data ++ data.to_bson ++ end + rescue LoadError + end + diff -Nru ruby-rabl-0.13.0/debian/patches/series ruby-rabl-0.13.0/debian/patches/series --- ruby-rabl-0.13.0/debian/patches/series 1970-01-01 01:00:00.000000000 +0100 +++ ruby-rabl-0.13.0/debian/patches/series 2017-02-05 16:02:01.000000000 +0100 @@ -0,0 +1 @@ +def-bson-serialize.patch
signature.asc
Description: OpenPGP digital signature

