Bug#918128: gazebo: autopkgtest fails due to invalid gazebo.pc

Bas Couwenberg sebastic at xs4all.nl
Thu Jan 3 16:26:19 GMT 2019


Source: gazebo
Version: 9.4.1+dfsg-1
Severity: serious
Tags: patch
Justification: makes the package in question unusable or mostly so
Control: block 917323 by -1

Dear Maintainer,

The autopkgtest for gazebo is failing due to an invalid gazebo.pc:

 autopkgtest [12:48:58]: test build: [-----------------------
 /usr/bin/ld: cannot find -l-lpthread
 collect2: error: ld returned 1 exit status
 autopkgtest [12:48:59]: test build: -----------------------]
 autopkgtest [12:48:59]: test build:  - - - - - - - - - - results - - - - - - - - - -
 build                FAIL non-zero exit status 1
 autopkgtest [12:49:00]: test build:  - - - - - - - - - - stderr - - - - - - - - - -
 /usr/bin/ld: cannot find -l-lpthread
 collect2: error: ld returned 1 exit status
 autopkgtest [12:49:00]: @@@@@@@@@@@@@@@@@@@@ summary
 build                FAIL non-zero exit status 1

See: https://ci.debian.net/data/packages/unstable/amd64/g/gazebo/latest-autopkgtest/log.gz

This is caused by ${Boost_LIBRARIES} containing:

 /usr/lib/x86_64-linux-gnu/libboost_thread.so;-lpthread;/usr/lib/x86_64-linux-gnu/libboost_signals.so;[...]

Which results in:

 [...]-L/usr/lib/x86_64-linux-gnu -lboost_thread -l-lpthread -lboost_signals[...]

The attached patch fixes the issue by prefixing -l only when it is not
already present.

Kind Regards,

Bas
-------------- next part --------------
Description: Don't prefix -l if already present.
 An invalid gazebo.pc is generated when ${Boost_LIBRARIES} contains:
 .
 /usr/lib/x86_64-linux-gnu/libboost_thread.so;-lpthread;/usr/lib/x86_64-linux-gnu/libboost_signals.so;[...]
 .
 This resulted in gazebo.pc containing:
 .
 [...]-L/usr/lib/x86_64-linux-gnu -lboost_thread -l-lpthread -lboost_signals[...]
 .
 Which in turn caused the autopkgtests to fail:
 .
 /usr/bin/ld: cannot find -l-lpthread
Author: Bas Couwenberg <sebastic at debian.org>

Index: gazebo-9.4.1+dfsg/CMakeLists.txt
===================================================================
--- gazebo-9.4.1+dfsg.orig/CMakeLists.txt
+++ gazebo-9.4.1+dfsg/CMakeLists.txt
@@ -371,8 +371,10 @@ else (build_errors)
 
   foreach (b ${Boost_LIBRARIES})
     get_filename_component(bname ${b} NAME_WE)
-    # Prefix always -l
-    set (bname "-l${bname}")
+    # Prefix -l if not already present
+    if(NOT ${bname} MATCHES "^-l")
+      set (bname "-l${bname}")
+    endif()
     # Remove the prefix lib (not always present, like in pthread)
     string (REPLACE "lib" "" bname "${bname}")
     set (Boost_PKGCONFIG_LIBS "${Boost_PKGCONFIG_LIBS} ${bname}")


More information about the debian-science-maintainers mailing list