summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorGeorgy Yakovlev <gyakovlev@gentoo.org>2019-12-26 18:22:27 -0800
committerGeorgy Yakovlev <gyakovlev@gentoo.org>2019-12-27 20:59:10 -0800
commita1768659e4bd697a2d45e8342e8c122380905e7a (patch)
tree9298dc3437d61f37d55ee1d60212af7d8785553c /eclass
parentcargo.eclass: move jobs configuration to generated configfile (diff)
downloadgentoo-a1768659e4bd697a2d45e8342e8c122380905e7a.tar.gz
gentoo-a1768659e4bd697a2d45e8342e8c122380905e7a.tar.bz2
gentoo-a1768659e4bd697a2d45e8342e8c122380905e7a.zip
cargo.eclass: make cargo verbosity configurable
Users can set CARGO_TERM_VERBOSE=false in make.conf if less build output is desired. Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/cargo.eclass18
1 files changed, 14 insertions, 4 deletions
diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index f26495fc19c8..d0288ed2edc9 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -125,7 +125,14 @@ cargo_live_src_unpack() {
# @FUNCTION: cargo_gen_config
# @DESCRIPTION:
-# Generate the $CARGO_HOME/config necessary to use our local registry
+# Generate the $CARGO_HOME/config necessary to use our local registry and settings.
+# Cargo can also be configured through environment variables in addition to the TOML syntax below.
+# For each configuration key below of the form foo.bar the environment variable CARGO_FOO_BAR
+# can also be used to define the value.
+# Environment variables will take precedent over TOML configuration,
+# and currently only integer, boolean, and string keys are supported.
+# For example the build.jobs key can also be defined by CARGO_BUILD_JOBS.
+# Or setting CARGO_TERM_VERBOSE=false in make.conf will make build quieter.
cargo_gen_config() {
debug-print-function ${FUNCNAME} "$@"
@@ -142,6 +149,9 @@ cargo_gen_config() {
[build]
jobs = $(makeopts_jobs)
+
+ [term]
+ verbose = true
EOF
}
@@ -153,7 +163,7 @@ cargo_src_compile() {
export CARGO_HOME="${ECARGO_HOME}"
- cargo build -vv $(usex debug "" --release) "$@" \
+ cargo build $(usex debug "" --release) "$@" \
|| die "cargo build failed"
}
@@ -163,7 +173,7 @@ cargo_src_compile() {
cargo_src_install() {
debug-print-function ${FUNCNAME} "$@"
- cargo install -vv --path ${CARGO_INSTALL_PATH} \
+ cargo install --path ${CARGO_INSTALL_PATH} \
--root="${ED}/usr" $(usex debug --debug "") "$@" \
|| die "cargo install failed"
rm -f "${ED}/usr/.crates.toml"
@@ -177,7 +187,7 @@ cargo_src_install() {
cargo_src_test() {
debug-print-function ${FUNCNAME} "$@"
- cargo test -vv $(usex debug "" --release) "$@" \
+ cargo test $(usex debug "" --release) "$@" \
|| die "cargo test failed"
}