Revert "Don't rely on unstable flags."

This reverts commit f9e6e8dd78. We should
`export CARGO_TARGET_DIR`, otherwise subsequent `cargo` calls will
rebuild everything (because they won't find the target dir).
This commit is contained in:
Nicolas Mattia 2021-08-23 10:26:39 +02:00
parent f9e6e8dd78
commit df71f5e4ba

View file

@ -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 <OPTS>`. These options
# can be accessed during the build through the environment variable
# `cargo_build_options`. <br/>
# 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.<br/>
# Note: these values are not (shell) escaped, meaning that you can use
# environment variables but must be careful when introducing e.g. spaces. <br/>
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. <br/>
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;