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

[Regression] spdlog fails to compile in v0.23.322 #518

Closed
Thalhammer opened this issue Feb 10, 2022 · 1 comment · Fixed by #520
Closed

[Regression] spdlog fails to compile in v0.23.322 #518

Thalhammer opened this issue Feb 10, 2022 · 1 comment · Fixed by #520
Labels
bug Something isn't working

Comments

@Thalhammer
Copy link

Thalhammer commented Feb 10, 2022

  • I've read Brief overview section and do understand basic concepts. [Yes]

  • I've read F.A.Q. section and there is no solution to my problem there. [Yes]

  • I've read Code of Conduct, I promise to be polite and will do my best at being constructive. [Yes]

  • I've read Reporting bugs section carefully. [Yes]

  • I've checked that all the hunter_add_package/find_package API used by me in the example is the same as in documentation. [Yes]

  • I'm using latest Hunter URL/SHA1. [Yes]

  • I've created SSCCE reproducing the issue:

CMakeLists.txt
set(HUNTER_STATUS_DEBUG ON CACHE STRING "HUNTER_STATUS_DEBUG")
cmake_minimum_required(VERSION 3.13)
file(DOWNLOAD "https://raw.githubusercontent.com/cpp-pm/gate/master/cmake/HunterGate.cmake" ${CMAKE_CURRENT_LIST_DIR}/HunterGate.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/HunterGate.cmake)
# This works
#HunterGate(
#    URL "https://github.com/cpp-pm/hunter/archive/v0.23.321.tar.gz"
#    SHA1 "5e53cbb0429037ea8e2592bfd92704b8ff3ab492"
#)
# This doesn't work
HunterGate(
    URL "https://github.com/cpp-pm/hunter/archive/v0.23.322.tar.gz"
    SHA1 "cb0ea1f74f4a2c49a807de34885743495fccccbe"
)
project(Sample)
cmake_policy(SET CMP0077 NEW) # Ignore normale variables in option

hunter_add_package(spdlog)
hunter_add_package(fmt)
find_package(spdlog CONFIG REQUIRED)
find_package(fmt CONFIG REQUIRED)

Here is the log until first error reported by Hunter, option HUNTER_STATUS_DEBUG is ON:

