buildRustCrate: editorconfig fixes

This commit is contained in:
zowoq 2020-08-09 17:47:12 +10:00
parent debf9a3f0b
commit 1439eaf07b
4 changed files with 13 additions and 13 deletions

View file

@ -38,7 +38,7 @@
build_bin = if buildTests then "build_bin_test" else "build_bin";
in ''
runHook preBuild
# configure & source common build functions
LIB_RUSTC_OPTS="${libRustcOpts}"
BIN_RUSTC_OPTS="${binRustcOpts}"

View file

@ -43,7 +43,7 @@ in ''
noisily cd "${workspace_member}"
''}
${lib.optionalString (workspace_member == null) ''
echo_colored "Searching for matching Cargo.toml (${crateName})"
echo_colored "Searching for matching Cargo.toml (${crateName})"
local cargo_toml_dir=$(matching_cargo_toml_dir "${crateName}")
if [ -z "$cargo_toml_dir" ]; then
echo_error "ERROR configuring ${crateName}: No matching Cargo.toml in $(pwd) found." >&2
@ -53,7 +53,7 @@ in ''
''}
runHook preConfigure
symlink_dependency() {
# $1 is the nix-store path of a dependency
# $2 is the target path

View file

@ -153,8 +153,8 @@ matching_cargo_toml_path() {
# is referenced there.
cargo metadata --no-deps --format-version 1 \
--manifest-path "$manifest_path" \
| jq -r '.packages[]
| select( .name == "'$expected_crate_name'")
| jq -r '.packages[]
| select( .name == "'$expected_crate_name'")
| .manifest_path'
}
@ -171,4 +171,4 @@ matching_cargo_toml_dir() {
break
fi
done
}
}

View file

@ -1,23 +1,23 @@
{ lib }:
let echo_colored_body = start_escape:
# Body of a function that behaves like "echo" but
# Body of a function that behaves like "echo" but
# has the output colored by the given start_escape
# sequence. E.g.
#
# * echo_x "Building ..."
# * echo_x -n "Running "
#
# This is more complicated than apparent at first sight
# This is more complicated than apparent at first sight
# because:
# * The color markers and the text must be print
# in the same echo statement. Otherise, other
# intermingled text from concurrent builds will
# intermingled text from concurrent builds will
# be colored as well.
# * We need to preserve the trailing newline of the
# echo if and only if it is present. Bash likes
# to strip those if we capture the output of echo
# in a variable.
# in a variable.
# * Leading "-" will be interpreted by test as an
# option for itself. Therefore, we prefix it with
# an x in `[[ "x$1" =~ ^x- ]]`.
@ -27,13 +27,13 @@ let echo_colored_body = start_escape:
echo_args+=" $1"
shift
done
local start_escape="$(printf '${start_escape}')"
local reset="$(printf '\033[0m')"
echo $echo_args $start_escape"$@"$reset
'';
echo_conditional_colored_body = colors: start_escape:
if colors == "always"
if colors == "always"
then (echo_colored_body start_escape)
else ''echo "$@"'';
in {
@ -50,7 +50,7 @@ in {
noisily = colors: verbose: ''
noisily() {
${lib.optionalString verbose ''
echo_colored -n "Running "
echo_colored -n "Running "
echo $@
''}
$@