summaryrefslogtreecommitdiff
path: root/nix/miri.nix
blob: 5a8c39d85e6ca07cd209d2d382846769a0ed2675 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{ fenix, pkgs }:

let
  rust-nightly-toolchain = fenix.combine [
    fenix.latest.cargo
    fenix.latest.rustc
    fenix.latest.clippy
    fenix.latest.miri
  ];
in
pkgs.writeShellApplication {
  name = "cargo-miri";
  runtimeInputs = [ rust-nightly-toolchain ];
  text = ''
    set -x
    # https://github.com/proptest-rs/proptest/issues/253#issuecomment-1850534278
    : "''${PROPTEST_DISABLE_FAILURE_PERSISTENCE:=true}"
    : "''${MIRIFLAGS:=-Zmiri-env-forward=PROPTEST_DISABLE_FAILURE_PERSISTENCE}"
    export PROPTEST_DISABLE_FAILURE_PERSISTENCE MIRIFLAGS
    exec cargo "$@"
  '';
}