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

Improving rd-cpp #259

Open
DecoyRS opened this issue Oct 21, 2021 · 2 comments
Open

Improving rd-cpp #259

DecoyRS opened this issue Oct 21, 2021 · 2 comments
Assignees

Comments

@DecoyRS
Copy link
Contributor

DecoyRS commented Oct 21, 2021

This issue is a topic starter for a problem of distribution and integration of rd-cpp.
We have had multiple attempts to pack rd-cpp into dll's for easier distribution (and packing into nuget, easy my ass) to be able to use it inside RiderLink project (plugin for Unreal Engine).

We had next number of issues:

  1. Breaking ABI in STL between minor versions of toolchain (I'm looking at you, MSVC). Every breakage means adding new version of rd-cpp distribution;
  2. Need to pack both Release and Debug dll's (so all versions need to multiply by 2);
  3. Different toolchains not compatible between each other (again, need to multiply by N number of supported toolchains, so MSVC, Clang, GCC?)
    NUMBER_OF_BUILDS = NumberOfBrokenABIsNumOfToolchains2.
    If I recall correctly, dll's for 1 version of toolchain could eat up to 200 MBs which is insane.
    Personal opinion, it's a dead end.

If we're accpeting the state that we're not able to distribute rd-cpp in dll's, we need to be able to share it as a source package.
What are the requirements in this case:

  1. Option to add rd-cpp as a submodule w/o dependencies rd-kt, rd-net, rd-xxx
  2. Minimal CMakeLists.txt to add rd-cpp w/o tests
  3. Make it compatible with -no-exceptions and -no-rtti projects
  4. Add option to use custom allocators
    Optionals:
  5. Conan/vcxpkg integration
@hypersw
Copy link

hypersw commented Nov 16, 2021

Leaking STL over a DLL boundary is usually a no-go for a Windows binary DLL distribution IMHO.
A LIB binary distribution is an option, tho you'd have to prepare for all supported toolchain variations of course. But since it's opensource, maybe not a good option anyway, gives about as much trouble as it saves.

Typically, a nice Windows DLL with a small API surface would have COM API or its like along the same lines, something strictly defined and not leaking half the world over the interface, which keeps STL details within the host and the DLL separated (and preferrably statically compiled). Most of the time it's okay (all of the Visual Studio APIs are happy that way, so you can imagine). But I guess the RD specific interaction with tight integration of the models and operations on them with focus on minimal overhead makes this impossible. Or does it not?

@DecoyRS
Copy link
Contributor Author

DecoyRS commented Nov 17, 2021

RD CPP is meant to be cross-platform, so COM is a no go.
I would say the C API would be the ideal solution. Extra bonus, it can be integrated with other languages as well by writing a small wrapper.

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

No branches or pull requests

5 participants