[Bug 1523508] Re: Building xorg-gtest fails with new pkg-config

Bug Watch Updater 1523508 at bugs.launchpad.net
Mon Dec 7 14:21:31 UTC 2015


Launchpad has imported 1 comments from the remote bug at
https://bugs.freedesktop.org/show_bug.cgi?id=93284.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2015-12-07T13:54:37+00:00 Marco Trevisan (Treviño) wrote:

I'm Marco, from the Ubuntu desktop team; and we're facing an issue with
recent pkg-config when using it in cmake.

As per commit 50c2867f4a6981e085c721d936c96f174f11f415 in pkg-config,
variables are unquoted.

This is fine for most of scenarios, but when there are variables such as

 CPPflags=-I${includedir} -I${includedir}/xorg -I${sourcedir} \
 -DDUMMY_CONF_PATH=\"${datarootdir}/xorg/gtest/dummy.conf\" \
 -DLOGFILE_DIR=\"/tmp\"

Then when using the new pkg-config "pkg-config --variable=CPPflags"
returns something like:

 -I/usr/include -I/usr/include/xorg -I/usr/src/xorg-gtest \
 -DDUMMY_CONF_PATH="/usr/share/xorg/gtest/dummy.conf" \
 -DLOGFILE_DIR="/tmp"

Which is wrong since the quotes aren't escaped.

Changing the variable so that it uses something like
  -DLOGFILE_DIR=\\\"/tmp\\\"

Makes it return the proper thing, but not in a subshell, but it doesn't
seem the case.

In fact pkg-config seems to return the proper thing when called in a
subshell, but not when used directly.

I.e.:

$ pkg-config --variable=CPPflags xorg-gtest
+ pkg-config --variable=CPPflags xorg-gtest
-I/usr/include -I/usr/include/xorg -I/usr/src/xorg-gtest
-DDUMMY_CONF_PATH="/usr/share/xorg/gtest/dummy.conf" -DLOGFILE_DIR="/tmp"

$ gcc-5 $(pkg-config --variable=CPPflags xorg-gtest) foo.c
++ pkg-config --variable=CPPflags xorg-gtest
+ gcc-5 -I/usr/include -I/usr/include/xorg -I/usr/src/xorg-gtest
'-DDUMMY_CONF_PATH="/usr/share/xorg/gtest/dummy.conf"'
'-DLOGFILE_DIR="/tmp"' foo.c

As you can see when called in a subshell, the variables are properly
single-quoted, making the thing work. But when calling this directly
there are no single quotes.

So I'm wondering what's the best way to fix this case.

Reply at: https://bugs.launchpad.net/ubuntu/+source/pkg-
config/+bug/1523508/comments/0


** Changed in: pkg-config
       Status: Unknown => Confirmed

** Changed in: pkg-config
   Importance: Unknown => Medium

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to pkg-config in Ubuntu.
https://bugs.launchpad.net/bugs/1523508

Title:
  Building xorg-gtest fails with new pkg-config

Status in pkg-config:
  Confirmed
Status in pkg-config package in Ubuntu:
  Triaged

Bug description:
  As per the pkg-config change of unquoting variables, building xorg-
  gtest (in compiz for example) fails.

  See more details in the linked upstream bug.

To manage notifications about this bug go to:
https://bugs.launchpad.net/pkg-config/+bug/1523508/+subscriptions



More information about the foundations-bugs mailing list