buildRustCrate: editorconfig fixes

zowoq 1439eaf0 debf9a3f

+13 -13
+1 -1
pkgs/build-support/rust/build-rust-crate/build-crate.nix
··· 38 38 build_bin = if buildTests then "build_bin_test" else "build_bin"; 39 39 in '' 40 40 runHook preBuild 41 - 41 + 42 42 # configure & source common build functions 43 43 LIB_RUSTC_OPTS="${libRustcOpts}" 44 44 BIN_RUSTC_OPTS="${binRustcOpts}"
+2 -2
pkgs/build-support/rust/build-rust-crate/configure-crate.nix
··· 43 43 noisily cd "${workspace_member}" 44 44 ''} 45 45 ${lib.optionalString (workspace_member == null) '' 46 - echo_colored "Searching for matching Cargo.toml (${crateName})" 46 + echo_colored "Searching for matching Cargo.toml (${crateName})" 47 47 local cargo_toml_dir=$(matching_cargo_toml_dir "${crateName}") 48 48 if [ -z "$cargo_toml_dir" ]; then 49 49 echo_error "ERROR configuring ${crateName}: No matching Cargo.toml in $(pwd) found." >&2 ··· 53 53 ''} 54 54 55 55 runHook preConfigure 56 - 56 + 57 57 symlink_dependency() { 58 58 # $1 is the nix-store path of a dependency 59 59 # $2 is the target path
+3 -3
pkgs/build-support/rust/build-rust-crate/lib.sh
··· 153 153 # is referenced there. 154 154 cargo metadata --no-deps --format-version 1 \ 155 155 --manifest-path "$manifest_path" \ 156 - | jq -r '.packages[] 157 - | select( .name == "'$expected_crate_name'") 156 + | jq -r '.packages[] 157 + | select( .name == "'$expected_crate_name'") 158 158 | .manifest_path' 159 159 } 160 160 ··· 171 171 break 172 172 fi 173 173 done 174 - } 174 + }
+7 -7
pkgs/build-support/rust/build-rust-crate/log.nix
··· 1 1 { lib }: 2 2 3 3 let echo_colored_body = start_escape: 4 - # Body of a function that behaves like "echo" but 4 + # Body of a function that behaves like "echo" but 5 5 # has the output colored by the given start_escape 6 6 # sequence. E.g. 7 7 # 8 8 # * echo_x "Building ..." 9 9 # * echo_x -n "Running " 10 10 # 11 - # This is more complicated than apparent at first sight 11 + # This is more complicated than apparent at first sight 12 12 # because: 13 13 # * The color markers and the text must be print 14 14 # in the same echo statement. Otherise, other 15 - # intermingled text from concurrent builds will 15 + # intermingled text from concurrent builds will 16 16 # be colored as well. 17 17 # * We need to preserve the trailing newline of the 18 18 # echo if and only if it is present. Bash likes 19 19 # to strip those if we capture the output of echo 20 - # in a variable. 20 + # in a variable. 21 21 # * Leading "-" will be interpreted by test as an 22 22 # option for itself. Therefore, we prefix it with 23 23 # an x in `[[ "x$1" =~ ^x- ]]`. ··· 27 27 echo_args+=" $1" 28 28 shift 29 29 done 30 - 30 + 31 31 local start_escape="$(printf '${start_escape}')" 32 32 local reset="$(printf '\033[0m')" 33 33 echo $echo_args $start_escape"$@"$reset 34 34 ''; 35 35 echo_conditional_colored_body = colors: start_escape: 36 - if colors == "always" 36 + if colors == "always" 37 37 then (echo_colored_body start_escape) 38 38 else ''echo "$@"''; 39 39 in { ··· 50 50 noisily = colors: verbose: '' 51 51 noisily() { 52 52 ${lib.optionalString verbose '' 53 - echo_colored -n "Running " 53 + echo_colored -n "Running " 54 54 echo $@ 55 55 ''} 56 56 $@