This repository has been archived by the owner on Sep 4, 2022. It is now read-only.
Show a more helpful error message if pkg-config failed to execute #440
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kpcyrd
force-pushed
the
helpful-pkg-config-error
branch
from
October 25, 2020 13:32
cf3b1f1
to
3e031cd
Compare
kpp
previously approved these changes
Oct 25, 2020
bors r+ |
bors bot
added a commit
that referenced
this pull request
Oct 25, 2020
440: Show a more helpful error message if pkg-config failed to execute r=kpcyrd a=kpcyrd ## Before ``` error: failed to run custom build command for `libsodium-sys v0.2.6 (/sodiumoxide/libsodium-sys)` Caused by: process didn't exit successfully: `/sodiumoxide/target/debug/build/libsodium-sys-e518d918bc369c57/build-script-build` (exit code: 101) --- stdout cargo:rerun-if-env-changed=SODIUM_LIB_DIR cargo:rerun-if-env-changed=SODIUM_SHARED cargo:rerun-if-env-changed=SODIUM_USE_PKG_CONFIG cargo:rerun-if-env-changed=SODIUM_DISABLE_PIE cargo:rerun-if-env-changed=LIBSODIUM_NO_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG cargo:rerun-if-env-changed=LIBSODIUM_STATIC cargo:rerun-if-env-changed=LIBSODIUM_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR --- stderr thread 'main' panicked at 'Error: Command { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"libsodium\"", cause: Os { code: 2, kind: NotFound, message: "No such file or directory" } }', libsodium-sys/build.rs:115:13 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` ## After ``` error: failed to run custom build command for `libsodium-sys v0.2.6 (/sodiumoxide/libsodium-sys)` Caused by: process didn't exit successfully: `/sodiumoxide/target/debug/build/libsodium-sys-e518d918bc369c57/build-script-build` (exit code: 101) --- stdout cargo:rerun-if-env-changed=SODIUM_LIB_DIR cargo:rerun-if-env-changed=SODIUM_SHARED cargo:rerun-if-env-changed=SODIUM_USE_PKG_CONFIG cargo:rerun-if-env-changed=SODIUM_DISABLE_PIE cargo:rerun-if-env-changed=LIBSODIUM_NO_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG cargo:rerun-if-env-changed=LIBSODIUM_STATIC cargo:rerun-if-env-changed=LIBSODIUM_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR --- stderr thread 'main' panicked at ' Failed to run pkg-config: Command { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"libsodium\"", cause: Os { code: 2, kind: NotFound, message: "No such file or directory" } } You can try fixing this by installing pkg-config: # On Ubuntu sudo apt install pkg-config # On Arch Linux sudo pacman -S pkgconf # On Fedora sudo dnf install pkgconf-pkg-config ', libsodium-sys/build.rs:115:13 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` This is inspired by openssl-sys, which does something [similar](https://github.com/sfackler/rust-openssl/blob/e796b76e473ff244c2eb0545000361ce9a20b0da/openssl-sys/build/main.rs#L140-L163). Co-authored-by: kpcyrd <git@rxv.cc>
Timed out. |
No way... |
kpcyrd
force-pushed
the
helpful-pkg-config-error
branch
from
November 16, 2020 13:46
3e031cd
to
b8a38cc
Compare
Ping? |
This looks a bit like a rustc regression, the tests are probably also broken on master. |
What shall we do then? |
We can retry it. if regression still exists (on latest rust version) we need to create an issue about it on rust-lang/rust |
Our master branch also has broken tests on nightly and beta started failing here too after the recent 1.48.0 rust release. I've asked in ##rust on freenode and they asked if we could provide a reduced test-case. |
kpcyrd
force-pushed
the
helpful-pkg-config-error
branch
from
November 24, 2020 02:55
b8a38cc
to
eb7c5f0
Compare
kpp
approved these changes
Nov 24, 2020
bors: r+ |
Build succeeded: |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Before
After
This is inspired by openssl-sys, which does something similar.