Bug 1636817

Summary: In C++11 the shared_ptr -> bool conversion is explicit. In custom time zone code, make the cast explicit. Fixes compilation failure in C++11
Product: Red Hat Enterprise Linux 7 Reporter: bugzilla
Component: boostAssignee: Jonathan Wakely <jwakely>
Status: CLOSED ERRATA QA Contact: Michal Kolar <mkolar>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: alanm, amike, brclark, jwright, law, mkolbas
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-31 19:53:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1710255    
Attachments:
Description Flags
gnucash.spec to enabile build to test this bug none

Description bugzilla 2018-10-07 22:46:28 UTC
Description of problem:

In C++11 the shared_ptr -> bool conversion is explicit. In custom time zone code, make the cast explicit. Fixes compilation failure in C++11

Please see patch and either upstream as boost 1.53-(release+1) or include 1.54 in next el7 release:

https://www.boost.org/patches/1_54_0/002-date-time.patch

Version-Release number of selected component (if applicable):

boost-1.53.0-27

How reproducible:

very

Steps to Reproduce:

NOTE: building gnucash on el7 requires EPEL---but the bug is not from EPEL, it is in the base `boost` library.

1. download https://download.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/source/tree/Packages/g/gnucash-3.3-1.fc30.src.rpm
2. yum install epel-release
3. yum build-dep gnucash-3.3-1.fc30.src.rpm
4. yum install boost-devel libsoup-devel
5. rpmbuild -bb <attached gnucash.spec>
   #^^ the attached spec was modified slightly to build on el7

Actual results:

/usr/include/boost/date_time/local_time/custom_time_zone.hpp: In instantiation of ‘bool boost::local_time::custom_time_zone_base<CharT>::has_dst() const [with CharT = char]’:
/root/rpmbuild/BUILD/gnucash-3.3/libgnucash/engine/gnc-timezone.cpp:756:1:   required from here
/usr/include/boost/date_time/local_time/custom_time_zone.hpp:67:30: error: cannot convert ‘const boost::shared_ptr<boost::date_time::dst_day_calc_rule<boost::gregorian::date> >’ to ‘bool’ in return
       return (dst_calc_rules_); //if calc_rule is set the tz has dst



Expected results:

It should compile ;)

Comment 2 Jonathan Wakely 2018-10-08 11:25:22 UTC
Moving boost to 1.54.0 in RHEL 7 is definitely not an option. I'll backport the patch to our release.

Comment 3 Jonathan Wakely 2019-01-15 17:28:04 UTC
This wasn't high enough priority to make the cut-off for fixes in rhel-7.7, so I'm moving it out to rhel-7.8 now.

I hope the fact it is blocking a downstream EPEL package (and is a really trivial fix with a patch available) will mean it makes the list for rhel-7.8

Comment 5 Michal Kolar 2019-11-19 06:08:13 UTC
Verified against boost-1.53.0-28.el7.

Comment 7 errata-xmlrpc 2020-03-31 19:53:01 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:1072