FTBFS against g++ 11

Bug #1950028 reported by Dan Bungert
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
thin-provisioning-tools (Debian)
Fix Released
Unknown
thin-provisioning-tools (Ubuntu)
Fix Released
Undecided
Christian Ehrhardt 

Bug Description

thin-provisioning-tools has errors like this when built with g++-11

/usr/src/googletest/googlemock/include/gmock/gmock-function-mocker.h:450:60: error: template argument 1 is invalid
  450 | args_num, ::testing::internal::identity_t<__VA_ARGS__>); \
      | ^
/usr/src/googletest/googlemock/include/gmock/gmock-function-mocker.h:120:24: note: in definition of macro ‘GMOCK_INTERNAL_ASSERT_VALID_SIGNATURE
  120 | std::is_function<__VA_ARGS__>::value, \
      | ^~~~~~~~~~~
/usr/src/googletest/googlemock/include/gmock/gmock-function-mocker.h:296:30: note: in expansion of macro ‘GMOCK_INTERNAL_MOCK_METHODN’
  296 | #define MOCK_METHOD0(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 0, __VA_ARGS__)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
unit-tests/copier_t.cc:42:17: note: in expansion of macro ‘MOCK_METHOD0’
   42 | MOCK_METHOD0(wait, optional<wait_result>());
      | ^~~~~~~~~~~~

Related branches

Changed in thin-provisioning-tools (Ubuntu):
status: New → Triaged
Changed in thin-provisioning-tools (Debian):
status: Unknown → New
tags: added: server-todo
Revision history for this message
Christian Ehrhardt  (paelzer) wrote (last edit ):

I was able to reproduce it in sbuild locally.

But reproducing it from upstream git did not work well.
Neither with libgmock-dev from the package

   $ ./configure --enable-testing
   $ make
   $ apt install libgmock-dev
   # that is version 1.11.0-3
   $ make unit-test

Nor using upstreams get-mock as outlined in their readme

   $ apt remove libgmock-dev
   $ ./get-gmock.sh
   # that fetches head which is at 97a46757 (1.11 plus a few fixes)
   $ make clean
   $ make
   $ make unit-test

Both tests fail, but they do so at different places than the package build
Fails, but slightly different (also build errors)
./persistent-data/data-structures/btree.tcc:698:35: error: no match for ‘operator!=’ (operand types are ‘const value_type’ {aka ‘const {anonymous}::thing’} and ‘{anonymous}::thing_traits::value_type’ {aka ‘{anonymous}::thing’})
  698 | if (value != old_value) {

Furthermore whatever the problem is with upstream, this one does not go away when installing and forcing gcc-10

Therefore - as-is - I can't report that upstream in a useful way.
Our issue is somewhat special to Debian/Ubuntu builds.

Looking at our delta to upstream ...

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

There is some test delta, but for boost and I'd not see an immediate conenction to our FTBFS fails we see.

But what I was able to confirm was that setting it back to use gcc-10 for now works.
The following gets the build in Jammy working.

diff --git a/debian/control b/debian/control
index 5964039..bd1452a 100644
--- a/debian/control
+++ b/debian/control
@@ -12,6 +12,8 @@ Build-Depends:
  libexpat1-dev,
  libgtest-dev,
  google-mock,
+ gcc-10,
+ g++-10,
 Standards-Version: 3.9.5
 Vcs-Git: https://salsa.debian.org/lvm-team/thin-provisioning-tools.git
 Vcs-Browser: https://salsa.debian.org/lvm-team/thin-provisioning-tools
diff --git a/debian/rules b/debian/rules
index f9fa1cc..6c2401f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,6 +5,8 @@
 #export DH_VERBOSE=1

 export DEB_BUILD_MAINT_OPTIONS = optimize=-lto
+export CC=gcc-10
+export CXX=g++-10

 include /usr/share/dpkg/default.mk

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Maybe the real test fixup needs more domain knowledge or time, we can wait for the Debian bug to be resolved by the maintainer who wrote the tests (as I said above, upstream git behaves different).

Until then the change above will resolve the issue for us and get this out of excuses.

Changed in thin-provisioning-tools (Ubuntu):
assignee: nobody → Christian Ehrhardt  (paelzer)
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

MR approved and uploaded to Jammy.

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

This bug was fixed in the package thin-provisioning-tools - 0.9.0-1ubuntu3

---------------
thin-provisioning-tools (0.9.0-1ubuntu3) jammy; urgency=medium

  * d/control, d/rules: force gcc-10 to avoid a gcc-11 FTBFS
    for now (LP: #1950028)

 -- Christian Ehrhardt <email address hidden> Thu, 16 Dec 2021 11:30:28 +0100

Changed in thin-provisioning-tools (Ubuntu):
status: Triaged → Fix Released
Changed in thin-provisioning-tools (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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