Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 604958 - dev-util/cargo-0.15.0 fails to build due to openssl-sys being unable to determine include path from pkgconf (in place of pkg-config)
Summary: dev-util/cargo-0.15.0 fails to build due to openssl-sys being unable to deter...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Rust Project
Depends on:
Reported: 2017-01-07 17:36 UTC by Cody Schafer
Modified: 2018-10-11 19:40 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---

build log (cargo-0.15.0:20170107-173119.log.gz,8.30 KB, application/gzip)
2017-01-07 17:36 UTC, Cody Schafer
emerge --info '=dev-util/cargo-0.15.0::gentoo' (info,6.35 KB, text/plain)
2017-01-07 17:37 UTC, Cody Schafer
emerge -pqv '=dev-util/cargo-0.15.0::gentoo' (pqv,188 bytes, text/plain)
2017-01-07 17:38 UTC, Cody Schafer

Note You need to log in before you can comment on or make changes to this bug.
Description Cody Schafer 2017-01-07 17:36:45 UTC
Created attachment 459096 [details]
build log

Primary error appears to be openssl-sys requring pkg-config for openssl to indicate an include path.

However, `pkg-config --cflags openssl` returns no flags (indicating the default include path works).

error: failed to run custom build command for `openssl-sys v0.9.1`
process didn't exit successfully: `/var/tmp/portage/dev-util/cargo-0.15.0/work/cargo-0.15.0/target/release/build/openssl-sys-76c1fa79ef1208aa/build-script-build` (exit code: 101)
--- stdout

--- stderr
thread 'main' panicked at '

Used pkg-config to discover the OpenSSL installation, but pkg-config did not
return any include paths for the installation. This crate needs to take a peek
at the header files so it cannot proceed unless they're found.

You can try fixing this by setting the `OPENSSL_DIR` environment variable
pointing to your OpenSSL installation.

', /var/tmp/portage/dev-util/cargo-0.15.0/work/cargo_home/gentoo/openssl-sys-0.9.1/
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Comment 1 Cody Schafer 2017-01-07 17:37:28 UTC
Created attachment 459098 [details]
emerge --info '=dev-util/cargo-0.15.0::gentoo'
Comment 2 Cody Schafer 2017-01-07 17:38:34 UTC
Created attachment 459100 [details]
emerge -pqv '=dev-util/cargo-0.15.0::gentoo'
Comment 3 Cody Schafer 2017-01-08 16:17:42 UTC
Appears that this is caused by using pkgconf as the pkg-config provider.

I've opened an issue on rust-openssl, but this could theoretically also be fixed by adding support for the PKG_CONFIG_ALLOW_SYSTEM_CFLAGS env var to pkgconf.
Comment 4 Cody Schafer 2017-01-08 17:38:38 UTC
Locally built pkgconf-1.1.0 is giving the expected output.

x@arnold ~/g/pkgconf $ PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 ./pkgconf openssl --cflags
x@arnold ~/g/pkgconf $ PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkgconf openssl --cflags
x@arnold ~/g/pkgconf $ PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config openssl --cflags

But it also is including the system cflags when PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 is omitted:

x@arnold ~/g/pkgconf $ ./pkgconf openssl --cflags
x@arnold ~/g/pkgconf $ pkg-config openssl --cflags


Seems like a potential pkgconf bug.
Comment 5 Cody Schafer 2017-01-08 17:39:55 UTC
Also, pkgconf does superficially appear to have support for the PKG_CONFIG_ALLOW_SYSTEM_CFLAGS variable (it's source code mentions it).
Comment 6 Doug Goldstein (RETIRED) gentoo-dev 2017-02-02 20:07:49 UTC

Any feedback on the pkgconf issue/difference in output?
Comment 7 Nikolaj Šujskij 2017-02-03 06:43:57 UTC
Seemed to hit this bug with dev-util/cargo-0.16.0, although 0.15.0 was installed fine on Dec 28.
Comment 8 Ben Kohler gentoo-dev 2018-01-10 20:02:57 UTC
"PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkgconf openssl --cflags" does seem to be working for me on current stable dev-util/pkgconf-1.3.7, can you guys still reproduce the problem?

# PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkgconf openssl --cflags
# pkgconf --version
Comment 9 Jonas Stein gentoo-dev 2018-10-11 19:40:55 UTC
dev-util/cargo-0.15 is no longer in the tree and the bug seems fixed.
Please test with the recent package.