Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 716690 - sys-apps/fd-7.5.0 fails to compile due to ESYSROOT instead of EROOT used in ebuild
Summary: sys-apps/fd-7.5.0 fails to compile due to ESYSROOT instead of EROOT used in e...
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Prefix
Depends on:
Reported: 2020-04-08 12:12 UTC by Marcin
Modified: 2021-01-21 16:27 UTC (History)
3 users (show)

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


Note You need to log in before you can comment on or make changes to this bug.
Description Marcin 2020-04-08 12:12:56 UTC
sys-apps/fd-7.5.0 wants from the main OS (e.g. /usr/lib64/ because fd-7.5.0.ebuild contains ${ESYSROOT} instead of ${EROOT}.

Suggested patch:


--- ~/gentoo/var/db/repos/gentoo/sys-apps/fd/fd-7.5.0.ebuild.orig    2020-04-08 12:10:45.388738270 -0000
+++ ~/gentoo/var/db/repos/gentoo/sys-apps/fd/fd-7.5.0.ebuild 2020-04-08 12:11:00.773507481 -0000
@@ -85,7 +85,7 @@
 src_compile() {
        export SHELL_COMPLETIONS_DIR="${T}/shell_completions"
        # this enables to build with system jemallloc, but musl targets do not use it at all
-       use elibc_musl || export JEMALLOC_OVERRIDE="${ESYSROOT}/usr/$(get_libdir)/"
+       use elibc_musl || export JEMALLOC_OVERRIDE="${EROOT}/usr/$(get_libdir)/"


Without the patch, the following error happens if jemalloc is not installed on the main system:


   Compiling jemalloc-sys v0.3.2
     Running `rustc --crate-name build_script_build /home/marcin/gentoo/var/tmp/portage/sys-apps/fd-7.5.0/work/cargo_home/gentoo/jemalloc-sys-0.3.2/ --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -C codegen-units=1 --cfg 'feature="background_threads_runtime_support"' -C metadata=7e334fe11f076
5f3 -C extra-filename=-7e334fe11f0765f3 --out-dir /home/marcin/gentoo/var/tmp/portage/sys-apps/fd-7.5.0/work/fd-7.5.0/target/release/build/jemalloc-sys-7e334fe11f0765f3 -L dependency=/home/marcin/gentoo/var/tmp/portage/sys-apps/fd-7.5.0/work/fd-7.5.0/target/release/deps --extern cc=/home/marcin/gentoo/var/tmp/portage/sys-apps/fd-7.5.0/work/fd-7.5.0/target/r
elease/deps/libcc-91a7b2ebf1098d6b.rlib --extern fs_extra=/home/marcin/gentoo/var/tmp/portage/sys-apps/fd-7.5.0/work/fd-7.5.0/target/release/deps/libfs_extra-ab66b19d38ad8fcf.rlib --cap-lints allow`

     Running `/home/marcin/gentoo/var/tmp/portage/sys-apps/fd-7.5.0/work/fd-7.5.0/target/release/build/jemalloc-sys-7e334fe11f0765f3/build-script-build`
error: failed to run custom build command for `jemalloc-sys v0.3.2`

Caused by:
  process didn't exit successfully: `/home/marcin/gentoo/var/tmp/portage/sys-apps/fd-7.5.0/work/fd-7.5.0/target/release/build/jemalloc-sys-7e334fe11f0765f3/build-script-build` (exit code: 101)
--- stdout
jemalloc override set

--- stderr
thread 'main' panicked at 'Path to `jemalloc` in `JEMALLOC_OVERRIDE=/usr/lib64/` does not exist', /home/marcin/gentoo/var/tmp/portage/sys-apps/fd-7.5.0/work/cargo_home/gentoo/jemalloc-sys-0.3.2/
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed
 * ERROR: sys-apps/fd-7.5.0::gentoo failed (compile phase):
 *   cargo build failed
 * Call stack:
 *, line  125:  Called src_compile
 *   environment, line 1323:  Called cargo_src_compile
 *   environment, line  498:  Called die
 * The specific snippet of code:
 *       cargo build $(usex debug "" --release) "$@" || die "cargo build failed"
 * If you need support, post the output of `emerge --info '=sys-apps/fd-7.5.0::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-apps/fd-7.5.0::gentoo'`.
 * The complete build log is located at '/home/marcin/gentoo/var/tmp/portage/sys-apps/fd-7.5.0/temp/build.log'.
 * The ebuild environment file is located at '/home/marcin/gentoo/var/tmp/portage/sys-apps/fd-7.5.0/temp/environment'.
 * Working directory: '/home/marcin/gentoo/var/tmp/portage/sys-apps/fd-7.5.0/work/fd-7.5.0'
 * S: '/home/marcin/gentoo/var/tmp/portage/sys-apps/fd-7.5.0/work/fd-7.5.0'



Reproducible: Always

Steps to Reproduce:
1. Make sure you do not have jemalloc dynamic lib in the main system: e.g. mv  /usr/lib64/{,.bak}
2. emerge -v =sys-apps/fd-7.5.0
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-12-20 12:08:51 UTC
EROOT is not the correct fix, it is not to be used in src_compile:

ESYSROOT seems like the correct variable here. It's prefixed and it is where DEPEND-category packages should be installed:
Comment 2 Fabian Groffen gentoo-dev 2021-01-21 16:27:05 UTC
JEMALLOC_OVERRIDE=/usr/lib64/ seems to suggest ESYSROOT is not set, is the ebuild using a correct EAPI?