From df71f5e4babda41cd919a8684b72218e2e809fa9 Mon Sep 17 00:00:00 2001 From: Nicolas Mattia Date: Mon, 23 Aug 2021 10:26:39 +0200 Subject: [PATCH] Revert "Don't rely on unstable flags." This reverts commit f9e6e8dd784f2a5882bb5cf2b27b79a9cc60858d. We should `export CARGO_TARGET_DIR`, otherwise subsequent `cargo` calls will rebuild everything (because they won't find the target dir). --- config.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.nix b/config.nix index bc9b163..7d3f57c 100644 --- a/config.nix +++ b/config.nix @@ -28,18 +28,18 @@ let # The command to use for the build. cargoBuild = allowFun attrs0 "cargoBuild" - ''env CARGO_TARGET_DIR=out cargo $cargo_options build $cargo_build_options >> $cargo_build_output_json''; + ''cargo $cargo_options build $cargo_build_options >> $cargo_build_output_json''; # Options passed to cargo build, i.e. `cargo build `. These options # can be accessed during the build through the environment variable # `cargo_build_options`.
- # Note: naersk relies on the the + # Note: naersk relies on the `--out-dir out` option and the # `--message-format` option. The `$cargo_message_format` variable is set # based on the cargo version.
# Note: these values are not (shell) escaped, meaning that you can use # environment variables but must be careful when introducing e.g. spaces.
cargoBuildOptions = - allowFun attrs0 "cargoBuildOptions" [ "$cargo_release" ''-j "$NIX_BUILD_CORES"'' "--message-format=$cargo_message_format" ]; + allowFun attrs0 "cargoBuildOptions" [ "$cargo_release" ''-j "$NIX_BUILD_CORES"'' "--out-dir" "out" "--message-format=$cargo_message_format" ]; # When `true`, rustc remaps the (`/nix/store`) source paths to `/sources` @@ -71,7 +71,7 @@ let # Note: these values are not (shell) escaped, meaning that you can use # environment variables but must be careful when introducing e.g. spaces.
cargoOptions = - allowFun attrs0 "cargoOptions" [ ]; + allowFun attrs0 "cargoOptions" [ "-Z" "unstable-options" ]; # When true, `cargo doc` is run and a new output `doc` is generated. doDoc = attrs0.doDoc or false;