I am importing dev-util/sccache into Chrome OS and ran into the following: error: failed to run custom build command for `openssl-sys v0.9.53` Caused by: process didn't exit successfully: `/var/tmp/portage/dev-util/sccache-0.2.13/work/sccache-0.2.13/target/release/build/openssl-sys-a0d5a562fcd388a9/build-script-main` (exit code: 101) --- stdout cargo:rustc-cfg=const_fn cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset cargo:rerun-if-env-changed=OPENSSL_LIB_DIR OPENSSL_LIB_DIR unset cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR OPENSSL_INCLUDE_DIR unset cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset cargo:rerun-if-env-changed=OPENSSL_DIR OPENSSL_DIR unset I have a workaround here: https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/2562578/1/dev-util/sccache/sccache.bashrc However, it would be possible to fix this by adding: export OPENSSL_DIR="${ESYSROOT}/usr" to src_prepare Reproducible: Always
Created attachment 675190 [details] Build log
looks like you have some kind of pkg-config wrapper in cros returns err. the error comes from pkg-config invocation ERROR: Do not call unprefixed tools directly.\n \u{1b}[31;01m*\u{1b}[0m pkg-config: ERROR: For board tools, use `tc-export PKG_CONFIG` (or ${CHOST}-pkg-config).\n \u{1b}[31;01m*\u{1b}[0m pkg-config: ERROR: For build-time-only tools, `tc-export BUILD_PKG_CONFIG` (or ${CBUILD}-pkg-config) here's the logic how the crate chooses which pkg-config to run fn command(&self, name: &str, args: &[&str]) -> Command { let exe = self .env_var_os("PKG_CONFIG") .unwrap_or_else(|| OsString::from("pkg-config")); https://github.com/rust-lang/pkg-config-rs/blob/54325785816695df031cef3b26b6a9a203bbc01b/src/lib.rs#L395-L398 so I think more appropriate fix would be to export PKG_CONFIG variable properly, like wrapper suggests. in ::gentoo we do it in cargo_src_compile from cargo.eclass currently it has tc-export AR CC CXX I can add PKG_CONFIG in there. in case you don't use our cargo.eclass, I think you could add similar export to yours. can you test this suggestion with your wrapper?
I added PKG_CONFIG to the tc-export in cargo_src_compile() like you suggested and that worked. Thanks.
nice, thanks for confirming.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=010e27edb8f99fa7d61a51acbaffafac6b7f8a33 commit 010e27edb8f99fa7d61a51acbaffafac6b7f8a33 Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2020-11-28 06:34:22 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2020-11-28 06:35:49 +0000 eclass/cargo.eclass: tc-export PKG_CONFIG this way cargo will call properly prefixed pkg-config binary Closes: https://bugs.gentoo.org/756913 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> eclass/cargo.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)