Skip to content

Commit d3ae9a9

Browse files
committed
Auto merge of #48445 - Mark-Simulacrum:stable-next, r=alexcrichton
[stable] 1.24.1 stable release The includes the following commits: - 6a600f8: Fixes #48251, unwinding through FFI no longer aborts - cuviper@b445a52: Fixes #48308, fixing the error index generator - f8e00d0: Fixes #48318 by emitting UTF-16 output on MSVC targets. - 2a0af8c448: Bumps the version number to 1.24.1. - 93220f0f45: Release notes - 6031718d8836f95bbfeddfaa63f1ee1d66e53f26: Cargo TLS warnings on Windows.
2 parents 4d90ac3 + 9853d20 commit d3ae9a9

File tree

13 files changed

+86
-22
lines changed

13 files changed

+86
-22
lines changed

RELEASES.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
Version 1.24.1 (2018-03-01)
2+
==========================
3+
4+
- [Do not abort when unwinding through FFI][48251]
5+
- [Emit UTF-16 files for linker arguments on Windows][48318]
6+
- [Make the error index generator work again][48308]
7+
- [Cargo will warn on Windows 7 if an update is needed][cargo/5069].
8+
9+
[48251]: https://github.com/rust-lang/rust/issues/48251
10+
[48308]: https://github.com/rust-lang/rust/issues/48308
11+
[48318]: https://github.com/rust-lang/rust/issues/48318
12+
[cargo/5069]: https://github.com/rust-lang/cargo/pull/5069
13+
114
Version 1.24.0 (2018-02-15)
215
==========================
316

src/bootstrap/builder.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,8 @@ impl<'a> Builder<'a> {
484484
} else {
485485
PathBuf::from("/path/to/nowhere/rustdoc/not/required")
486486
})
487-
.env("TEST_MIRI", self.config.test_miri.to_string());
488-
487+
.env("TEST_MIRI", self.config.test_miri.to_string())
488+
.env("RUSTC_ERROR_METADATA_DST", self.extended_error_dir());
489489
if let Some(n) = self.config.rust_codegen_units {
490490
cargo.env("RUSTC_CODEGEN_UNITS", n.to_string());
491491
}

src/bootstrap/channel.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use Build;
2424
use config::Config;
2525

2626
// The version number
27-
pub const CFG_RELEASE_NUM: &str = "1.24.0";
27+
pub const CFG_RELEASE_NUM: &str = "1.24.1";
2828

2929
pub struct GitInfo {
3030
inner: Option<Info>,

src/bootstrap/check.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,8 @@ impl Step for ErrorIndex {
980980
build.run(builder.tool_cmd(Tool::ErrorIndex)
981981
.arg("markdown")
982982
.arg(&output)
983-
.env("CFG_BUILD", &build.build));
983+
.env("CFG_BUILD", &build.build)
984+
.env("RUSTC_ERROR_METADATA_DST", build.extended_error_dir()));
984985

985986
markdown_test(builder, compiler, &output);
986987
}

src/bootstrap/doc.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,8 @@ impl Step for ErrorIndex {
671671
index.arg(out.join("error-index.html"));
672672

673673
// FIXME: shouldn't have to pass this env var
674-
index.env("CFG_BUILD", &build.build);
674+
index.env("CFG_BUILD", &build.build)
675+
.env("RUSTC_ERROR_METADATA_DST", build.extended_error_dir());
675676

676677
build.run(&mut index);
677678
}

src/bootstrap/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,11 @@ impl Build {
721721
self.config.python.as_ref().unwrap()
722722
}
723723

724+
/// Temporary directory that extended error information is emitted to.
725+
fn extended_error_dir(&self) -> PathBuf {
726+
self.out.join("tmp/extended-error-metadata")
727+
}
728+
724729
/// Tests whether the `compiler` compiling for `target` should be forced to
725730
/// use a stage1 compiler instead.
726731
///

src/librustc_mir/build/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,9 @@ fn should_abort_on_panic<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
372372
// unwind anyway. Don't stop them.
373373
if tcx.has_attr(tcx.hir.local_def_id(fn_id), "unwind") { return false; }
374374

375-
return true;
375+
// FIXME(rust-lang/rust#48251) -- Had to disable abort-on-panic
376+
// for backwards compatibility reasons.
377+
false
376378
}
377379

378380
///////////////////////////////////////////////////////////////////////////

src/librustc_trans/back/link.rs

+13-1
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,19 @@ fn exec_linker(sess: &Session, cmd: &mut Command, tmpdir: &Path)
776776
args.push_str("\n");
777777
}
778778
let file = tmpdir.join("linker-arguments");
779-
fs::write(&file, args.as_bytes())?;
779+
let bytes = if sess.target.target.options.is_like_msvc {
780+
let mut out = vec![];
781+
// start the stream with a UTF-16 BOM
782+
for c in vec![0xFEFF].into_iter().chain(args.encode_utf16()) {
783+
// encode in little endian
784+
out.push(c as u8);
785+
out.push((c >> 8) as u8);
786+
}
787+
out
788+
} else {
789+
args.into_bytes()
790+
};
791+
fs::write(&file, &bytes)?;
780792
cmd2.arg(format!("@{}", file.display()));
781793
return cmd2.output();
782794

