Bug 1400147

Summary: rubygem-bson-4.2.0 is available
Product: [Fedora] Fedora Reporter: Upstream Release Monitoring <upstream-release-monitoring>
Component: rubygem-bsonAssignee: Vít Ondruch <vondruch>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dan, tdawson, vondruch, whearn
Target Milestone: ---Keywords: FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://jira.mongodb.org/browse/RUBY-1173
Whiteboard:
Fixed In Version: rubygem-bson-4.2.0-1.fc26 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-15 15:16:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Rebase-helper rebase-helper-debug.log log file. See for details and report the eventual error to rebase-helper https://github.com/phracek/rebase-helper/issues. none

Description Upstream Release Monitoring 2016-11-30 14:37:51 UTC
Latest upstream release: 4.2.0
Current version/release in rawhide: 4.1.1-1.fc26
URL: http://bsonspec.org

Please consult the package updates policy before you issue an update to a stable branch: https://fedoraproject.org/wiki/Updates_Policy

More information about the service that created this bug can be found at: https://fedoraproject.org/wiki/Upstream_release_monitoring

Please keep in mind that with any upstream change, there may also be packaging changes that need to be made. Specifically, please remember that it is your responsibility to review the new version to ensure that the licensing is still correct and that no non-free or legally problematic items have been added upstream.

Based on the information from anitya:  https://release-monitoring.org/project/4252/

Comment 1 Upstream Release Monitoring 2016-11-30 14:39:16 UTC
Patching or scratch build for rubygem-bson-4.1.1 failed.

Comment 2 Upstream Release Monitoring 2016-11-30 14:39:18 UTC
Created attachment 1226355 [details]
Rebase-helper rebase-helper-debug.log log file.
See for details and report the eventual error to rebase-helper https://github.com/phracek/rebase-helper/issues.

Comment 3 Upstream Release Monitoring 2016-11-30 14:39:20 UTC
Patches were not touched. All were applied properly

Comment 4 Vít Ondruch 2016-12-05 13:36:53 UTC
BigEndian architectures are not properly supported:

https://jira.mongodb.org/browse/RUBY-1173

Comment 5 Dan Horák 2016-12-07 12:31:26 UTC
with an update native-endian.h file

[sharkcz@tyan-openpower-01 bson]$ diff -u native-endian.h.orig native-endian.h 
--- native-endian.h.orig	2016-12-07 13:28:27.715599434 +0100
+++ native-endian.h	2016-12-07 13:27:23.605267632 +0100
@@ -36,10 +36,13 @@
 #endif
 
 #ifndef BSON_BYTE_ORDER
+# warning BSON_BYTE_ORDER not defined
 # if BYTE_ORDER == LITTLE_ENDIAN
 #  define BSON_BYTE_ORDER 1234
+#  warning define BSON_BYTE_ORDER as little
 # elif BYTE_ORDER == BIG_ENDIAN
 #  define BSON_BYTE_ORDER 4321
+#  warning define BSON_BYTE_ORDER as big
 # endif
 #endif
 
@@ -78,6 +81,7 @@
 #endif
 
 #if BSON_BYTE_ORDER == BSON_LITTLE_ENDIAN
+# warning We are little endian
 # define BSON_UINT16_TO_BE(v)    BSON_UINT16_SWAP_LE_BE(v)
 # define BSON_UINT32_FROM_LE(v)  ((uint32_t)v)
 # define BSON_UINT32_TO_LE(v)    ((uint32_t)v)
@@ -90,6 +94,7 @@
 # define BSON_DOUBLE_FROM_LE(v)  ((double)v)
 # define BSON_DOUBLE_TO_LE(v)    ((double)v)
 #elif BSON_BYTE_ORDER == BSON_BIG_ENDIAN
+# warning We are big endian
 # define BSON_UINT16_TO_BE(v)    ((uint16_t)v)
 # define BSON_UINT32_FROM_LE(v)  BSON_UINT32_SWAP_LE_BE(v)
 # define BSON_UINT32_TO_LE(v)    BSON_UINT32_SWAP_LE_BE(v)

I get following on ppc64 (bug endian), clearly the endian detection doesn't work

[sharkcz@tyan-openpower-01 bson]$ gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I.   -fPIC -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -Wall -g -std=c99 -m64 -o native.i -E native.c
In file included from native.c:21:0:
native-endian.h:39:3: warning: #warning BSON_BYTE_ORDER not defined [-Wcpp]
 # warning BSON_BYTE_ORDER not defined
   ^~~~~~~
native-endian.h:42:4: warning: #warning define BSON_BYTE_ORDER as little [-Wcpp]
 #  warning define BSON_BYTE_ORDER as little
    ^~~~~~~
native-endian.h:84:3: warning: #warning We are little endian [-Wcpp]
 # warning We are little endian
   ^~~~~~~

Comment 6 Dan Horák 2016-12-07 12:35:53 UTC
The problem is that BYTE_ORDER shouldn't be used, __BYTE_ORDER__ is the correct define to check, see https://bugzilla.redhat.com/show_bug.cgi?id=962091#c48 for more details.

Comment 7 Dan Horák 2016-12-07 12:57:28 UTC
--- native-endian.h.orig	2016-12-07 13:28:27.715599434 +0100
+++ native-endian.h	2016-12-07 13:56:53.564406614 +0100
@@ -36,11 +36,18 @@
 #endif
 
 #ifndef BSON_BYTE_ORDER
+#if defined(BYTE_ORDER)
 # if BYTE_ORDER == LITTLE_ENDIAN
 #  define BSON_BYTE_ORDER 1234
 # elif BYTE_ORDER == BIG_ENDIAN
 #  define BSON_BYTE_ORDER 4321
 # endif
+#elif defined(__BYTE_ORDER__)
+# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+#  define BSON_BYTE_ORDER 1234
+# elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+#  define BSON_BYTE_ORDER 4321
+# endif
 #endif
 
 #if defined(__sun)


could fix it

Comment 8 Vít Ondruch 2016-12-08 12:06:41 UTC
So far, I made the bson 4.1.1 buildable on all platforms, but 4.2.0 introduces support for Decimal128, which seems to be missing BE support. Waiting for upstream ...

Comment 9 Dan Horák 2016-12-08 12:30:26 UTC
fixing the Decimal128 type might be just adding a 16-byte swapping function/macro and using it in rb_bson_byte_buffer_get_decimal128_bytes() and rb_bson_byte_buffer_put_decimal128_bytes(), but let's give upstream a chance :-)

Comment 10 Upstream Release Monitoring 2016-12-15 15:12:40 UTC
vondruch's rubygem-bson-4.2.0-1.fc26 completed http://koji.fedoraproject.org/koji/buildinfo?buildID=825716