-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Building SHARED and STATIC library #147
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
Comments
Yes. But isn't it possible to build both as two separate
Hopefully 1.4.x, at least. |
Yes, but it is not the common practice, and makes the packaging more complicated without benefits. I will start with 0.7.1 for sid, and maybe build 1.4 for experimental. It depends on your ABI/API compatibility. Do you check them somewhere? |
The whole point of 1.x is to drop the old ABI compatibility. If you need that, then you still need 0.7.x. |
I'll try to include some of the recent, minor fixes into 0.8.0, still ABI compatible. |
That would be great. 👍 |
Could you wait with releasing 0.8.0 until I completed the pullrequest for building shared and static lib together? |
No problem. Actually, 0.8.0 will be rebased near the tip of master anyway. I'll integrate your changes there too. Will you be able to double-check ABI compatibility? If not, I'll just build our test with old and link with new. |
You might tell Andrey that the project has moved: http://upstream.rosalinux.ru/versions/jsoncpp.html |
But aside of that, of course I can check ABI compatibility. In fact I have to if this package should really be going on the debian archives. |
That only lists his linkedin account. Can you connect us? I'm @cdunn2001. |
Just click on the add link on the top of the list. I don't care about linkedIn, sorry. |
API compliance does not look too good. https://gist.github.com/cinemast/35a7362d9bcbd4c92f7f
Do you think you can fix that? |
Ref of the ongoing discussion on debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=762330 |
Altered globals:
That was for Chromium. I guess we can revert that in 0.x, if Debian doesn't need to work on ARM. Any idea? New data-members in
That we can definitely revert for 0.x. It will take a day or two though.
We can rename the new version and have 2 FastWriters. No problem.
Ugh. It's rare that anybody would need this class, but we'll have to revert this change too. That's all I found. Those match precisely with what the ABI tool discovered, which is reassuring. Your tool overlooks changes to virtual-look-up tables, but jsoncpp is safe in that regard. This will take a few days to revert on 0.7.0, ok? What do you suggest for the ARM problem? |
To be honest, I do not understand the issue with the ARM fix. Maybe someone from Debian does and is following this thread. On the other hand, it is great that all the other incompatibilities are not a big deal. It would be great to reserve the SOVERSION bump for the > 1.x version, because usually there should not be more than 2 versions of the same library in Debian. So we could put 1.x into experimental, and 0.8 into sid/unstable without major problems. I will try to find someone at Debian who can help us out with the ARM problem. Thank you for trying to resolve all this. |
for binary-compatibility with 0.6.0 issue open-source-parsers#147 was open-source-parsers#57
for binary-compatibility with 0.6.0 issue open-source-parsers#147 was open-source-parsers#57
Would you be satisfied with a script which runs the build twice, once to produce a shared lib and once for a static lib? We are trying to simplify the cmakefiles, and apparently it's difficult to do both at once. |
I don't think the script will be enough. I have to check how other Maintainers handle this situation. I do get that the current solution is not pretty and blows up the CMakeList files. |
The current way is also the suggested way of Kitware: http://www.cmake.org/Uncyclo/CMake_FAQ#Can_I_build_both_shared_and_static_libraries_with_one_ADD_LIBRARY_command.3F It is also argued there why they do not provide a simple option to automatically build both versions. I do not think we have an alternative here. Most distribution's package build system (not only debian) consist of a configure and a build step for each package. This is why it is required to tell cmake to build both: shared and static version of the library. |
What if we have one configure script and one build script:
Could you call those 2 instead of cmake + make? |
What problem are you guys solving here? How is doing cmake twice then make twice, different from just doing (cmake+make) twice? The latter makes more sense, since it's how the "build pipeline" is defined:
Run the above steps any number of times desired for different binary output. And don't forget, there are several important reasons why you should do it this way:
Maybe I'm missing a fundamental requirement that you feel is missing from my solution? In that case, if you don't mind going over the details, I'd be happy to help. I'm still new to this project and I started off making this change for my own needs (more specifically, the 2nd point in the list above). But obviously any solution I propose needs to work for everyone not just my case. Thanks guys. |
I already answered in #325, but I would also like to comment your points here: ad 1: ad 2: An example of External Projects in CMake can be found here: Also here is the official docu to it: Anyway, we have come to an agreement in #325. So thank you for participating. |
If you're referring to There is nothing wrong with doing it this way. It may not be recommended, but that doesn't mean that "CMake is not well suited for the approach". As of CMake 3.0 there is a special packaging script you can generate: This will give you the best of both worlds. You should explore using this if you expect users to import your target via When I brought up point 1, I was thinking of cache variables that affect preprocessor definitions in the actual code. I.e. you couldn't set the same variable differently for both passes (static and shared). It would be the same for both, always. Maybe this isn't a need ATM for jsoncpp. There is also a lot of duplication of CMake code to manage common settings between both targets. Granted, defining more functions might take care of this, but the idea of generating 2 targets in 1 CMake configuration pass is still taboo for CMake. If someone were to explain why Debian requires this specific setup maybe it would help me understand more. Right now it just feels unnecessary. Can you go into detail? Why does 2 builds versus 1 build to get the same result cause a problem? |
About Debian: It comes with a lot of handy tools that basically do the packaging automatically which is very convenient for the maintainer of the package. Especially setting hardening flags for security, optimizations flags, debugging flags, etc. The tools however use heuristics to automatically detect how to build the software. They can not handle two different stages of configuring, building and installing automatically, and doing it by hand is very error prone. In Debian we usually ship both, the shared and the static version of a library, so that the end-user gets maximum flexiblity in using the library. So Debian does not require a specific setup. It is just that the tools work best with following the "standard procedure" (patch, configure, build, test, intsall, package) and the maintainer can make less errors by using the standard procedure. As a comparison, here are the two approaches to compare: I am still not sure if I got all the flags in there now. But generally it works. I am still in the mentoring process of Debian and not that much of an expert, so I was in doubt if I could keep maintaining the package in the same quality, if the target behaviour changes. But the proof of concept works for me in Debian. It was very nice of @cdunn2001 and you to keep the discussion going until we figured out a solution. So thanks for that. |
Glad you guys worked it out. I'll put this one to bed. |
See #334. |
I am out of the office until 25.08.2015. Dear Business Partner, I will be out of the office starting 17.08.2015 and Note: This is an automated response to your message "Re: [jsoncpp] This is the only notification you will receive while this person is away. |
As I can see, it is currently not possible to build both versions, correct?
Would a PR that offers this functionality be merged? I want to package a more recent version for debian, which requires .a and .so version of it.
The text was updated successfully, but these errors were encountered: