Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ENABLE_PRIVATE_APIS guard for internal API #427

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wismill
Copy link
Member

@wismill wismill commented Jan 10, 2024

Follow-up of #414. See @whot comments

@wismill wismill requested a review from whot January 10, 2024 13:23
@wismill wismill mentioned this pull request Jan 10, 2024
@wismill wismill added this to the 1.7.0 milestone Jan 10, 2024
Copy link
Contributor

@whot whot left a comment

Choose a reason for hiding this comment

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

I had a look at -DENABLE_PRIVATE_APIS again (which apparently I introduced) and the original reason for it was that we have the same tool but with different functionality - the installed one links against libxkbcommon but the one in the builddir statically compiles against it. So that #define doesn't actually enable any private APIs, it allows the tools to use such an API (the difference might be hair-splitting).

More importantly though: this doesn't affect libxkbcommon.so because that one uses symbol visibility anyway and we shouldn't ever leak any symbols.

So my opinion here is still that we don't really need this, the only user of those symbols is the test which also statically links libxkbcommon.

I'm not sure if saving the 500 bytes is really worth it. I know floppies are no longer produced but still ;)

@wismill
Copy link
Member Author

wismill commented Jan 12, 2024

@whot I agree the semantics may not be great. Maybe ENABLE_TEST_API is better?

I'm not sure if saving the 500 bytes is really worth it. I know floppies are no longer produced but still ;)

Sorry but I cannot resist: with this kind of reasoning we would end with fat libraries all around. Libraries that are downloaded millions (billions?) of times. I do agree in our case the gain is small, but I do not understand why so much resistance. I mean, the patch is trivial and mean no real maintenance.

@whot
Copy link
Contributor

whot commented Jan 12, 2024

Developer mental load, primarily :) One more thing to keep track of even though it has effectively zero effect since the symbol is private anyway. Which means guessing why the ifdef is there when it has no effect, looking up the git history (if available, too many times now I find myself in code where that is not the case...), etc.

@wismill wismill modified the milestones: 1.7.0, 1.8.0 Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants