]> git.lizzy.rs Git - rust.git/commitdiff
Merge from rustc
authorRalf Jung <post@ralfj.de>
Tue, 15 Nov 2022 08:14:47 +0000 (09:14 +0100)
committerRalf Jung <post@ralfj.de>
Tue, 15 Nov 2022 08:14:55 +0000 (09:14 +0100)
1  2 
src/tools/miri/README.md
src/tools/miri/cargo-miri/src/setup.rs
src/tools/miri/rust-version

index 939d7b19fa978cc7efcbd837f9aee34c1c09eb8d,1185525f6865c33cd3a3d8a3d2a2731c45209e92..e9738cbc515ff7028652b2ec0c415249e793335d
@@@ -432,12 -432,12 +432,14 @@@ Moreover, Miri recognizes some environm
    must point to the `library` subdirectory of a `rust-lang/rust` repository
    checkout. Note that changing files in that directory does not automatically
    trigger a re-build of the standard library; you have to clear the Miri build
 -  cache manually (on Linux, `rm -rf ~/.cache/miri`).
 +  cache manually (on Linux, `rm -rf ~/.cache/miri`;
 +  on Windows, `rmdir /S "%LOCALAPPDATA%\rust-lang\miri\cache"`;
 +  and on macOS, `rm -rf ~/Library/Caches/org.rust-lang.miri`).
  * `MIRI_SYSROOT` (recognized by `cargo miri` and the Miri driver) indicates the sysroot to use. When
-   using `cargo miri`, only set this if you do not want to use the automatically created sysroot. For
-   directly invoking the Miri driver, this variable (or a `--sysroot` flag) is mandatory.
+   using `cargo miri`, this skips the automatic setup -- only set this if you do not want to use the
+   automatically created sysroot. For directly invoking the Miri driver, this variable (or a
+   `--sysroot` flag) is mandatory. When invoking `cargo miri setup`, this indicates where the sysroot
+   will be put.
  * `MIRI_TEST_TARGET` (recognized by the test suite and the `./miri` script) indicates which target
    architecture to test against.  `miri` and `cargo miri` accept the `--target` flag for the same
    purpose.
index eb7d6b38a9e75251ac13524595b4d74aabef9ec6,f3841a6140839cfaae10242bbbf3f0bf9259e40c..9c179e82ba1370fe3c758a366fbac01e68a5b44a
@@@ -105,16 -106,15 +108,16 @@@ pub fn setup(subcommand: &MiriCommand, 
              command.stdout(process::Stdio::null());
              command.stderr(process::Stdio::null());
          }
 -        // Disable debug assertions in the standard library -- Miri is already slow enough.
 -        // But keep the overflow checks, they are cheap. This completely overwrites flags
 -        // the user might have set, which is consistent with normal `cargo build` that does
 -        // not apply `RUSTFLAGS` to the sysroot either.
 -        let rustflags = vec!["-Cdebug-assertions=off".into(), "-Coverflow-checks=on".into()];
 -        (command, rustflags)
 +
 +        command
      };
 +    // Disable debug assertions in the standard library -- Miri is already slow enough.
 +    // But keep the overflow checks, they are cheap. This completely overwrites flags
 +    // the user might have set, which is consistent with normal `cargo build` that does
 +    // not apply `RUSTFLAGS` to the sysroot either.
 +    let rustflags = &["-Cdebug-assertions=off", "-Coverflow-checks=on"];
      // Make sure all target-level Miri invocations know their sysroot.
-     std::env::set_var("MIRI_SYSROOT", sysroot_dir);
+     std::env::set_var("MIRI_SYSROOT", &sysroot_dir);
  
      // Do the build.
      if only_setup {
          // We want to be quiet, but still let the user know that something is happening.
          eprint!("Preparing a sysroot for Miri (target: {target})... ");
      }
-     SysrootBuilder::new(sysroot_dir, target)
 -    Sysroot::new(&sysroot_dir, target)
 -        .build_from_source(&rust_src, BuildMode::Check, sysroot_config, rustc_version, cargo_cmd)
++    SysrootBuilder::new(&sysroot_dir, target)
 +        .build_mode(BuildMode::Check)
 +        .rustc_version(rustc_version.clone())
 +        .sysroot_config(sysroot_config)
 +        .rustflags(rustflags)
 +        .cargo(cargo_cmd)
 +        .build_from_source(&rust_src)
          .unwrap_or_else(|_| {
              if only_setup {
                  show_error!("failed to build sysroot, see error details above")
index cdf1a5470ce396b079765a2a11150bcbfb6f551e,13492d183c99996c2a0c100fa8a45d270130c327..746fcb2e183c656781a766a8266d4207113f666e
@@@ -1,1 -1,1 +1,1 @@@
- 11fa0850f03ae49fe1053a21bcdcf8a301668ad8
 -b03502b35d111bef0399a66ab3cc765f0802e8ba
++101e1822c3e54e63996c8aaa014d55716f3937eb