Bug 1154 - The /usr/bin/pkg-config symlink is bad
Summary: The /usr/bin/pkg-config symlink is bad
Alias: None
Product: Runtime
Classification: Mono
Component: packaging (show other bugs)
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2011-09-30 08:57 UTC by Tor Lillqvist
Modified: 2013-02-11 22:36 UTC (History)
6 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:


Description Tor Lillqvist 2011-09-30 08:57:53 UTC
I don't think it is proper that the Mono Framework installs a /usr/bin/pkg-config symlink. It is misleading, and as this is a Mono-specific pkg-config, it doesn't scan /usr/lib/pkgconfig (which Apple mysteriously provides even if they don't provide a pkg-config) anyway.

A configure script for some random software might see this pkg-config and think that the system provides pkg-config in the "normal" way and try to use it to get information about MacOSX system libs, and then fail. (If there was no such bogus /usr/bin/pkg-config, that configure script hopefully would realize that it needs to use other methods to find out cflags and libs.)

This is not just a hypothetical example, but happens when building LibreOffice. The configure script in some of the 3rd-party libraries bundled with it get confused by this /usr/bin/pkg-config.
Comment 1 David Laban 2012-05-02 07:15:15 UTC
This also causes breakages in https://trac.macports.org/ticket/25318 and a number of homebrew things.

/usr/bin is owned by Apple. /usr/local is also in users' $PATH by default, and is a more appropriate place for user-installed crap.

See also this post from debian regarding PKG_CONFIG_LIBDIR: http://lists.debian.org/debian-embedded/2004/06/msg00122.html

I have deleted the /usr/bin/pkg-config symlink from my system. If you want a patch to make this less broken, I will provide, but I don't want to try to fix it until I know why it was broken.

What is it that you are trying to achieve by breaking pkg-config anyway? Avoiding known-broken versions of packages on the system? (You can do that by specifying your  package versions more precicely.). Maybe I should dig through the revision history to find out who to shout at.
Comment 2 mistydemeo 2012-06-17 12:10:32 UTC
Following up on what David said, I'd like to see this resolved in Mono as well. Installing a Mono-specific pkg-config anywhere in the standard PATH is a bad idea, as it's likely to be picked up by general builds. Since it's already otherwise nicely sequestered in the Mono framework, it's really not necessary to create the symlink in the first place.
Comment 3 mistydemeo 2012-11-14 12:47:25 UTC
Has there been any progress or followup for this issue? I reencountered this problem today when a Homebrew user encountered a build error that we eventually tracked down to this: https://github.com/mxcl/homebrew/issues/16050

Notice (2018-05-21): bugzilla.xamarin.com will be switching to read-only mode on Thursday, 2018-05-25 22:00 UTC.

Please join us on Visual Studio Developer Community and GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs and copy them to the new locations as needed for follow-up. The See Also field on each Bugzilla bug will be updated with a link to its new location when applicable.

After Bugzilla is read-only, if you have new information to add for a bug that does not yet have a matching issue on Developer Community or GitHub, you can create a follow-up issue in the new location. Copy and paste the title and description from this bug, and then add your new details. You can get a pre-formatted version of the title and description here:

In special cases you might also want the comments:

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Note You need to log in before you can comment on or make changes to this bug.