improve miri wrapper

This commit is contained in:
Robin Appelman 2025-05-23 23:00:12 +02:00
commit 8f72fa46be

View file

@ -10,7 +10,7 @@
...
}: let
inherit (builtins) elem readFile pathExists match any concatLists;
inherit (lib) getExe map mkDefault mkIf mkMerge mkOption warnIf optionalAttrs types optionalString genAttrs hasInfix optionals;
inherit (lib) getExe map mkDefault mkIf mkMerge mkOption warnIf optionalAttrs types optionalString genAttrs hasInfix makeBinPath;
inherit (lib.fileset) fileFilter toSource unions;
inherit (flakelight.types) fileset function optFunctionTo;
@ -368,9 +368,23 @@ in
apps = {
cargo-miri,
cargo-semver-checks,
miriRustToolchain,
writeShellApplication,
...
}: {
miri = "${cargo-miri}/bin/cargo-miri";
} @ pkgs: let
deps =
(buildDeps pkgs).buildInputs
++ (buildDeps pkgs).nativeBuildInputs
++ [pkgs.stdenv.cc];
miriWrapped = writeShellApplication {
name = "cargo-miri";
runtimeInputs = [miriRustToolchain];
text = ''
PATH="$PATH:${makeBinPath deps}" cargo miri "$@"
'';
};
in {
miri = "${miriWrapped}/bin/cargo-miri";
semver-checks = "${cargo-semver-checks}/bin/cargo-semver-checks semver-checks";
};
})