-
Notifications
You must be signed in to change notification settings - Fork 56
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
move to shared library format #177
base: main
Are you sure you want to change the base?
Conversation
78d15b1
to
5bfe56f
Compare
I'm not sure what the intention is, but this should be configurable and not hardcoded. If your whole stack is static libraries, why would you want minio-cpp shared? Additionally, this doesn't even consider dependencies. Is shared library compiling all dependencies statically or also as shared libraries? Because vcpkg prefers static, so you can be linking a lot of stuff twice, which means unreliable exception handling. I'm in favor of maintaining the existing behavior (static) and adding an option to build a shared library, but not hardcoding that decision. |
is that because of MSVC requirement? can you show me where vcpkg indicates that they prefer static? |
vcpkg uses triplets, which contain the information about the shared/static choice. Unfortunately with vcpkg it's either ALL static or ALL shared (conan supports this option per library). Some libraries can only be built as static though, so the triplet specifies the default when there is a choice. The configuration option in vcpkg is called But I would either create a custom option (like Here are my reasons against this change:
BTW there is a reason why this commit hardcodes static library for Windows, because the source code it's missing the API decorators and Windows won't export anything if the API is not decorated. Windows linkage is similar to |
This is a fine choice, the main reason I am avoiding static is for GPU Direct dependency since there the libraries are shipped as shared and static compilation didn't work properly. Let me see how to make this a cleaner choice. |
5bfe56f
to
ea3f7f0
Compare
ea3f7f0
to
293eb4e
Compare
I'm linking the following article that should explain what I'm talking about: In other words, you cannot provide a good support for a shared library without using the API/EXPORT macro. It's simply not possible, and if you decide to build a shared library, you should build ALL dependencies that are exposed in minio-cpp API as shared too. In addition, there should always be a choice, otherwise you are just telling your users to go away as shared library is something that most people just don't want today. |
Default is back to what it was, you need to now pass a flag to build shared libs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved - although I think this is not usable without the API decorator and without removing other static libs from the public interface (I would not want to debug problems caused by this mix).
@kobalicek If we use separate build scripts/system for shared library in GNU/Linux, would it solve the issue? |
No description provided.