[PROF-5748] Improve error message when pkg-config tool is not installed #2134
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Add a better error message to be presented to customers when
pkg-config
is not installed. (See below for example)Motivation
In #2068 a customer reported that they were not getting profiling with the message:
After investigating this issue (and adding extra tools to debug it, see #2069) it turns out that the customer was missing the
pkg-config
tool.This tool is currently invoked indirectly via Ruby's
mkmf
helper, and is used to configure linking to libddprof/libdatadog.I must admit I was surprised that there's not better error logging in
mkmf
when thepkg-config
tool is actually missing (vs it being installed but returning an error when being called).Thus, to hopefully avoid other customers running into this issue, I've added a bit of code to detect it, and hopefully present a better error message in that situation.
I've also learned that
pkg-config
is "old news" on some Linux distributions, and instead they ship something calledpkgconf
which is a reimplementation ofpkg-config
.Additional Notes
How to test the change?
Beyond the RSpec tests, this can be triggered for testing by:
pkg_config
call on extconf.rbwhich triggers the generic message (because pkg-config is available but returns an error since the configuration file is not found):
pkg_config
:Closes #2068