Skip to content

[gtest] build failure while using GCC 11 (trunk) #15617

@PragmaTwice

Description

@PragmaTwice

Host Environment

  • OS: Linux 5.8.18-1-MANJARO
  • Compiler: g++ (GCC) 11.0.0 20201227 (experimental)

To Reproduce
./vcpkg install gtest

Failure logs

Computing installation plan...
The following packages will be built and installed:
    gtest[core]:x64-linux
Detecting compiler hash for triplet x64-linux...
Starting package 1/1: gtest:x64-linux
Building package gtest[core]:x64-linux...
Could not locate cached archive: /home/twice/.cache/vcpkg/archives/1a/1ac447f4d814709eb219cbfb117dd4a60277c43d.zip
-- Using cached /home/twice/vcpkg/downloads/google-googletest-release-1.10.0.tar.gz
-- Cleaning sources at /home/twice/vcpkg/buildtrees/gtest/src/ase-1.10.0-7231afa423.clean. Use --editable to skip cleaning for the packages you specify.

-- Extracting source /home/twice/vcpkg/downloads/google-googletest-release-1.10.0.tar.gz
-- Applying patch 0002-Fix-z7-override.patch
-- Applying patch fix-main-lib-path.patch
-- Using source at /home/twice/vcpkg/buildtrees/gtest/src/ase-1.10.0-7231afa423.clean
-- Configuring x64-linux-dbg
-- Configuring x64-linux-rel
-- Building x64-linux-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:142 (message):
    Command failed: /home/twice/vcpkg/downloads/tools/cmake-3.18.4-linux/cmake-3.18.4-Linux-x86_64/bin/cmake --build . --config Debug --target install -- -v -j17
    Working Directory: /home/twice/vcpkg/buildtrees/gtest/x64-linux-dbg
    See logs for more information:
      /home/twice/vcpkg/buildtrees/gtest/install-x64-linux-dbg-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_build_cmake.cmake:93 (vcpkg_execute_build_process)
  scripts/cmake/vcpkg_install_cmake.cmake:24 (vcpkg_build_cmake)
  ports/gtest/portfile.cmake:28 (vcpkg_install_cmake)
  scripts/ports.cmake:135 (include)


Error: Building package gtest:x64-linux failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `./vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: gtest:x64-linux
  Vcpkg version: 2020.06.15-unknownhash

Additionally, attach any relevant sections from the log files above.

install-x64-linux-dbg-out.log

Additional context
The build error is caused by a new warning (something may be used uninitialized) in GCC 11 and -Werror in CMake configuration of gtest.
Master branch of gtest has fixed this compile error, but we cannot expect any releases due to Abseil's Live-at-Head philosophy.
So how about adding a patch for it?

Metadata

Metadata

Assignees

Labels

category:port-bugThe issue is with a library, which is something the port should already supportcategory:port-updateThe issue is with a library, which is requesting update new revision

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions