Skip to content
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

Can't build project (either API_ONLY or default options) using CMake from release tarball #869

Closed
lidavidm opened this issue Jun 21, 2021 · 2 comments · Fixed by #870
Closed
Assignees
Labels
bug Something isn't working

Comments

@lidavidm
Copy link
Contributor

Describe your environment

Ubuntu 18.04 x86_64, OpenTelemetry v1.0.0-rc2

$ uname -a
Linux partita 5.4.0-74-generic #83~18.04.1-Ubuntu SMP Tue May 11 16:01:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ cmake --version
cmake version 3.19.6
$ g++ --version
g++ (crosstool-NG 1.24.0.133_b0863d8_dirty) 9.3.0

Steps to reproduce

$ wget https://github.com/open-telemetry/opentelemetry-cpp/archive/refs/tags/v1.0.0-rc2.tar.gz
$ tar xf v1.0.0-rc2.tar.gz
$ cd opentelemetry-cpp-1.0.0-rc2/
$ mkdir build && cd build
$ cmake .. -DWITH_API_ONLY=ON # or omit

What is the expected behavior?

We should be able to configure OpenTelemetry.

What is the actual behavior?

CMake fails because nlohmann-json isn't included in the release tarball:

-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/lidavidm/miniconda3/envs/arrow4/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/lidavidm/miniconda3/envs/arrow4/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building for architecture ARCH=x64
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
Using local nlohmann::json from submodule
CMake Error at CMakeLists.txt:241 (add_subdirectory):
  The source directory

    /home/lidavidm/Code/upstream/arrow-otel2/build/temp/opentelemetry-cpp-1.0.0-rc2/third_party/nlohmann-json

  does not contain a CMakeLists.txt file.


-- Found GTest: /home/lidavidm/miniconda3/envs/arrow4/lib/libgtest.so  
GTEST_INCLUDE_DIRS   = /home/lidavidm/miniconda3/envs/arrow4/include
GTEST_BOTH_LIBRARIES = /home/lidavidm/miniconda3/envs/arrow4/lib/libgtest.so;/home/lidavidm/miniconda3/envs/arrow4/lib/libgtest_main.so
Building with nostd types...
-- Configuring incomplete, errors occurred!
See also "/home/lidavidm/Code/upstream/arrow-otel2/build/temp/opentelemetry-cpp-1.0.0-rc2/build/CMakeFiles/CMakeOutput.log".
See also "/home/lidavidm/Code/upstream/arrow-otel2/build/temp/opentelemetry-cpp-1.0.0-rc2/build/CMakeFiles/CMakeError.log".

Additional context

Ideally, we would just not build components that require nlohmann::json when it's not available, but otherwise, we should at least include it in the release tarball. And at the very least, WITH_API_ONLY should not require this dependency.

We specifically use the release tarball so we can also easily mirror it or provide it offline for a CMake ExternalProject build, instead of using a Git clone which would require Internet connectivity.

@lidavidm lidavidm added the bug Something isn't working label Jun 21, 2021
@lalitb
Copy link
Member

lalitb commented Jun 21, 2021

Thanks for reporting @lidavidm. This was discussed earlier here #865 (comment) and should be fixed. cc @maxgolov

@lidavidm
Copy link
Contributor Author

Ah, sorry for the duplicate, and thanks for pointing me there.

I do see a suggestion to always clone recursively - in that case it might be worth manually uploading release tarballs with submodules included? Since the default GitHub ones do not include them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants