Convert to stable ns name - #595
Conversation
…ace names Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
…ntrollable) The usage of types should always flow through the top level namespace (Imath) as a #define, but the headers and source should put types into the appropriate stable name, which is set based on the INTERNAL namespace configurable root. Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
|
So basically, this freezes the current namespace as Imath_3_2 (by default, can be changed at build time), Imath is the user-facing namespace alias to that, and now the ABI is frozen at 3_2 even for future versions of the Imath library? But if we really needed to in the future, Imath v6.0 might need to bump the ABI, and thus the namespace, but that would be non-interfering? |
That was the thought - I thought about fixing and removing the version number, but that would make it annoying in the future if we want to add changes - instead, we would do like what you've done in oiio (I didn't direct copy because introducing a nested namespace, while cleaner, would change existing behavior). So we would add a new stable name and include it in the outer name (Imath) and off we go. The next step, which this change does not make, is to remove the per-version SO name, and switch to just a stable SO name to increase the backwards compatibility |
lgritz
left a comment
There was a problem hiding this comment.
LGTM, this is a great compromise between wanting a single simple namespace, while preserving back compatibility with the current version, and leaving the door open to future ABI revisions if the need arises.
This converts the namespaces to ones that should remain stable going forward. The names are still controllable by people who want to configure a custom name to absolutely avoid symbol collisions, but by default, the internal name becomes the root for the stable version name (i.e. Imath_3_2).
Given that is our latest release number, seems like a good point to pin the symbols at.
Next to do would be to remove the per library version from the SONAME such that a new version could transparently replace the old version (assuming abi stability at a c++ level). This would likely need to include an additional option to NOT do that to be added, and is not yet contemplated as this change