Default pkg-config paths not found

Bug #1661070 reported by Ruddick Lawrence
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
New
Undecided
Unassigned

Bug Description

pkg-config has built-in paths that it searches:

  $ pkg-config --variable pc_path pkg-config
/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig

However, these are absolute, so they are different in a snap. This results in scripts that use pkg-config failing (such as https://github.com/ros-simulation/gazebo_ros_pkgs/blob/kinetic-devel/gazebo_ros/scripts/gzserver#L26).

One solution might be setting the correct default paths in the PKG_CONFIG_PATH environment variable in the wrappers (similar to how PATH is treated).

Tags: robotics
affects: snapcraft (Ubuntu) → snapcraft
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

we some interesting things with .pc files as pkg-config does not have a concept of only one sysroot and from the point of view of pkg-config we have at least 3; the current part's install directory, the stage directory and the root file system.

Please send over a snapcraft enabled repo as a test subject to research further.

FTR, the package config search path is set, but it does the wrong thing wrt to prefix given the sysroot situation.

Changed in snapcraft:
status: New → Incomplete
Revision history for this message
Ruddick Lawrence (mrjogo) wrote :

Example attached. The "gazebo.pc" file it's looking for is at $SNAP/usr/lib/x86_64-linux-gnu/pkgconfig/gazebo.pc

This actually seems to be a subset of bug #1577514 in that the pkg-config default search paths are hardcoded.

Just for clarity, this issue is different from the rewriting of .pc files reported in bug #1661787.

Kyle Fazzari (kyrofa)
Changed in snapcraft:
status: Incomplete → New
Kyle Fazzari (kyrofa)
tags: added: robotics
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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