Skip to content

Commit e484197

Browse files
committed
A few small test fixes and such from rollup
1 parent 3eb459f commit e484197

File tree

5 files changed

+26
-16
lines changed

5 files changed

+26
-16
lines changed

src/bootstrap/compile.rs

+17-7
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,11 @@ use {Build, Compiler, Mode};
3535
/// created will also be linked into the sysroot directory.
3636
pub fn std(build: &Build, target: &str, compiler: &Compiler) {
3737
let libdir = build.sysroot_libdir(compiler, target);
38-
let _ = fs::remove_dir_all(&libdir);
3938
t!(fs::create_dir_all(&libdir));
4039

4140
println!("Building stage{} std artifacts ({} -> {})", compiler.stage,
4241
compiler.host, target);
4342

44-
// Some platforms have startup objects that may be required to produce the
45-
// libstd dynamic library, for example.
46-
build_startup_objects(build, target, &libdir);
47-
4843
let out_dir = build.cargo_out(compiler, Mode::Libstd, target);
4944
build.clear_if_dirty(&out_dir, &build.compiler_path(compiler));
5045
let mut cargo = build.cargo(compiler, Mode::Libstd, target, "build");
@@ -111,20 +106,23 @@ fn copy_musl_third_party_objects(build: &Build, target: &str, into: &Path) {
111106
/// They don't require any library support as they're just plain old object
112107
/// files, so we just use the nightly snapshot compiler to always build them (as
113108
/// no other compilers are guaranteed to be available).
114-
fn build_startup_objects(build: &Build, target: &str, into: &Path) {
109+
pub fn build_startup_objects(build: &Build, for_compiler: &Compiler, target: &str) {
115110
if !target.contains("pc-windows-gnu") {
116111
return
117112
}
113+
118114
let compiler = Compiler::new(0, &build.config.build);
119115
let compiler_path = build.compiler_path(&compiler);
116+
let into = build.sysroot_libdir(for_compiler, target);
117+
t!(fs::create_dir_all(&into));
120118

121119
for file in t!(fs::read_dir(build.src.join("src/rtstartup"))) {
122120
let file = t!(file);
123121
let mut cmd = Command::new(&compiler_path);
124122
build.run(cmd.env("RUSTC_BOOTSTRAP", "1")
125123
.arg("--target").arg(target)
126124
.arg("--emit=obj")
127-
.arg("--out-dir").arg(into)
125+
.arg("--out-dir").arg(&into)
128126
.arg(file.path()));
129127
}
130128

@@ -155,6 +153,12 @@ pub fn test_link(build: &Build,
155153
compiler: &Compiler,
156154
target_compiler: &Compiler,
157155
target: &str) {
156+
println!("Copying stage{} test from stage{} ({} -> {} / {})",
157+
target_compiler.stage,
158+
compiler.stage,
159+
compiler.host,
160+
target_compiler.host,
161+
target);
158162
let libdir = build.sysroot_libdir(&target_compiler, target);
159163
let out_dir = build.cargo_out(&compiler, Mode::Libtest, target);
160164
add_to_sysroot(&out_dir, &libdir);
@@ -224,6 +228,12 @@ pub fn rustc_link(build: &Build,
224228
compiler: &Compiler,
225229
target_compiler: &Compiler,
226230
target: &str) {
231+
println!("Copying stage{} rustc from stage{} ({} -> {} / {})",
232+
target_compiler.stage,
233+
compiler.stage,
234+
compiler.host,
235+
target_compiler.host,
236+
target);
227237
let libdir = build.sysroot_libdir(&target_compiler, target);
228238
let out_dir = build.cargo_out(&compiler, Mode::Librustc, target);
229239
add_to_sysroot(&out_dir, &libdir);

src/bootstrap/config.toml.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
# support. You'll need to write a target specification at least, and most
5252
# likely, teach rustc about the C ABI of the target. Get in touch with the
5353
# Rust team and file an issue if you need assistance in porting!
54-
#targets = "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc"
54+
#targets = "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX"
5555

5656
# =============================================================================
5757
# General build configuration options

src/bootstrap/step.rs

+7
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
248248
"libstd-link",
249249
"build-crate-std_shim",
250250
compile::std_link)
251+
.dep(|s| s.name("startup-objects"))
251252
.dep(|s| s.name("create-sysroot").target(s.host));
252253
crate_rule(build,
253254
&mut rules,
@@ -264,6 +265,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
264265

265266
for (krate, path, _default) in krates("std_shim") {
266267
rules.build(&krate.build_step, path)
268+
.dep(|s| s.name("startup-objects"))
267269
.dep(move |s| s.name("rustc").host(&build.config.build).target(s.host))
268270
.run(move |s| compile::std(build, s.target, &s.compiler()));
269271
}
@@ -279,6 +281,10 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
279281
.run(move |s| compile::rustc(build, s.target, &s.compiler()));
280282
}
281283

284+
rules.build("startup-objects", "src/rtstartup")
285+
.dep(|s| s.name("create-sysroot").target(s.host))
286+
.run(move |s| compile::build_startup_objects(build, &s.compiler(), s.target));
287+
282288
// ========================================================================
283289
// Test targets
284290
//
@@ -349,6 +355,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
349355
let mut suite = |name, path, mode, dir| {
350356
rules.test(name, path)
351357
.dep(|s| s.name("librustc"))
358+
.dep(|s| s.name("test-helpers"))
352359
.dep(|s| s.name("tool-compiletest").target(s.host))
353360
.default(mode != "pretty")
354361
.host(true)

src/tools/cargotest/main.rs

-6
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,6 @@ const TEST_REPOS: &'static [Test] = &[
5252
sha: "999001b223152441198f117a68fb81f57bc086dd",
5353
lock: None,
5454
},
55-
Test {
56-
name: "xsv",
57-
repo: "https://github.com/BurntSushi/xsv",
58-
sha: "5ec4fff4a3f507eda887049469897f02c6fae036",
59-
lock: None,
60-
},
6155
];
6256

6357
fn main() {

src/tools/compiletest/src/main.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,7 @@ pub fn run_tests(config: &Config) {
271271
Mode::Codegen |
272272
Mode::CodegenUnits |
273273
Mode::Pretty |
274-
Mode::Rustdoc |
275-
Mode::Incremental => {}
274+
Mode::Rustdoc => {}
276275

277276
_ => {
278277
env::set_var("RUST_TEST_THREADS", "1");

0 commit comments

Comments
 (0)