googletest 1.8.0-2 (on zesty) breaks existing builds [add_library cannot create target "gmock" ...]

Bug #1644062 reported by Michi Henning
32
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Mir
Fix Released
Critical
Chris Halse Rogers
0.25
Fix Released
Critical
Chris Halse Rogers
cmake-extras (Ubuntu)
Fix Released
Critical
Michi Henning
content-hub (Ubuntu)
Fix Released
Critical
Ken VanDine
googletest (Ubuntu)
Won't Fix
Critical
Unassigned
mir (Ubuntu)
Fix Released
Critical
Chris Halse Rogers
unity (Ubuntu)
Fix Released
Critical
Marco Trevisan (Treviño)

Bug Description

After upgrading to 1.8.0-2 (from 1.7.0-4), our previously-working builds break:

CMake Error at /usr/src/googletest/googletest/cmake/internal_utils.cmake:149 (add_library):
   add_library cannot create target "gmock" because another target with the
   same name already exists. The existing target is a static library created
   in source directory "/usr/src/googletest/googlemock". See documentation
   for policy CMP0002 for more details.
 Call Stack (most recent call first):
   /usr/src/googletest/googletest/cmake/internal_utils.cmake:172 (cxx_library_with_type)
   /usr/src/gmock/CMakeLists.txt:84 (cxx_library)

 CMake Error at /usr/src/googletest/googletest/cmake/internal_utils.cmake:149 (add_library):
   add_library cannot create target "gmock_main" because another target with
   the same name already exists. The existing target is a static library
   created in source directory "/usr/src/googletest/googlemock". See
   documentation for policy CMP0002 for more details.
 Call Stack (most recent call first):
   /usr/src/googletest/googletest/cmake/internal_utils.cmake:172 (cxx_library_with_type)
   /usr/src/gmock/CMakeLists.txt:89 (cxx_library)

 CMake Error at /usr/src/gmock/CMakeLists.txt:106 (install):
   install TARGETS given target "gmock" which does not exist in this
   directory.

The CMakeLists.txt in our project that triggers this error does this:

