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.
The current presentation of build errors is difficult for users to understand. The real cause of the failure gets buried under an intimidating amount of irrelevant information printed before and after the actual error the script is trying to communicate.
This implements the API required for #167, making
pkg_config
's error output much more readable, avoiding most of the other output that obscures the root cause of the failure.Before
↓ note that the output is so long that GitHub doesn't display it fully. Users have the same problem with terminals and output panels in IDEs that have a limited height.
After
This requires crates to call
pkg_config::probe_library_or_exit("foobar")
instead ofpkg_config::probe_library("foobar").unwrap()
.This is because the general-purpose probe function returning
Result
can't know whether the build script will continue and use some fallback, and must print thecargo:rerun-if-env-changed
directives just in case.*_or_exit
version knows the build will fail. Failed builds don't get cached and will re-run anyway, so there's no need to print the noisyrerun-if-env-changed
directives in that case.