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

[RFC] libstore: remove static initialisation #3511

Closed
wants to merge 1 commit into from

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented Apr 17, 2020

This is is an alternative approach to #2698
If you prefer this approach than I would go ahead and remove the other static intializers as well

This fixes problems when static linking
where static functions are discarded
if no other symbol is pulled from the object
file.
@matthewbauer
Copy link
Member

@edolstra can answer for sure, but I think this is how plugins are registered in Nix.

@edolstra
Copy link
Member

Right, this breaks plugins.

@Mic92
Copy link
Member Author

Mic92 commented Apr 18, 2020

@edolstra Could you please elobrate how this break plugins? If you take a look at my version, I kept the old API in place and only made in-tree stores non-static.

@domenkozar domenkozar requested a review from edolstra May 7, 2020 08:27
@edolstra
Copy link
Member

edolstra commented May 7, 2020

It's also much uglier. The current approach is much cleaner since it doesn't require all store implementations to be enumerated in a global header file.

@Mic92
Copy link
Member Author

Mic92 commented May 7, 2020

The implementation can be moved to its own compilation unit if necessary.

@Mic92
Copy link
Member Author

Mic92 commented May 7, 2020

#2698 is less intrusive.

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.

None yet

3 participants