-
Notifications
You must be signed in to change notification settings - Fork 423
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
nlohmann_json fails to install to /usr/local during build #1448
Comments
After investigations, it turns out there are 3 different ways to build with nlohmann_json in the top level CMakeList.txt. (1) CMake finds a nlohmann_json package. Message printed: Variables visible in cmake: make:
make install:
(2) With:
When (1) fails, the makefile looks for git submodules Message printed:
Variables visible in cmake: make:
make install:
(3) When both (1) and (2) fails, the makefile downloads nlohmann_json. Message printed: Variables visible in cmake: make performs these actions:
so here a make (on opentelemetry-cpp) causes a make install on nlohmann_json, make install:
In case of (3), the step This is the CMake build only with 3 flavors, and there is also the Bazel build. |
That's correct, it's a valid bug. Unfortunately, we don't have any CI test to catch this error. For Linux - the nlohmann-json dependency is already installed through |
Before changing makefiles for (3), I would like to understand if (3) is even needed at all. Downloading code manually from github sounds redundant with git submodules, which are already in place, so maybe (3) can be removed entirely ? @lalitb ? |
Also, picking an existing external nlohmann-json dependency might bring a different version, causing subtle bugs, especially considering the external package (1) takes precedence over git submodules (2) |
We have source releases, so it is possible for someone to download the release archive, and build it. The 3rd scenario will be used there. |
This issue was marked as stale due to lack of activity. |
Remaining header files using nlohmann_json:
elasticsearch and etw are to move to opentelemetry-cpp-contrib. zipkin header files are the zipkin exporter implementation, not to be exposed to a client As a result, there is a possibility to eliminate the need to install nlohmann_json entirely, which will simplify makefiles and dependencies. This fix is waiting for #1423 (ETW) |
Describe your environment
ProductName: macOS
ProductVersion: 12.4
BuildVersion: 21F79
Steps to reproduce
What is the expected behavior?
I expected the build to download and build dependencies within the build tree. I did not expect it to attempt to install build dependencies to a global system location.
What is the actual behavior?
The text was updated successfully, but these errors were encountered: