Arvid Norberg
2017-04-02 12:40:44 UTC
I posted a pull request that changes the (ABI) symbol names in libtorrent.
The purpose is to make it simpler to maintain backwards ABI compatibility
going forward.
The convention I've implemented in libtorrent is to make ABI breaking
changes every point release (x.y) but maintain ABI compatibility to
revisions within such release (x.y.z).
This means 1.2 will be ABI incompatible with current 1.1.x releases.
The change I'm considering does the following:
* renames the libtorrent namespace to "lt".
* adds another interior, inline, namespace with ABI version
* removes the previous (inferior) link-time ABI check (see
http://blog.libtorrent.org/2016/09/link-compatibility/ )
* introduces a namespace alias "libtorrent" to preserve backwards
compatibility
The PR is here: https://github.com/arvidn/libtorrent/pull/1879
The main benefit of this patch is that the ABI version is explicitly
encoded in the symbol names which improves error messages but also makes it
easier to preserve backwards compatibility going forward, by preserving
those symbols.
This change should not affect the API, and should only be noticeable by
clients in the following cases:
* forward declaring a libtorrent name would no longer work, as the
namespace would need to include the ABI version. In fact, opening the
namespace "libtorrent" for any reason would also not work, as that's an
alias now
* defining a namespace alias called "lt" would conflict with the new
namespace name of libtorrent.
Please let me know if anyone has any concerns or can think of problems that
would arise form merging this PR.
For more information on inline namespaces:
http://stackoverflow.com/questions/11016220/what-are-inline-namespaces-for
The purpose is to make it simpler to maintain backwards ABI compatibility
going forward.
The convention I've implemented in libtorrent is to make ABI breaking
changes every point release (x.y) but maintain ABI compatibility to
revisions within such release (x.y.z).
This means 1.2 will be ABI incompatible with current 1.1.x releases.
The change I'm considering does the following:
* renames the libtorrent namespace to "lt".
* adds another interior, inline, namespace with ABI version
* removes the previous (inferior) link-time ABI check (see
http://blog.libtorrent.org/2016/09/link-compatibility/ )
* introduces a namespace alias "libtorrent" to preserve backwards
compatibility
The PR is here: https://github.com/arvidn/libtorrent/pull/1879
The main benefit of this patch is that the ABI version is explicitly
encoded in the symbol names which improves error messages but also makes it
easier to preserve backwards compatibility going forward, by preserving
those symbols.
This change should not affect the API, and should only be noticeable by
clients in the following cases:
* forward declaring a libtorrent name would no longer work, as the
namespace would need to include the ABI version. In fact, opening the
namespace "libtorrent" for any reason would also not work, as that's an
alias now
* defining a namespace alias called "lt" would conflict with the new
namespace name of libtorrent.
Please let me know if anyone has any concerns or can think of problems that
would arise form merging this PR.
For more information on inline namespaces:
http://stackoverflow.com/questions/11016220/what-are-inline-namespaces-for
--
Arvid Norberg
Arvid Norberg