]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #50709 - alexcrichton:revert-musl, r=sfackler
authorbors <bors@rust-lang.org>
Sat, 19 May 2018 03:10:53 +0000 (03:10 +0000)
committerbors <bors@rust-lang.org>
Sat, 19 May 2018 03:10:53 +0000 (03:10 +0000)
Revert #50105 until regression is fixed

Discovered at https://github.com/rust-lang/rust/pull/50105#issuecomment-388630750 it looks like this caused a regression with i686 musl, so let's revert in the meantime while a fix is worked out

1  2 
src/bootstrap/bin/rustc.rs
src/bootstrap/builder.rs
src/tools/compiletest/src/runtest.rs

index 4607ca5cf9f48e72b32672d424f97c48399c2e6c,3f97accaa4d84088ecbd8524e359d653dda4aa6c..6f27402233f987e617b61df7cdb3305afa652348
@@@ -268,15 -268,6 +268,6 @@@ fn main() 
          if let Ok(host_linker) = env::var("RUSTC_HOST_LINKER") {
              cmd.arg(format!("-Clinker={}", host_linker));
          }
-         if let Ok(s) = env::var("RUSTC_HOST_CRT_STATIC") {
-             if s == "true" {
-                 cmd.arg("-C").arg("target-feature=+crt-static");
-             }
-             if s == "false" {
-                 cmd.arg("-C").arg("target-feature=-crt-static");
-             }
-         }
      }
  
      if env::var_os("RUSTC_PARALLEL_QUERIES").is_some() {
      }
  
      if verbose > 1 {
 -        eprintln!("rustc command: {:?}", cmd);
 +        eprintln!(
 +            "rustc command: {:?}={:?} {:?}",
 +            bootstrap::util::dylib_path_var(),
 +            env::join_paths(&dylib_path).unwrap(),
 +            cmd,
 +        );
          eprintln!("sysroot: {:?}", sysroot);
          eprintln!("libdir: {:?}", libdir);
      }
diff --combined src/bootstrap/builder.rs
index cd646b76e832e980b13de2110543a93e76c8dd86,c482adbb390790a6ef3a35507f5739c6ac626330..84d294006693138f4516c260c8a073c972b0cfc7
@@@ -584,10 -584,11 +584,10 @@@ impl<'a> Builder<'a> 
              cargo.env("RUST_CHECK", "1");
          }
  
 -        // If we were invoked from `make` then that's already got a jobserver
 -        // set up for us so no need to tell Cargo about jobs all over again.
 -        if env::var_os("MAKEFLAGS").is_none() && env::var_os("MFLAGS").is_none() {
 -             cargo.arg("-j").arg(self.jobs().to_string());
 -        }
 +        cargo.arg("-j").arg(self.jobs().to_string());
 +        // Remove make-related flags to ensure Cargo can correctly set things up
 +        cargo.env_remove("MAKEFLAGS");
 +        cargo.env_remove("MFLAGS");
  
          // FIXME: Temporary fix for https://github.com/rust-lang/cargo/issues/3005
          // Force cargo to output binaries with disambiguating hashes in the name
              cargo.env("RUSTC_CRT_STATIC", x.to_string());
          }
  
-         if let Some(x) = self.crt_static(compiler.host) {
-             cargo.env("RUSTC_HOST_CRT_STATIC", x.to_string());
-         }
          // Enable usage of unstable features
          cargo.env("RUSTC_BOOTSTRAP", "1");
          self.add_rust_test_threads(&mut cargo);
@@@ -1460,7 -1457,6 +1456,7 @@@ mod __test 
              rustc_args: vec![],
              fail_fast: true,
              doc_tests: DocTests::No,
 +            bless: false,
          };
  
          let build = Build::new(config);
index 49d3dec0a58b29e23bcd379174d212d4b9ec5137,f46713441362b5a75be89309b0eeac011db6ed3b..140c90aaeacc13dca77768aa7e126665c9678fbf
@@@ -2502,7 -2502,7 +2502,7 @@@ impl<'test> TestCx<'test> 
                  .env("IS_WINDOWS", "1")
                  .env("MSVC_LIB", format!("'{}' -nologo", lib.display()))
                  .env("CC", format!("'{}' {}", self.config.cc, cflags))
