-
Notifications
You must be signed in to change notification settings - Fork 390
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
WIP: Use find_package for nlohmann_json #2880
Conversation
No need to apologize, that is why we have robots to do this work. If you do get errors please test your fixes locally first though. |
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.
In general the changes look great. I have a question, but I have not thought about this much: I really do not know what the answer is.
Reviewed 34 of 34 files at r1.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @remyabel)
google/cloud/storage/CMakeLists.txt, line 47 at r1 (raw file):
endif () find_package(nlohmann_json CONFIG REQUIRED)
I think that means if anybody installs nlohmann_json without installing the CMake dependencies the find_package()
would fail. Can we just say find_package(nlohmann_json REQUIRED)
?
google/cloud/storage/CMakeLists.txt, line 338 at r1 (raw file):
internal/logging_resumable_upload_session_test.cc internal/metadata_parser_test.cc internal/nljson_use_after_third_party_test.cc
Can we preserve these tests?
google/cloud/storage/internal/nljson.h, line 43 at r1 (raw file):
#define nlohmann google_cloud_storage_internal_nlohmann_3_4_0 #include "google/cloud/storage/internal/nlohmann_json.hpp"
I am not sure, but maybe we want to preserve this? Obviously we need to change this line to #include <nlohmann/json.hpp>
but maybe we can preserve the stuff around it?
Hmm, this will be less straight forward than I thought. I'm running into strange compilation errors:
I think this might be a compatibility issue with 3.6.1. |
I am closing this for now. There are a surprising amount of obstacles here:
|
This begins the work of #2802 (comment)
Fixes #2874
This PR, whenever possible, attempts to install nlohmann_json via the package manager. If it is unavailable, then we install it from source. Note that since different distros package different versions, then it might be a good idea to install a newer version from source. However, the disadvantage of this is that many package maintainers would prefer the packaged version, even if it is old, because it will contain patches and packaging standards relevant to that distro. On the other side of the argument, supporting a version as old as 2.1.1 would be absurd.
I have only tested one Dockerfile manually on my system; testing all of it would be time consuming. I'm relying on the first round of Kokoro builds to spot any errors. I apologize in advance.
This change is