-
|
I've looked at the cargoFmt command, but I am not sure how to get it to run. Did someone get it to work yet? I understand its a bit more 'difficult' because of the extra toolchain because miri is nightly only? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
|
I haven't used
I did notice that the miri README mentioned: Not sure if this means miri needs to install its own additional components from the network the first time it runs. It would be interesting if they could be packaged up for general Nix consumption if that's the case... |
Beta Was this translation helpful? Give feedback.
-
|
Alright! I got it working with the following steps:
unstableRustTarget = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override {
extensions = [ "rust-src" "miri" ];
});
|
Beta Was this translation helpful? Give feedback.
-
|
For anyone looking to do this now that miri no longer uses checks.miri = craneLib.mkCargoDerivation (
craneConfig # base config, with `src`, `cargoArtifacts`, etc.
// {
name = "miri-tests";
buildPhaseCargoCommand = ''
# test with miri
cargo miri run ...
'';
doInstallCargoArtifacts = false;
MIRI_SYSROOT = craneLib.mkCargoDerivation {
pname = "miri-sysroot";
version = "0.0.0";
dontUnpack = true;
buildPhaseCargoCommand = ''
MIRI_SYSROOT=$out cargo miri setup
'';
dontFixup = true;
cargoLock =
pkgs.runCommand "sysroot-cargoLock"
{ nativeBuildInputs = [ rustToolchain ]; }
''
cp `rustc --print sysroot`/lib/rustlib/src/rust/library/Cargo.lock $out
'';
cargoArtifacts = null;
};
}
); |
Beta Was this translation helpful? Give feedback.
For anyone looking to do this now that miri no longer uses
xargo, I was able to get it working with the following: