Skip to content

Commit

Permalink
Revert "Don't rely on unstable flags."
Browse files Browse the repository at this point in the history
This reverts commit f9e6e8d. We should
`export CARGO_TARGET_DIR`, otherwise subsequent `cargo` calls will
rebuild everything (because they won't find the target dir).
  • Loading branch information
nmattia committed Aug 23, 2021
1 parent f9e6e8d commit df71f5e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit df71f5e

Please sign in to comment.