CMake Log
[main] Configuring folder: hunter-bugexample 
[proc] Executing command: /usr/bin/cmake --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -H/home/dominik/Dokumente/hunter-bugexample -B/home/dominik/Dokumente/hunter-bugexample/build -G Ninja
[cmake] Not searching for unused variables given on the command line.
[cmake] -- [hunter] Calculating Toolchain-SHA1
[cmake] -- [hunter] Calculating Config-SHA1
[cmake] -- [hunter] HUNTER_ROOT: /home/dominik/.hunter
[cmake] -- [hunter] [ Hunter-ID: cb0ea1f | Toolchain-ID: a28275e | Config-ID: 6748d00 ]
[cmake] -- [hunter] SPDLOG_ROOT: /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Install (ver.: 1.8.0-p1)
[cmake] -- [hunter] Building spdlog
[cmake] loading initial cache file /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/cache.cmake
[cmake] loading initial cache file /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/args.cmake
[cmake] -- The C compiler identification is GNU 7.5.0
[cmake] -- The CXX compiler identification is GNU 7.5.0
[cmake] -- Check for working C compiler: /usr/bin/cc - skipped
[cmake] -- Detecting C compile features
[cmake] -- Detecting C compile features - done
[cmake] -- Check for working CXX compiler: /usr/bin/c++ - skipped
[cmake] -- Detecting CXX compile features
[cmake] -- Detecting CXX compile features - done
[cmake] -- Configuring done
[cmake] -- Generating done
[cmake] -- Build files have been written to: /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Build
[cmake] [1/16] Creating directories for 'spdlog-Release'
[cmake] [1/16] Performing download step (download, verify and extract) for 'spdlog-Release'
[cmake] -- verifying file...
[cmake]        file='/home/dominik/.hunter/_Base/Download/spdlog/1.8.0-p1/3bfb235/v1.8.0-p1.tar.gz'
[cmake] -- File already exists and hash match (skip download):
[cmake]   file='/home/dominik/.hunter/_Base/Download/spdlog/1.8.0-p1/3bfb235/v1.8.0-p1.tar.gz'
[cmake]   SHA1='3bfb2352482e6190c377f121b1f760dad767b58d'
[cmake] -- extracting...
[cmake]      src='/home/dominik/.hunter/_Base/Download/spdlog/1.8.0-p1/3bfb235/v1.8.0-p1.tar.gz'
[cmake]      dst='/home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Source'
[cmake] -- extracting... [tar xfz]
[cmake] -- extracting... [analysis]
[cmake] -- extracting... [rename]
[cmake] -- extracting... [clean up]
[cmake] -- extracting... done
[cmake] [2/16] No update step for 'spdlog-Release'
[cmake] [4/16] No patch step for 'spdlog-Release'
[cmake] [4/16] Performing configure step for 'spdlog-Release'
[cmake] loading initial cache file /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/cache.cmake
[cmake] loading initial cache file /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/args.cmake
[cmake] -- The CXX compiler identification is GNU 7.5.0
[cmake] -- Check for working CXX compiler: /usr/bin/c++ - skipped
[cmake] -- Detecting CXX compile features
[cmake] -- Detecting CXX compile features - done
[cmake] -- Build spdlog: 1.8.0
[cmake] -- Looking for C++ include pthread.h
[cmake] -- Looking for C++ include pthread.h - found
[cmake] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
[cmake] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
[cmake] -- Looking for pthread_create in pthreads
[cmake] -- Looking for pthread_create in pthreads - not found
[cmake] -- Looking for pthread_create in pthread
[cmake] -- Looking for pthread_create in pthread - found
[cmake] -- Found Threads: TRUE  
[cmake] -- Build type: Release
[cmake] -- [hunter] HUNTER_ROOT: /home/dominik/.hunter
[cmake] -- [hunter] [ Hunter-ID: cb0ea1f | Toolchain-ID: a28275e | Config-ID: 6748d00 ]
[cmake] -- [hunter] FMT_ROOT: /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Install (ver.: 8.1.1)
[cmake] -- Generating install
[cmake] -- Configuring done
[cmake] -- Generating done
[cmake] -- Build files have been written to: /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Build/spdlog-Release-prefix/src/spdlog-Release-build
[cmake] [5/16] Performing build step for 'spdlog-Release'
[cmake] [1/7] Building CXX object CMakeFiles/spdlog.dir/src/cfg.cpp.o
[cmake] FAILED: CMakeFiles/spdlog.dir/src/cfg.cpp.o 
[cmake] /usr/bin/c++ -DFMT_LOCALE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -I/home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Source/include -isystem /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Install/include -O3 -DNDEBUG -std=c++11 -MD -MT CMakeFiles/spdlog.dir/src/cfg.cpp.o -MF CMakeFiles/spdlog.dir/src/cfg.cpp.o.d -o CMakeFiles/spdlog.dir/src/cfg.cpp.o -c /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Source/src/cfg.cpp
[cmake] In file included from /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Source/src/cfg.cpp:8:0:
[cmake] /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Source/include/spdlog/cfg/helpers-inl.h: In function ‘std::__cxx11::string& spdlog::cfg::helpers::to_lower_(std::__cxx11::string&)’:
[cmake] /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Source/include/spdlog/cfg/helpers-inl.h:25:10: error: ‘transform’ is not a member of ‘std’
[cmake]      std::transform(
[cmake]           ^~~~~~~~~
[cmake] [2/7] Building CXX object CMakeFiles/spdlog.dir/src/file_sinks.cpp.o
[cmake] [3/7] Building CXX object CMakeFiles/spdlog.dir/src/async.cpp.o
[cmake] [4/7] Building CXX object CMakeFiles/spdlog.dir/src/stdout_sinks.cpp.o
[cmake] [5/7] Building CXX object CMakeFiles/spdlog.dir/src/color_sinks.cpp.o
[cmake] [6/7] Building CXX object CMakeFiles/spdlog.dir/src/spdlog.cpp.o
[cmake] FAILED: CMakeFiles/spdlog.dir/src/spdlog.cpp.o 
[cmake] /usr/bin/c++ -DFMT_LOCALE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -I/home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Source/include -isystem /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Install/include -O3 -DNDEBUG -std=c++11 -MD -MT CMakeFiles/spdlog.dir/src/spdlog.cpp.o -MF CMakeFiles/spdlog.dir/src/spdlog.cpp.o.d -o CMakeFiles/spdlog.dir/src/spdlog.cpp.o -c /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Source/src/spdlog.cpp
[cmake] In file included from /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Source/src/spdlog.cpp:9:0:
[cmake] /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Source/include/spdlog/common-inl.h: In constructor ‘spdlog::spdlog_ex::spdlog_ex(const string&, int)’:
[cmake] /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Source/include/spdlog/common-inl.h:57:53: error: cannot convert ‘const string {aka const std::__cxx11::basic_string<char>}’ to ‘const char*’ for argument ‘3’ to ‘void fmt::v8::format_system_error(fmt::v8::detail::buffer<char>&, int, const char*)’
[cmake]      fmt::format_system_error(outbuf, last_errno, msg);
[cmake]                                                      ^
[cmake] In file included from /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Source/include/spdlog/pattern_formatter-inl.h:10:0,
[cmake]                  from /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Source/src/spdlog.cpp:13:
[cmake] /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Source/include/spdlog/details/fmt_helper.h: In function ‘void spdlog::details::fmt_helper::pad2(int, spdlog::memory_buf_t&)’:
[cmake] /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Source/include/spdlog/details/fmt_helper.h:57:40: warning: ‘fmt::v8::appender fmt::v8::format_to(fmt::v8::basic_memory_buffer<char, SIZE, Allocator>&, fmt::v8::format_string<T ...>, T&& ...) [with T = {int&}; long unsigned int SIZE = 250; Allocator = std::allocator<char>; fmt::v8::format_string<T ...> = fmt::v8::basic_format_string<char, int&>]’ is deprecated [-Wdeprecated-declarations]
[cmake]          fmt::format_to(dest, "{:02}", n);
[cmake]                                         ^
[cmake] In file included from /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Source/include/spdlog/fmt/fmt.h:26:0,
[cmake]                  from /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Source/include/spdlog/common.h:36,
[cmake]                  from /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Source/include/spdlog/spdlog.h:12,
[cmake]                  from /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Source/include/spdlog/spdlog-inl.h:7,
[cmake]                  from /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Source/src/spdlog.cpp:8:
[cmake] /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Install/include/fmt/format.h:3064:21: note: declared here
[cmake]  FMT_DEPRECATED auto format_to(basic_memory_buffer<char, SIZE, Allocator>& buf,
[cmake]                      ^~~~~~~~~
[cmake] ninja: build stopped: subcommand failed.
[cmake] FAILED: spdlog-Release-prefix/src/spdlog-Release-stamp/spdlog-Release-build 
[cmake] cd /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Build/spdlog-Release-prefix/src/spdlog-Release-build && /usr/bin/cmake --build . --config Release -- -j16 && /usr/bin/cmake -E touch /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog/Build/spdlog-Release-prefix/src/spdlog-Release-stamp/spdlog-Release-build
[cmake] ninja: build stopped: subcommand failed.
[cmake] -- Configuring incomplete, errors occurred!
[cmake] See also "/home/dominik/Dokumente/hunter-bugexample/build/CMakeFiles/CMakeOutput.log".
[cmake] See also "/home/dominik/Dokumente/hunter-bugexample/build/CMakeFiles/CMakeError.log".
[cmake] 
[cmake] [hunter ** FATAL ERROR **] Build step failed (dir: /home/dominik/.hunter/_Base/cb0ea1f/a28275e/6748d00/Build/spdlog
[cmake] [hunter ** FATAL ERROR **] [Directory:/home/dominik/.hunter/_Base/Download/Hunter/0.23.322/cb0ea1f/Unpacked/cmake/projects/spdlog]
[cmake] 
[cmake] ------------------------------ ERROR -----------------------------
[cmake]     https://hunter.readthedocs.io/en/latest/reference/errors/error.external.build.failed.html
[cmake] ------------------------------------------------------------------
[cmake] 
[cmake] CMake Error at /home/dominik/.hunter/_Base/Download/Hunter/0.23.322/cb0ea1f/Unpacked/cmake/modules/hunter_error_page.cmake:12 (message):
[cmake] Call Stack (most recent call first):
[cmake]   /home/dominik/.hunter/_Base/Download/Hunter/0.23.322/cb0ea1f/Unpacked/cmake/modules/hunter_fatal_error.cmake:20 (hunter_error_page)
[cmake]   /home/dominik/.hunter/_Base/Download/Hunter/0.23.322/cb0ea1f/Unpacked/cmake/modules/hunter_download.cmake:623 (hunter_fatal_error)
[cmake]   /home/dominik/.hunter/_Base/Download/Hunter/0.23.322/cb0ea1f/Unpacked/cmake/projects/spdlog/hunter.cmake:147 (hunter_download)
[cmake]   /home/dominik/.hunter/_Base/Download/Hunter/0.23.322/cb0ea1f/Unpacked/cmake/modules/hunter_add_package.cmake:62 (include)
[cmake]   CMakeLists.txt:18 (hunter_add_package)
[cmake] 
[cmake] 

I've checked that the first error in logs IS NOT external.build.failed. [Yes]

  • I'm building on [Linux].
  • [I'm using official CMake release]
  • CMake version: 3.18.4 (kitware)
  • Compiler: GCC 7.5, Clang-12, GCC-10

I'm using the next command line on generate step:

cmake . -G "Ninja"

This might be related to #514 and gabime/spdlog#1975.

Reverting fmt to version 7.1.2 using a custom config.cmake fixes the issue, but this is obviously not a scalable solution. We probably need to update spdlog to a newer version (it's outdated anyway), but I think there should be some way to check against this.
Some examples of what could be done:

  • Rerun CI for dependend projects on updates (We can build a dependency tree by grepping for hunter_add_package).
  • Specify version dependencies.

I just wanted to do the update myself and noticed that I can't push to cpp-pm/spdlog because for some reason its not part of the cpp-pm-packages team. Probably just an oversight but would be cool if you could add it @rbsheth .

@rbsheth rbsheth added the bug Something isn't working label Feb 10, 2022
@rbsheth
Copy link
Member

rbsheth commented Feb 10, 2022

Uh oh! I just added cpp-pm-packages to that repo.

Thalhammer added a commit to Thalhammer/hunter that referenced this issue Feb 10, 2022
rbsheth pushed a commit that referenced this issue Feb 10, 2022
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
Development

Successfully merging a pull request may close this issue.

2 participants