microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.86k stars 6.3k forks source link

[fmt] Build error on x64-linux #40876

Closed lichuangcheng closed 3 days ago

lichuangcheng commented 1 week ago

Package: fmt:x64-linux@11.0.2

Host Environment

To Reproduce

vcpkg install

Failure logs

-- Using cached fmtlib-fmt-11.0.2.tar.gz.
-- Cleaning sources at /home/licc/pkgs/vcpkg/buildtrees/fmt/src/11.0.2-463dc5ff21.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source /home/licc/pkgs/vcpkg/downloads/fmtlib-fmt-11.0.2.tar.gz
-- Applying patch fix-write-batch.patch
-- Using source at /home/licc/pkgs/vcpkg/buildtrees/fmt/src/11.0.2-463dc5ff21.clean
-- Found external ninja('1.11.1').
-- Configuring x64-linux
-- Building x64-linux-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
    Command failed: /home/licc/pkgs/vcpkg/downloads/tools/cmake-3.29.2-linux/cmake-3.29.2-linux-x86_64/bin/cmake --build . --config Debug --target install -- -v -j65
    Working Directory: /home/licc/pkgs/vcpkg/buildtrees/fmt/x64-linux-dbg
    See logs for more information:
      /home/licc/pkgs/vcpkg/buildtrees/fmt/install-x64-linux-dbg-out.log

Call Stack (most recent call first):
  /home/licc/sources/webrtc/mediasoup-clientpp/build/vcpkg_installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process)
  /home/licc/sources/webrtc/mediasoup-clientpp/build/vcpkg_installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build)
  ports/fmt/portfile.cmake:19 (vcpkg_cmake_install)
  scripts/ports.cmake:192 (include)
/home/licc/pkgs/vcpkg/buildtrees/fmt/install-x64-linux-dbg-out.log ``` Change Dir: '/home/licc/pkgs/vcpkg/buildtrees/fmt/x64-linux-dbg' Run Build Command(s): /home/licc/.local/bin/ninja -v -v -j65 install [1/4] /home/licc/pkgs/gcc-13.2.0/bin/g++ -I/home/licc/pkgs/vcpkg/buildtrees/fmt/src/11.0.2-463dc5ff21.clean/include -fPIC -g -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT CMakeFiles/fmt.dir/src/os.cc.o -MF CMakeFiles/fmt.dir/src/os.cc.o.d -o CMakeFiles/fmt.dir/src/os.cc.o -c /home/licc/pkgs/vcpkg/buildtrees/fmt/src/11.0.2-463dc5ff21.clean/src/os.cc FAILED: CMakeFiles/fmt.dir/src/os.cc.o /home/licc/pkgs/gcc-13.2.0/bin/g++ -I/home/licc/pkgs/vcpkg/buildtrees/fmt/src/11.0.2-463dc5ff21.clean/include -fPIC -g -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT CMakeFiles/fmt.dir/src/os.cc.o -MF CMakeFiles/fmt.dir/src/os.cc.o.d -o CMakeFiles/fmt.dir/src/os.cc.o -c /home/licc/pkgs/vcpkg/buildtrees/fmt/src/11.0.2-463dc5ff21.clean/src/os.cc In file included from /home/licc/pkgs/vcpkg/buildtrees/fmt/src/11.0.2-463dc5ff21.clean/include/fmt/os.h:20, from /home/licc/pkgs/vcpkg/buildtrees/fmt/src/11.0.2-463dc5ff21.clean/src/os.cc:13: /usr/include/xlocale.h:27:16: error: redefinition of ‘struct __locale_struct’ 27 | typedef struct __locale_struct | ^~~~~~~~~~~~~~~ In file included from /usr/include/bits/types/locale_t.h:22, from /usr/include/string.h:152, from /home/licc/pkgs/vcpkg/buildtrees/fmt/src/11.0.2-463dc5ff21.clean/include/fmt/base.h:18, from /home/licc/pkgs/vcpkg/buildtrees/fmt/src/11.0.2-463dc5ff21.clean/include/fmt/format.h:41, from /home/licc/pkgs/vcpkg/buildtrees/fmt/src/11.0.2-463dc5ff21.clean/include/fmt/os.h:11: /usr/include/bits/types/__locale_t.h:28:8: note: previous definition of ‘struct __locale_struct’ 28 | struct __locale_struct | ^~~~~~~~~~~~~~~ /usr/include/xlocale.h:39:4: error: conflicting declaration ‘typedef int* __locale_t’ 39 | } *__locale_t; | ^~~~~~~~~~ /usr/include/bits/types/__locale_t.h:42:33: note: previous declaration as ‘typedef struct __locale_struct* __locale_t’ 42 | typedef struct __locale_struct *__locale_t; | ^~~~~~~~~~ [2/4] /home/licc/pkgs/gcc-13.2.0/bin/g++ -I/home/licc/pkgs/vcpkg/buildtrees/fmt/src/11.0.2-463dc5ff21.clean/include -fPIC -g -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT CMakeFiles/fmt.dir/src/format.cc.o -MF CMakeFiles/fmt.dir/src/format.cc.o.d -o CMakeFiles/fmt.dir/src/format.cc.o -c /home/licc/pkgs/vcpkg/buildtrees/fmt/src/11.0.2-463dc5ff21.clean/src/format.cc ninja: build stopped: subcommand failed. ```

Additional context

vcpkg.json ``` { "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", "name": "zwrtc", "version": "0.1.0", "dependencies": [ { "name": "ixwebsocket", "default-features": false, "features": [ "mbedtls" ] }, "asio", "spdlog", "doctest", "stb" ] } ```
LilyWangLL commented 1 week ago

I can't reproduce this issue locally, I test this issue on the Linux with GCC 9.4.0 and GCC 13.2.0, and all install succeed.

lichuangcheng commented 1 week ago

Thank you for your work!

The problem is on a centos7 server, and according to the compilation error message, it may be related to the header file environment that comes with centos7

The problem occurs with fmt 11 and above, I ended up locking the fmt version to 10.1.1 to get around it.