Boost Serialization Library upgrade

帅比萌擦擦* 提交于 2019-11-30 19:15:23

Boost.serialization is backward-compatible but is not guaranteed to be forwards compatible.

This means:

  • you can create an archive with an older version of boost.serialization that can be read with a newer version.
  • There is no guarantee that an archive created with a newer version of boost.serialization will be readable by a older one.

If you send messages between a client and a server in both directions, for instance, you may have to upgrade the version of boost on both in lockstep.

The 'wire format' does not change with every version of boost. So between 2 specific versions of boost, you may have no problem - I can't find specific documentation of which version of the archive format is used within which version of boost.

Note also that while backwards compatibility is 'guaranteed', that's just expressing an intent - although I guess you could get your money back ;-). Boost versions 1.42 and 1.43 had a bug that meant later versions cannot read them back - see the 1.45 release notes.

The initial Release was in Boost 1.32. It appears you can view the release history since then here: http://www.boost.org/doc/libs/1_43_0/libs/serialization/doc/release.html

Other than that I'd suggest asking on the boost mailing list: http://www.boost.org/community/groups.html#users

You can create test files using your current version of the software and store them. Then include loading of this files into your automatic tests.

Unfortunately, even if your code will pass this test, you can not be 100% sure at compatibility, because there still can be some sort of serialized content that can not be loaded. Well, it is still better than nothing.

This test will automatically cover only backward compatibility. Testing forward (upward) compatibility will be more complicated. One will need to create test data for every new release and try to load it by every old version...

Extended forward compatibility for boost::serialization is answered here

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!