src/libsyntax/diagnostics/metadata.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,17 @@
1414
//! currently always a crate name.
1515
1616
use std::collections::BTreeMap;
17-
use std::path::PathBuf;
17+
use std::env;
1818
use std::fs::{remove_file, create_dir_all, File};
1919
use std::io::Write;
20+
use std::path::PathBuf;
2021
use std::error::Error;
2122
use rustc_serialize::json::as_json;
2223

2324
use syntax_pos::{Span, FileName};
2425
use ext::base::ExtCtxt;
2526
use diagnostics::plugin::{ErrorMap, ErrorInfo};
2627

27-
// Default metadata directory to use for extended error JSON.
28-
const ERROR_METADATA_PREFIX: &'static str = "tmp/extended-errors";
29-
3028
/// JSON encodable/decodable version of `ErrorInfo`.
3129
#[derive(PartialEq, RustcDecodable, RustcEncodable)]
3230
pub struct ErrorMetadata {
@@ -59,7 +57,10 @@ impl ErrorLocation {
5957
///
6058
/// See `output_metadata`.
6159
pub fn get_metadata_dir(prefix: &str) -> PathBuf {
62-
PathBuf::from(ERROR_METADATA_PREFIX).join(prefix)
60+
env::var_os("RUSTC_ERROR_METADATA_DST")
61+
.map(PathBuf::from)
62+
.expect("env var `RUSTC_ERROR_METADATA_DST` isn't set")
63+
.join(prefix)
6364
}
6465

6566
/// Map `name` to a path in the given directory: <directory>/<name>.json

src/test/run-make/long-linker-command-lines-cmd-exe/foo.rs

+20-5
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,11 @@ fn main() {
3636
let ok = tmpdir.join("ok");
3737
let not_ok = tmpdir.join("not_ok");
3838
if env::var("YOU_ARE_A_LINKER").is_ok() {
39-
match env::args().find(|a| a.contains("@")) {
40-
Some(file) => { fs::copy(&file[1..], &ok).unwrap(); }
39+
match env::args_os().find(|a| a.to_string_lossy().contains("@")) {
40+
Some(file) => {
41+
let file = file.to_str().unwrap();
42+
fs::copy(&file[1..], &ok).unwrap();
43+
}
4144
None => { File::create(&not_ok).unwrap(); }
4245
}
4346
return
@@ -84,11 +87,23 @@ fn main() {
8487
continue
8588
}
8689

87-
let mut contents = String::new();
88-
File::open(&ok).unwrap().read_to_string(&mut contents).unwrap();
90+
let mut contents = Vec::new();
91+
File::open(&ok).unwrap().read_to_end(&mut contents).unwrap();
8992

9093
for j in 0..i {
91-
assert!(contents.contains(&format!("{}{}", lib_name, j)));
94+
let exp = format!("{}{}", lib_name, j);
95+
let exp = if cfg!(target_env = "msvc") {
96+
let mut out = Vec::with_capacity(exp.len() * 2);
97+
for c in exp.encode_utf16() {
98+
// encode in little endian
99+
out.push(c as u8);
100+
out.push((c >> 8) as u8);
101+
}
102+
out
103+
} else {
104+
exp.into_bytes()
105+
};
106+
assert!(contents.windows(exp.len()).any(|w| w == &exp[..]));
92107
}
93108

94109
break

src/test/run-make/long-linker-command-lines/foo.rs

+17-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ fn main() {
2727
let tmpdir = PathBuf::from(env::var_os("TMPDIR").unwrap());
2828
let ok = tmpdir.join("ok");
2929
if env::var("YOU_ARE_A_LINKER").is_ok() {
30-
if let Some(file) = env::args().find(|a| a.contains("@")) {
30+
if let Some(file) = env::args_os().find(|a| a.to_string_lossy().contains("@")) {
31+
let file = file.to_str().expect("non-utf8 file argument");
3132
fs::copy(&file[1..], &ok).unwrap();
3233
}
3334
return
@@ -76,11 +77,23 @@ fn main() {
7677
continue
7778
}
7879

79-
let mut contents = String::new();
80-
File::open(&ok).unwrap().read_to_string(&mut contents).unwrap();
80+
let mut contents = Vec::new();
81+
File::open(&ok).unwrap().read_to_end(&mut contents).unwrap();
8182

8283
for j in 0..i {
83-
assert!(contents.contains(&format!("{}{}", lib_name, j)));
84+
let exp = format!("{}{}", lib_name, j);
85+
let exp = if cfg!(target_env = "msvc") {
86+
let mut out = Vec::with_capacity(exp.len() * 2);
87+
for c in exp.encode_utf16() {
88+
// encode in little endian
89+
out.push(c as u8);
90+
out.push((c >> 8) as u8);
91+
}
92+
out
93+
} else {
94+
exp.into_bytes()
95+
};
96+
assert!(contents.windows(exp.len()).any(|w| w == &exp[..]));
8497
}
8598

8699
break

src/test/run-pass/abort-on-c-abi.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// we never unwind through them.
1313

1414
// ignore-emscripten no processes
15+
// ignore-test FIXME rust-lang/rust#48251 -- temporarily disabled
1516

1617
use std::{env, panic};
1718
use std::io::prelude::*;

0 commit comments

Comments
 (0)