Skip to content

Convert to stable ns name - #595

Open
kdt3rd wants to merge 2 commits into
AcademySoftwareFoundation:mainfrom
kdt3rd:convert_to_stable_ns_name
Open

Convert to stable ns name#595
kdt3rd wants to merge 2 commits into
AcademySoftwareFoundation:mainfrom
kdt3rd:convert_to_stable_ns_name

Conversation

@kdt3rd

@kdt3rd kdt3rd commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

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

…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>
@lgritz

lgritz commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

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?

@kdt3rd

kdt3rd commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

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 lgritz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants