Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 646132

Summary: dev-lang/rust-1.23.0-r1 has automagic dependency on net-libs/http-parser and net-libs/libssh2
Product: Gentoo Linux Reporter: Martin Väth <martin>
Component: Current packagesAssignee: Gentoo Rust Project <rust>
Status: RESOLVED FIXED    
Severity: normal CC: gyakovlev, herrtimson, orbea
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/30861
Whiteboard:
Package list:
Runtime testing required: ---

Description Martin Väth 2018-01-30 17:23:11 UTC
Since some of the previous gentoo repository updates, nothing depends anymore on net-libs/http-parser and net-libs/libssh2 on my system.

However, these packages are not properly unmerged with FEATURES=preserved-libs, because the rust and cargo binaries installed by dev-lang/rust-1.23.0-r1[extended] link to the libraries installed by these packages.

So either the dependency is missing by mistake, or it is a mistake that the rust and cargo binaries are linked to these libraries.
Comment 1 Georgy Yakovlev archtester gentoo-dev 2018-02-01 04:51:14 UTC
Can confirm.
Just run a depclean and here the breakage list for my system.

!!! existing preserved libs:
>>> package: net-libs/http-parser-2.6.2
 *  - /usr/lib64/libhttp_parser.so.2.6.2
 *      used by /usr/bin/cargo (dev-lang/rust-1.23.0-r1)
 *      used by /usr/bin/cargo-ebuild (app-portage/cargo-ebuild-0.1.4)
 *      used by /usr/bin/exa (sys-apps/exa-0.8.0)
 *      used by /usr/bin/rls (dev-lang/rust-1.23.0-r1)
>>> package: net-libs/libssh2-1.7.0
 *  - /usr/lib64/libssh2.so.1
 *  - /usr/lib64/libssh2.so.1.0.1
 *      used by /usr/bin/cargo (dev-lang/rust-1.23.0-r1)
 *      used by /usr/bin/cargo-ebuild (app-portage/cargo-ebuild-0.1.4)
 *      used by /usr/bin/rls (dev-lang/rust-1.23.0-r1)
Comment 2 Georgy Yakovlev archtester gentoo-dev 2018-02-01 05:44:19 UTC
After rebuilding rust and broken packages everything is fine. so it looks like it  links to the libraries.
Comment 3 Martin Väth 2018-02-01 14:48:12 UTC
Finally, I managed to recompile rust.

(For some strange reason, compilation always had failed with some path issues - it was not bug 646092, because I had tried with MAKEOPTS="" - but now after some emerge --sync it suddenly works again...)

Now I finally can confirm that it is indeed an automagic dependency:
If rust is compiled with libssh2 (or http-parser) being installed, it will link against the corresponding libraries, otherwise it will not link against them.

(And it is indeed the binaries mentioned by Georgy which link against the libraries, not the rustc binary as one might misunderstand from my first posting).
Comment 4 Martin Väth 2018-04-08 16:25:40 UTC
The libssh2 dependency appears to be really optional:

src/tools/cargo/src/doc/book/src/reference/build-scripts.md:

* It has an optional dependency on libssh2 on all platforms to implement the ssh
  transport.


In contrast, the http-dependency appears not to be optional:

src/vendor/libgit2-sys/libgit2/CMakeLists.txt:

"http-parser version 2 was not found; using bundled 3rd-party sources."

So to avoid bundling, it seems that http-parser dependency should be added.
Comment 5 tt_1 2018-04-15 13:39:53 UTC
Today there was an update of net-libs/http-parser, portage doesn't force to rebuild either cargo or rust-bin on my system. Which is why I skipped the update for the moment - but will it break silently both cargo and the rust-bin package? I can handle cargo, bot it could be difficult to rebuild the rust-bin package?
Comment 6 Dirkjan Ochtman (RETIRED) gentoo-dev 2018-08-11 11:40:49 UTC
This has been fixed in recent versions.
Comment 7 orbea 2023-05-03 18:26:06 UTC
It seems as of dev-lang/rust-1.69.0-r1 it still doesn't use the system version of libssh2 which can be enabled by exporting 'LIBSSH2_SYS_USE_PKG_CONFIG=1'.