set(old_cxx_flags ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wno-old-style-cast -Wno-missing-field-initializers")
find_package(GMock)
set(CMAKE_CXX_FLAGS ${old_cxx_flags})

This used to work fine, but no breaks on zesty.

Related branches

Changed in googletest (Ubuntu):
importance: Undecided → Critical
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in googletest (Ubuntu):
status: New → Confirmed
summary: - 1.8.0-2 breaks existing builds
+ googletest 1.8.0-2 (on zesty) breaks existing builds
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: googletest 1.8.0-2 (on zesty) breaks existing builds
summary: - googletest 1.8.0-2 (on zesty) breaks existing builds
+ googletest 1.8.0-2 (on zesty) breaks existing builds [add_library cannot
+ create target "gmock" ...]
Revision history for this message
Michi Henning (michihenning) wrote :

Here is a cmake-extras change that deals with the broken googletest:

https://code.launchpad.net/~michihenning/cmake-extras/gtest-fixes/+merge/311565

Changed in cmake-extras (Ubuntu):
assignee: nobody → Michi Henning (michihenning)
status: New → In Progress
Changed in cmake-extras (Ubuntu):
status: In Progress → Fix Committed
status: Fix Committed → In Progress
Revision history for this message
Michi Henning (michihenning) wrote :

Fix is in silo 2225.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cmake-extras - 0.7+17.04.20161123.5-0ubuntu1

---------------
cmake-extras (0.7+17.04.20161123.5-0ubuntu1) zesty; urgency=medium

  * Fixes for gtest 1.8.0. (LP: #1644062) (LP: #1644062)

 -- Michi Henning <email address hidden> Wed, 23 Nov 2016 06:25:33 +0000

Changed in cmake-extras (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Hmm, looks like Mir won't benefit from that fix (doesn't use cmake-extras). Another fix will be required still.

Revision history for this message
Michi Henning (michihenning) wrote :

The fix for cmake-extras allows the builds to complete, but it still doesn't work. The problem now is that gtest install a pile of stuff in the install directory and, when it comes to creating the packages, the debian installation fails because of the --fail-missing; there are loads of files in the install dir now that are not picked up by the .install files. Sigh...

Changed in cmake-extras (Ubuntu):
status: Fix Released → In Progress
Revision history for this message
Michi Henning (michihenning) wrote :

If you figure out how to fix this for Mir, I'd like know what you did. The other avenue I tried was ExternalProject_Add, but I didn't get very far with that either because it seems that the gtest cmake files don't honour the INSTALL_DIR variable.

Changed in mir:
importance: Undecided → Critical
status: New → Confirmed
milestone: none → 0.26.0
Changed in cmake-extras (Ubuntu):
importance: Undecided → Critical
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Changed in mir:
assignee: nobody → Chris Halse Rogers (raof)
status: Confirmed → In Progress
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

Fix committed into lp:mir at revision None, scheduled for release in mir, milestone 0.26.0

Changed in mir:
status: In Progress → Fix Committed
Changed in cmake-extras (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Probably "Won't Fix" the googletest package itself, since this is its original form from Debian and we can work around it.

Changed in content-hub (Ubuntu):
assignee: nobody → Ken VanDine (ken-vandine)
importance: Undecided → Critical
status: New → In Progress
Changed in googletest (Ubuntu):
status: Confirmed → Won't Fix
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Fix committed to lp:mir/0.25 at revision 3819, scheduled for release in Mir 0.25.1 (or 0.25.0 ... not sure which one yet).

Changed in mir (Ubuntu):
importance: Undecided → Critical
status: New → Triaged
Changed in unity (Ubuntu):
assignee: nobody → Marco Trevisan (Treviño) (3v1n0)
status: New → In Progress
Changed in unity (Ubuntu):
importance: Undecided → Critical
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package content-hub - 0.2+17.04.20161128-0ubuntu1

---------------
content-hub (0.2+17.04.20161128-0ubuntu1) zesty; urgency=medium

  * Fix build failure on zesty due to googletest 1.8. Also refactored
    tests/acceptance-tests/CMakeLists.txt to make adding tests less
    cumbersome. (LP: #1644062)

 -- Ken VanDine <email address hidden> Mon, 28 Nov 2016 17:39:58 +0000

Changed in content-hub (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity - 7.5.0+17.04.20161130-0ubuntu1

---------------
unity (7.5.0+17.04.20161130-0ubuntu1) zesty; urgency=medium

  [ Kai-Heng Feng ]
  * UnitySettings: If scale-factor is not set, find and set right scale
    for HiDPI displays.

  [ Marco Trevisan (Treviño) ]
  * CMakeLists.txt: add support to compile with GTest 1.8 (LP: #1644062)
  * UnityScreen: toggle gestures recognition on lock (LP: #1645507)

 -- Marco Trevisan (Treviño) <mail@3v1n0.net> Wed, 30 Nov 2016 11:06:58 +0000

Changed in unity (Ubuntu):
status: In Progress → Fix Released
Changed in mir (Ubuntu):
assignee: nobody → Chris Halse Rogers (raof)
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (5.7 KiB)

This bug was fixed in the package mir - 0.25.0+17.04.20161203-0ubuntu1

---------------
mir (0.25.0+17.04.20161203-0ubuntu1) zesty; urgency=medium

  * New upstream release 0.25.0 (https://launchpad.net/mir/+milestone/0.25.0)
    - ABI summary:
      . mirclient ABI unchanged at 9
      . mirserver ABI bumped to 42
      . mircommon ABI bumped to 7
      . mirplatform ABI bumped to 14
      . mirprotobuf ABI unchanged at 3
      . mirplatformgraphics ABI bumped to 11
      . mirclientplatform ABI unchanged at 5
      . mirinputplatform ABI bumped to 6
      . mircore ABI added, at version 1
    - Enhancements:
      . Added pointer confinement support
      . Identify Raspberry Pi output types correctly
      . Added dead key and compose key support
      . Added gamma support for KMS hardware
      . Added yakkety and zesty gcc-6 support
      . Added surface passthrough support for fullscreen clients of nested
        servers
      . Introduced a new library `libmircore'
      . Began migrating from Protobuf to Cap'n Proto starting with events
      . Began support for VirtualBox (servers now start instead of crashing
        but full support for GL clients is still missing)
      . Began support for high precision frame timing, implemented for the
        KMS, Android and X11 backends so far
      . Added --display-report support for the X11 backend
      . Improved reliability of `mirvanity' latency test tool
      . Moved to using the CSS cursor naming scheme internally, although
        the old symbolic indentifiers remain unchanged and still work
      . Added refresh rate to MirSurfaceOutputEvent
      . Many improvements to automated test quality and coverage
      . Smoother desktop zoom using mir_proving_server (Super + two fingers)
    - Bugs fixed:
      . FTBFS On Zesty: invalid use of
        'struct native_handle' (LP: #1638774)
      . libmirclient-debug-extension-dev install debug/surface.h
        twice (LP: #1639153)
      . Mir crashes on virtual box drmModeCrtcSetGamma
        Function not implemented (LP: #1638220)
      . Flickering in mir_demo_client_multistream (LP: #1635273)
      . Camera apps (camera & vanity) never exit (LP: #1635010)
      . Clients cannot connect when MIR_SOCKET="" (LP: #1634508)
      . mirtest-dev packaging fails to sepcify boost depends (LP: #1633537)
      . cursor.h is unclear about mir_diagonal_resize_* (LP: #1626924)
      . Inconsistent underscores in cursor names (LP: #1632617)
      . [regression] Accidental libmircommon.so.6 break (LP: #1617865)
      . [regression] mir demo server fails to start with mx4 (LP: #1615703)
      . [regression] Trust prompt now shown when starting camera (LP: #1612256)
      . [regression] make abi-check fails to build (LP: #1626866)
      . Nested servers prevent overlays or fullscreen bypass (LP: #1262116)
      . Failed to get PRIME fd from gbm bo (LP: #1607812)
      . Mir-on-X is difficult to use on 1366x768 laptop (LP: #1590959)
      . Remove useless message 'Surface 0 DPI' in demos (LP: #1559831)
      . Mir fails to cross-build with newer sbuild (LP: #1628507)
      . Infinite loop in AbstractShell::focus_next_session (LP: #1625401)
      . Dest...

Read more...

Changed in mir (Ubuntu):
status: In Progress → Fix Released
Changed in mir:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.