-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
New recipe: reflectcpp; intended to replace recipe reflect-cpp, which is named incorrectly #24857
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Can someone give me some advice? This package only support C++20, but the pipeline keeps on trying to build it for earlier versions. What do I do here? This can't be the first package facing this problem. |
@liuzicheng1987 You need to implement |
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.
@liuzicheng1987 Please, keep the original test package from https://github.com/conan-io/conan-center-index/tree/master/recipes/reflect-cpp/all/test_package
The test package is used to validate those packaged artifacts, like headers and libraries, not including the headers, but also linking libraries. Plus, we do not expose rules of settings in test_package.
@toge, absolutely no problem. Like I said, I certainly contributed to the confusion, because I often refer to it as "reflect-cpp" myself. I am grateful there are so many people who are willing to contribute to the library. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
@liuzicheng1987 Thank you again for your effort on this PR. I opened a PR to suggest all changes requested by me, instead of doing directly in the PR. It would faster than asking with suggestions here. Please, take a look: liuzicheng1987#1 |
@uilianries , sounds great. Thank you so much for your help. I will take a closer look later today. |
@uilianries , I think that I now have resolved all of the issues and this is ready to be merged. If you agree, I will maintain the Conan package from now on and also add more comprehensive testing on my side to make sure that the Conan options we provide all work as expected. The issue with the shared build was a bit more complicated than we both anticipated, but the good news is that I got it resolved. Fixing it required some changes on our side. That is why the shared library version of reflectcpp-0.14.0 and reflectcpp-0.15.0 won't build. But I have included the necessary changes in the newest release, reflectcpp-0.16.0. The other change necessary was to add this line to the CMakeLists.txt:
Passing this linker flag is necessary whenever, the following three statements hold true:
Because YYJSON is written in C (as well as some of the other libraries we use), these three statements hold true when |
@liuzicheng1987 Thank you for taking time and effort to fix this recipe!
All recipes in CCI, they don't a maintainers, anyone is able to request a new version or send a PR.
Is this change incorporated into the upstream already? Is there an issue that we link in the recipe itself? When consuming the package, users should not need to configure such flags. In fact, it's first that I see this flag being used in CCI. What error did it cause? |
@uilianries, yes, the changes are incorporated upstream. The error message is the following: DSO missing from command line I would refer you to this website which at greater detail how this error occurs. The DSO missing from command line message will be shown when the linker can’t find the required symbol with its normal search, but the symbol is available in one of the dependencies of a directly specified dynamic library. In the past, the linker thought that symbols in languages that depended on other languages were available. But in a later version, that changed, and now the linker has a stricter view of what is available. So, the message is meant to help with this change. https://linuxpip.org/how-to-fix-dso-missing-from-command-line/?utm_content=cmp-true Again, it's only a problem for dynamic linking, not for static linking. |
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.
@liuzicheng1987 You current error is because yyjson's method yyjson_mut_doc_new
is exposed directly in write.hpp, and Conan 2.x does not export dependencies libraries:
https://github.com/getml/reflect-cpp/blob/main/include/rfl/json/write.hpp#L44
In order to fix that, you have to explicit tell to Conan to make yyjson available to the upstream.
Co-authored-by: Uilian Ries <[email protected]>
Co-authored-by: Uilian Ries <[email protected]>
@uilianries, I have merged your suggestions and added a missing import. It now works without the ugly additional flag. Thank you so much for your suggestions. |
Hello @liuzicheng1987! I’m glad to hear that your PR is working now! I’ve tested it on both Linux and Mac with all options enabled (including dependencies), and it looks promising. However, there is a small fix that still needs to be addressed. I recently spoke with the Conan team regarding your current PR and the previous Additionally, we would like to know if you plan to rename your GitHub repository to Regarding your current PR, please rest assured that your efforts are not in vain. We can incorporate all your changes into the existing reflect-cpp recipe, which will address some bugs we identified during our review and update the project version available in Conan Center. I apologize for the delay in bringing this up, but since your PR is looking really good now, I wanted to clarify the best way to resolve the current package name conflict before merging. Thank you for your hard work! |
Build logs using all options as True (dependencies), include the CMakeDeps fix for flatbuffers. It looks good in Linux and Mac, built locally: |
Co-authored-by: Uilian Ries <[email protected]>
Hi @uilianries , no I do not plan to rename anything. If we can make it the "reflect-cpp" recipe work, I would greatly prefer that over calling it "reflectcpp". I always thought this was a limitation of Conan. |
@uilianries, if there is anything I can do to help, please let me know. |
@liuzicheng1987 Thank you for understanding! I'll do a Now we are really close to merge it! |
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
It requires MSVC version 193, Update 8. However, CCI does not use Update in settings. I'll check with the team. |
Signed-off-by: Uilian Ries <[email protected]>
@liuzicheng1987 I did few changes in your PR:
Thank you again for your big effort over this recipe. I built locally again, using dependencies and it looks good to me now. |
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.
LGTM
@uilianries, thank you so much for your comments as well! |
Summary
Adds a new recipe: reflectcpp/0.14.0. The recipe "reflect-cpp" should be deprecated or removed, because its name is wrong.
Motivation
As I explained to @AbrilRBS and @uilianries in #24819, the problem is the following:
I am the main author of reflectcpp, but I didn't upload any of the previous Conan packages for reflectcpp. Other people did that without informing me. I found out about its existence, because users were complaining to me about the Conan package.
In principle, I am happy about people uploading my library to Conan, however they made a mistake: The have called they package "reflect-cpp", but in our CMakeLists.txt, we have always referred to the package as "reflectcpp":
https://github.com/getml/reflect-cpp/blob/main/CMakeLists.txt
But a requirement of the Conan package is that the name of the installed package be the same as the name of the package in the CMakeLists.txt (which makes a lot of sense).
To be honest, I may have contributed to the confusion, because I often refer to the package as "reflect-cpp". However, it is the name in the CMakeLists.txt that matters for our purposes and that name is "reflectcpp".
This didn't matter as long as the library was treated as header-only. But this was a workaround from the get-go and in any case it won't work for any of the newer versions.
The name of the package on Conan is wrong, plain and simple. If you stick with the old name you won't be able to host any of the newer versions of reflectcpp and will be stuck with an outdated version for all eternity. It needs to be fixed.
Details
I have added a build pipeline. I do not use the bundled dependencies, but install them via Conan instead. JSON support is activated by default. Since you only want very simple tests, not comprehensive functional testing (https://docs.conan.io/2/tutorial/creating_packages/test_conan_packages.html), I have done just that.