diff options
author | Thanos Doukoudakis <thanos.doukoudakis@isode.com> | 2017-07-20 16:28:31 (GMT) |
---|---|---|
committer | Thanos Doukoudakis <thanos.doukoudakis@isode.com> | 2017-07-26 08:35:20 (GMT) |
commit | bc58d59636f28909d90464cea7ebf5eeb8f230be (patch) | |
tree | 67c77e5f10f15eb2ec6202591ed20e24cb1d9ede /BuildTools/SCons | |
parent | 810d77181de6408d54fd3a07964317d4866c732d (diff) | |
download | swift-bc58d59636f28909d90464cea7ebf5eeb8f230be.zip swift-bc58d59636f28909d90464cea7ebf5eeb8f230be.tar.bz2 |
Workaround Boost bug to prevent crash in recents loading
Boost 1.64 introduced a regression where boost::optional deserialisation
could lead to a crash when loading the recent chats.
This fix updates the way we serialise the ChatListWindow::Chat and
HighlightAction classes to avoid these errors.
A flag has been added, to allow the use of the erroneous version of the
library during the build. During runtime if needed, the client will skip
loading the data, to avoid any unpredicted behaviour.
Test-Information:
Tested on windows 10 with different versions of boost 1.56(bundled), 1.63,
1.64, 1.65 and Ubuntu 17.04 with versions 1.56(bundled) and 1.64. Added
unit tests for the serialisation ChatListWindow::Chat class.
Change-Id: Idc5c3a6cfd92272b8eab2d77e243dda743803a31
Diffstat (limited to 'BuildTools/SCons')
-rw-r--r-- | BuildTools/SCons/SConscript.boot | 1 | ||||
-rw-r--r-- | BuildTools/SCons/SConstruct | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/BuildTools/SCons/SConscript.boot b/BuildTools/SCons/SConscript.boot index f815bbc..6ac4981 100644 --- a/BuildTools/SCons/SConscript.boot +++ b/BuildTools/SCons/SConscript.boot @@ -53,6 +53,7 @@ vars.Add(PathVariable("boost_includedir", "Boost headers location", None, PathVa vars.Add(PathVariable("boost_libdir", "Boost library location", None, PathVariable.PathAccept)) vars.Add(BoolVariable("boost_bundled_enable", "Allow use of bundled Boost as last resort", "true")) vars.Add(BoolVariable("boost_force_bundled", "Force use of bundled Boost.", False)) +vars.Add(BoolVariable("allow_boost_1_64", "Allow use of Boost 1.64", False)) vars.Add(PathVariable("zlib_includedir", "Zlib headers location", None, PathVariable.PathAccept)) vars.Add(PathVariable("zlib_libdir", "Zlib library location", None, PathVariable.PathAccept)) vars.Add(PathVariable("zlib_libfile", "Zlib library file (full path to file)", None, PathVariable.PathAccept)) diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct index 2c2d629..6d63d5b 100644 --- a/BuildTools/SCons/SConstruct +++ b/BuildTools/SCons/SConstruct @@ -242,6 +242,12 @@ elif not env.get("boost_bundled_enable", True) : Exit(1) else : env["BOOST_BUNDLED"] = True +boost_version = GetVersion(conf, "BOOST_VERSION", "boost/version.hpp") +if boost_version == 106400 : + #Version 1.64 has some issues with the serialization of boost::optional, see https://svn.boost.org/trac10/ticket/13050 + env["BOOST_1_64_DETECTED"] = True +else: + env["BOOST_1_64_DETECTED"] = False conf.Finish() @@ -780,4 +786,3 @@ print if not GetOption("help") and not env.get("HAVE_OPENSSL", 0) and not env.get("HAVE_SCHANNEL", 0) and not env.get("HAVE_SECURETRANSPORT", 0): print "Error: A working TLS backend is required. Please check the documentation for more information." Exit(1) - |