Summary: | [TRACKER] cargo.eclass and *-sys crates | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Georgy Yakovlev <gyakovlev> |
Component: | Current packages | Assignee: | Gentoo Rust Project <rust> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | cyber+gentoo, flow, jstein, kentnl, lo48576, navi, O01eg, randy, sam |
Priority: | Normal | Keywords: | Tracker |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 695844, 730252, 730254, 732222 | ||
Bug Blocks: |
Description
Georgy Yakovlev
2020-02-14 03:28:03 UTC
Given what I've seen with similar things in Perl space, I'd think it pertinent in some cases to have a USE="system-foo" flag in various places, and then: - If the use is not specified, *always* use the bundled copy - If the use is specified, *always* use the system copy Partly because the system dependency can change not only A[B]I, but A[P]I, and as a result, can break tests, and dependent logic. And then we can set the default USE to whatever is the most reliable, and allow puritans to flip the system- flag if they'd rather. Also, the API dependency can be a very narrow version range ( eg: an == dep ), and this can severely mess up portage's capacity to handle things. And ... to make matters worse, there can be a known minimum version at the time of publication, but the maximum supported version might not be known until much, much later. ( Making == over-specific, but > underspecific ) know crates to use bundled lib by default unless instructed to use system one: > libgit2-sys // dev-libs/libgit2-0.99:= requires setting export PKG_CONFIG_ALLOW_CROSS=1 and export LIBGIT2_SYS_USE_PKG_CONFIG=1 to force usage of system version for quite a long time used private apis from git version, not available in 0.28 yet. slot 0/1.0 is fine with current crate versions. > libssh2-sys // net-libs/libssh2:= export LIBSSH2_SYS_USE_PKG_CONFIG=1 PKG_CONFIG_ALLOW_CROSS=1 > jemalloc-sys-0.3.2 // >=dev-libs/jemalloc-5.1.0:= || comes with jemallocator crate requires setting > use elibc_musl || export JEMALLOC_OVERRIDE="${ESYSROOT}/usr/$(get_libdir)/libjemalloc.so" another one is oniguruma-sys. will update sys-apps/bat to use system version and will update details here how to do it properly. another point about -sys crates -lto flags will produce a falure. see bugs #730252 #730254 > export RUSTONIG_SYSTEM_LIBONIG=1
was required for onig-sys to use system library in sys-apps/bat
another offender, serious one
openssl-sys
sometimes needs
> export OPENSSL_NO_VENDOR=true
to stop compiling private copy
(In reply to Georgy Yakovlev from comment #4) > another point about -sys crates > > -lto flags will produce a falure. > see bugs #730252 #730254 Is there common way or recommended Gentoo way to avoid LTO (especially `CFLAGS=-flto`) issues? I think `CFLAGS+=-fno-lto` is possible workaround, but is it recommended to prepare `USE=system-foo`? -------- Other packages (I'm the maintainer of these ebuilds) that fail to compile due to (maybe) LTO: - media-gfx/oxipng-5.0.1::guru (#860063) + Fails with `CFLAGS=-flto`, and compiles with `CFLAGS=-fno-lto`. + `libdeflate-sys` crate? - media-gfx/silicon-0.4.3::guru (#860069) + Fails with `CFLAGS=-flto`, and compiles with `CFLAGS=-fno-lto`. + `onig_sys` crate? And the below (not by me) also seems to fail with the same reasons: - dev-util/cargo-audit-0.17.0 (#858323) + `libgit2-sys` crate? - dev-util/cargo-c-0.9.9 (#858329) + `libgit2-sys` crate? - dev-util/cargo-ebuild-0.5.1 (#858332) + `libgit2-sys` crate? Setting LIBGIT2_SYS_USE_PKG_CONFIG=1 to force the system library for libgit2-sys is no longer necessary since libgit2-sys-0.12.2. Having a library installed which satisfies the version range (>=1.6.4 <1.7 as of 06-2023) suffices. <zstd-sys-2.0.7 > --feature "pkg-config" zstd-sys-2.0.7 and up > --feature "pkg-config" || export ZSTD_SYS_USE_PKG_CONFIG=1 I've put some workarounds on the wiki for visibility. https://wiki.gentoo.org/wiki/Writing_Rust_ebuilds#Unbundling_C_libraries |