-                 .env("CXX", format!("'{}'", &self.config.cxx));
+                 .env("CXX", &self.config.cxx);
          } else {
              cmd.env("CC", format!("{} {}", self.config.cc, self.config.cflags))
                  .env("CXX", format!("{} {}", self.config.cxx, self.config.cflags))
          }
  
          if errors > 0 {
 -            println!("To update references, run this command from build directory:");
 +            println!("To update references, rerun the tests and pass the `--bless` flag");
              let relative_path_to_file = self.testpaths
                  .relative_dir
                  .join(self.testpaths.file.file_name().unwrap());
              println!(
 -                "{}/update-references.sh '{}' '{}'",
 -                self.config.src_base.display(),
 -                self.config.build_base.display(),
 -                relative_path_to_file.display()
 +                "To only update this specific test, also pass `--test-args {}`",
 +                relative_path_to_file.display(),
              );
              self.fatal_proc_rec(
                  &format!("{} errors occurred comparing output.", errors),
              return 0;
          }
  
 -        if expected.is_empty() {
 -            println!("normalized {}:\n{}\n", kind, actual);
 -        } else {
 -            println!("diff of {}:\n", kind);
 -            let diff_results = make_diff(expected, actual, 3);
 -            for result in diff_results {
 -                let mut line_number = result.line_number;
 -                for line in result.lines {
 -                    match line {
 -                        DiffLine::Expected(e) => {
 -                            println!("-\t{}", e);
 -                            line_number += 1;
 -                        }
 -                        DiffLine::Context(c) => {
 -                            println!("{}\t{}", line_number, c);
 -                            line_number += 1;
 -                        }
 -                        DiffLine::Resulting(r) => {
 -                            println!("+\t{}", r);
 +        if !self.config.bless {
 +            if expected.is_empty() {
 +                println!("normalized {}:\n{}\n", kind, actual);
 +            } else {
 +                println!("diff of {}:\n", kind);
 +                let diff_results = make_diff(expected, actual, 3);
 +                for result in diff_results {
 +                    let mut line_number = result.line_number;
 +                    for line in result.lines {
 +                        match line {
 +                            DiffLine::Expected(e) => {
 +                                println!("-\t{}", e);
 +                                line_number += 1;
 +                            }
 +                            DiffLine::Context(c) => {
 +                                println!("{}\t{}", line_number, c);
 +                                line_number += 1;
 +                            }
 +                            DiffLine::Resulting(r) => {
 +                                println!("+\t{}", r);
 +                            }
                          }
                      }
 +                    println!("");
                  }
 -                println!("");
              }
          }
  
              .with_extra_extension(mode)
              .with_extra_extension(kind);
  
 -        match File::create(&output_file).and_then(|mut f| f.write_all(actual.as_bytes())) {
 -            Ok(()) => {}
 -            Err(e) => self.fatal(&format!(
 -                "failed to write {} to `{}`: {}",
 +        let mut files = vec![output_file];
 +        if self.config.bless {
 +            files.push(expected_output_path(
 +                self.testpaths,
 +                self.revision,
 +                &self.config.compare_mode,
                  kind,
 -                output_file.display(),
 -                e
 -            )),
 +            ));
 +        }
 +
 +        for output_file in &files {
 +            if actual.is_empty() {
 +                if let Err(e) = ::std::fs::remove_file(output_file) {
 +                    self.fatal(&format!(
 +                        "failed to delete `{}`: {}",
 +                        output_file.display(),
 +                        e,
 +                    ));
 +                }
 +            } else {
 +                match File::create(&output_file).and_then(|mut f| f.write_all(actual.as_bytes())) {
 +                    Ok(()) => {}
 +                    Err(e) => self.fatal(&format!(
 +                        "failed to write {} to `{}`: {}",
 +                        kind,
 +                        output_file.display(),
 +                        e
 +                    )),
 +                }
 +            }
          }
  
          println!("\nThe actual {0} differed from the expected {0}.", kind);
 -        println!("Actual {} saved to {}", kind, output_file.display());
 -        1
 +        for output_file in files {
 +            println!("Actual {} saved to {}", kind, output_file.display());
 +        }
 +        if self.config.bless {
 +            0
 +        } else {
 +            1
 +        }
      }
  
      fn create_stamp(&self) {