Skip to content

Commit d8f6bfe

Browse files
committed
---
yaml --- r: 273132 b: refs/heads/beta c: 6d215fe h: refs/heads/master
1 parent 794f6eb commit d8f6bfe

File tree

402 files changed

+7358
-6800
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

402 files changed

+7358
-6800
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: ea7cf904b09a9a6dabb035d2bde4ef236d39144a
26+
refs/heads/beta: 6d215fe04ce3f638d717d7fcea95c40d0a655ff9
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# i586-pc-windows-msvc configuration
2+
CC_i586-pc-windows-msvc="$(CFG_MSVC_CL_i386)" -nologo
3+
LINK_i586-pc-windows-msvc="$(CFG_MSVC_LINK_i386)" -nologo
4+
CXX_i586-pc-windows-msvc="$(CFG_MSVC_CL_i386)" -nologo
5+
CPP_i586-pc-windows-msvc="$(CFG_MSVC_CL_i386)" -nologo
6+
AR_i586-pc-windows-msvc="$(CFG_MSVC_LIB_i386)" -nologo
7+
CFG_LIB_NAME_i586-pc-windows-msvc=$(1).dll
8+
CFG_STATIC_LIB_NAME_i586-pc-windows-msvc=$(1).lib
9+
CFG_LIB_GLOB_i586-pc-windows-msvc=$(1)-*.{dll,lib}
10+
CFG_LIB_DSYM_GLOB_i586-pc-windows-msvc=$(1)-*.dylib.dSYM
11+
CFG_JEMALLOC_CFLAGS_i586-pc-windows-msvc :=
12+
CFG_GCCISH_CFLAGS_i586-pc-windows-msvc := -MD -arch:IA32
13+
CFG_GCCISH_CXXFLAGS_i586-pc-windows-msvc := -MD -arch:IA32
14+
CFG_GCCISH_LINK_FLAGS_i586-pc-windows-msvc :=
15+
CFG_GCCISH_DEF_FLAG_i586-pc-windows-msvc :=
16+
CFG_LLC_FLAGS_i586-pc-windows-msvc :=
17+
CFG_INSTALL_NAME_i586-pc-windows-msvc =
18+
CFG_EXE_SUFFIX_i586-pc-windows-msvc := .exe
19+
CFG_WINDOWSY_i586-pc-windows-msvc := 1
20+
CFG_UNIXY_i586-pc-windows-msvc :=
21+
CFG_LDPATH_i586-pc-windows-msvc :=
22+
CFG_RUN_i586-pc-windows-msvc=$(2)
23+
CFG_RUN_TARG_i586-pc-windows-msvc=$(call CFG_RUN_i586-pc-windows-msvc,,$(2))
24+
CFG_GNU_TRIPLE_i586-pc-windows-msvc := i586-pc-win32
25+
26+
# Currently the build system is not configured to build jemalloc
27+
# with MSVC, so we omit this optional dependency.
28+
CFG_DISABLE_JEMALLOC_i586-pc-windows-msvc := 1

branches/beta/mk/crates.mk

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ TARGET_CRATES := libc std term \
5353
getopts collections test rand \
5454
core alloc \
5555
rustc_unicode rustc_bitflags \
56-
alloc_system alloc_jemalloc
56+
alloc_system alloc_jemalloc rustc_const_eval
5757
RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \
5858
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
5959
rustc_data_structures rustc_front rustc_platform_intrinsics \
@@ -91,8 +91,11 @@ DEPS_test := std getopts term native:rust_test_helpers
9191
DEPS_syntax := std term serialize log arena libc rustc_bitflags rustc_unicode
9292
DEPS_syntax_ext := syntax fmt_macros
9393

94+
DEPS_rustc_const_eval := std syntax
95+
9496
DEPS_rustc := syntax fmt_macros flate arena serialize getopts rbml rustc_front\
95-
log graphviz rustc_llvm rustc_back rustc_data_structures
97+
log graphviz rustc_llvm rustc_back rustc_data_structures\
98+
rustc_const_eval
9699
DEPS_rustc_back := std syntax rustc_llvm rustc_front flate log libc
97100
DEPS_rustc_borrowck := rustc rustc_front log graphviz syntax
98101
DEPS_rustc_data_structures := std log serialize
@@ -103,16 +106,17 @@ DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_bo
103106
DEPS_rustc_front := std syntax log serialize
104107
DEPS_rustc_lint := rustc log syntax
105108
DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags
106-
DEPS_rustc_metadata := rustc rustc_front syntax rbml
109+
DEPS_rustc_metadata := rustc rustc_front syntax rbml rustc_const_eval
107110
DEPS_rustc_passes := syntax rustc core rustc_front
108-
DEPS_rustc_mir := rustc rustc_front syntax
111+
DEPS_rustc_mir := rustc rustc_front syntax rustc_const_eval
109112
DEPS_rustc_resolve := arena rustc rustc_front log syntax
110113
DEPS_rustc_platform_intrinsics := rustc rustc_llvm
111114
DEPS_rustc_plugin := rustc rustc_metadata syntax rustc_mir
112115
DEPS_rustc_privacy := rustc rustc_front log syntax
113116
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back rustc_mir \
114-
log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics
115-
DEPS_rustc_typeck := rustc syntax rustc_front rustc_platform_intrinsics
117+
log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics \
118+
rustc_const_eval
119+
DEPS_rustc_typeck := rustc syntax rustc_front rustc_platform_intrinsics rustc_const_eval
116120

117121
DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \
118122
test rustc_lint rustc_front
@@ -126,8 +130,8 @@ TOOL_DEPS_error_index_generator := rustdoc syntax serialize
126130
TOOL_SOURCE_compiletest := $(S)src/compiletest/compiletest.rs
127131
TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs
128132
TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
129-
TOOL_SOURCE_rustbook := $(S)src/rustbook/main.rs
130-
TOOL_SOURCE_error_index_generator := $(S)src/error_index_generator/main.rs
133+
TOOL_SOURCE_rustbook := $(S)src/tools/rustbook/main.rs
134+
TOOL_SOURCE_error_index_generator := $(S)src/tools/error_index_generator/main.rs
131135

132136
ONLY_RLIB_core := 1
133137
ONLY_RLIB_libc := 1

branches/beta/mk/dist.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ PKG_FILES := \
5454
doc \
5555
driver \
5656
etc \
57-
error_index_generator \
5857
$(foreach crate,$(CRATES),lib$(crate)) \
5958
libcollectionstest \
6059
libcoretest \
@@ -65,7 +64,7 @@ PKG_FILES := \
6564
rustc \
6665
snapshots.txt \
6766
rust-installer \
68-
rustbook \
67+
tools \
6968
test) \
7069
$(PKG_GITMODULES) \
7170
$(filter-out config.stamp, \

branches/beta/src/bootstrap/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ path = "main.rs"
1515
name = "rustc"
1616
path = "rustc.rs"
1717

18+
[[bin]]
19+
name = "rustdoc"
20+
path = "rustdoc.rs"
21+
1822
[dependencies]
1923
build_helper = { path = "../build_helper" }
2024
cmake = "0.1.10"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use std::process::Command;
12+
13+
use build::{Build, Compiler};
14+
15+
pub fn linkcheck(build: &Build, stage: u32, host: &str) {
16+
println!("Linkcheck stage{} ({})", stage, host);
17+
let compiler = Compiler::new(stage, host);
18+
let linkchecker = build.tool(&compiler, "linkchecker");
19+
build.run(Command::new(&linkchecker)
20+
.arg(build.out.join(host).join("doc")));
21+
}

branches/beta/src/bootstrap/build/compile.rs

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::process::Command;
1616
use build_helper::output;
1717

1818
use build::util::{exe, staticlib, libdir, mtime, is_dylib};
19-
use build::{Build, Compiler};
19+
use build::{Build, Compiler, Mode};
2020

2121
/// Build the standard library.
2222
///
@@ -39,9 +39,10 @@ pub fn std<'a>(build: &'a Build, stage: u32, target: &str,
3939

4040
build_startup_objects(build, target, &libdir);
4141

42-
let out_dir = build.cargo_out(stage, &host, true, target);
42+
let out_dir = build.cargo_out(stage, &host, Mode::Libstd, target);
4343
build.clear_if_dirty(&out_dir, &build.compiler_path(compiler));
44-
let mut cargo = build.cargo(stage, compiler, true, target, "build");
44+
let mut cargo = build.cargo(stage, compiler, Mode::Libstd, Some(target),
45+
"build");
4546
cargo.arg("--features").arg(build.std_features())
4647
.arg("--manifest-path")
4748
.arg(build.src.join("src/rustc/std_shim/Cargo.toml"));
@@ -71,7 +72,7 @@ pub fn std_link(build: &Build,
7172
compiler: &Compiler,
7273
host: &str) {
7374
let libdir = build.sysroot_libdir(stage, host, target);
74-
let out_dir = build.cargo_out(stage, compiler.host, true, target);
75+
let out_dir = build.cargo_out(stage, compiler.host, Mode::Libstd, target);
7576

7677
// If we're linking one compiler host's output into another, then we weren't
7778
// called from the `std` method above. In that case we clean out what's
@@ -135,19 +136,15 @@ pub fn rustc<'a>(build: &'a Build, stage: u32, target: &str,
135136
println!("Building stage{} compiler artifacts ({} -> {})", stage,
136137
host, target);
137138

138-
let out_dir = build.cargo_out(stage, &host, false, target);
139+
let out_dir = build.cargo_out(stage, &host, Mode::Librustc, target);
139140
build.clear_if_dirty(&out_dir, &libstd_shim(build, stage, &host, target));
140141

141-
let mut cargo = build.cargo(stage, compiler, false, target, "build");
142-
cargo.arg("--features").arg(build.rustc_features(stage))
142+
let mut cargo = build.cargo(stage, compiler, Mode::Librustc, Some(target),
143+
"build");
144+
cargo.arg("--features").arg(build.rustc_features())
143145
.arg("--manifest-path")
144146
.arg(build.src.join("src/rustc/Cargo.toml"));
145147

146-
// In stage0 we may not need to build as many executables
147-
if stage == 0 {
148-
cargo.arg("--bin").arg("rustc");
149-
}
150-
151148
// Set some configuration variables picked up by build scripts and
152149
// the compiler alike
153150
cargo.env("CFG_RELEASE", &build.release)
@@ -200,14 +197,14 @@ pub fn rustc_link(build: &Build,
200197
compiler: &Compiler,
201198
host: &str) {
202199
let libdir = build.sysroot_libdir(stage, host, target);
203-
let out_dir = build.cargo_out(stage, compiler.host, false, target);
200+
let out_dir = build.cargo_out(stage, compiler.host, Mode::Librustc, target);
204201
add_to_sysroot(&out_dir, &libdir);
205202
}
206203

207204
/// Cargo's output path for the standard library in a given stage, compiled
208205
/// by a particular compiler for the specified target.
209206
fn libstd_shim(build: &Build, stage: u32, host: &str, target: &str) -> PathBuf {
210-
build.cargo_out(stage, host, true, target).join("libstd_shim.rlib")
207+
build.cargo_out(stage, host, Mode::Libstd, target).join("libstd_shim.rlib")
211208
}
212209

213210
fn compiler_file(compiler: &Path, file: &str) -> String {
@@ -239,7 +236,8 @@ pub fn assemble_rustc(build: &Build, stage: u32, host: &str) {
239236
}
240237
}
241238

242-
let out_dir = build.cargo_out(stage - 1, &build.config.build, false, host);
239+
let out_dir = build.cargo_out(stage - 1, &build.config.build,
240+
Mode::Librustc, host);
243241

244242
// Link the compiler binary itself into place
245243
let rustc = out_dir.join(exe("rustc", host));
@@ -298,3 +296,27 @@ fn add_to_sysroot(out_dir: &Path, sysroot_dst: &Path) {
298296
sysroot_dst.join(path.file_name().unwrap())));
299297
}
300298
}
299+
300+
/// Build a tool in `src/tools`
301+
///
302+
/// This will build the specified tool with the specified `host` compiler in
303+
/// `stage` into the normal cargo output directory.
304+
pub fn tool(build: &Build, stage: u32, host: &str, tool: &str) {
305+
println!("Building stage{} tool {} ({})", stage, tool, host);
306+
307+
let compiler = Compiler::new(stage, host);
308+
309+
// FIXME: need to clear out previous tool and ideally deps, may require
310+
// isolating output directories or require a pseudo shim step to
311+
// clear out all the info.
312+
//
313+
// Maybe when libstd is compiled it should clear out the rustc of the
314+
// corresponding stage?
315+
// let out_dir = build.cargo_out(stage, &host, Mode::Librustc, target);
316+
// build.clear_if_dirty(&out_dir, &libstd_shim(build, stage, &host, target));
317+
318+
let mut cargo = build.cargo(stage, &compiler, Mode::Tool, None, "build");
319+
cargo.arg("--manifest-path")
320+
.arg(build.src.join(format!("src/tools/{}/Cargo.toml", tool)));
321+
build.run(&mut cargo);
322+
}

branches/beta/src/bootstrap/build/doc.rs

Lines changed: 55 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::path::Path;
1211
use std::fs::{self, File};
1312
use std::io::prelude::*;
13+
use std::path::Path;
14+
use std::process::Command;
1415

15-
use build::{Build, Compiler};
16-
use build::util::up_to_date;
16+
use build::{Build, Compiler, Mode};
17+
use build::util::{up_to_date, cp_r};
1718

1819
pub fn rustbook(build: &Build, stage: u32, host: &str, name: &str, out: &Path) {
1920
t!(fs::create_dir_all(out));
@@ -69,7 +70,7 @@ pub fn standalone(build: &Build, stage: u32, host: &str, out: &Path) {
6970
}
7071

7172
let html = out.join(filename).with_extension("html");
72-
let rustdoc = build.tool(&compiler, "rustdoc");
73+
let rustdoc = build.rustdoc(&compiler);
7374
if up_to_date(&path, &html) &&
7475
up_to_date(&footer, &html) &&
7576
up_to_date(&favicon, &html) &&
@@ -79,7 +80,7 @@ pub fn standalone(build: &Build, stage: u32, host: &str, out: &Path) {
7980
continue
8081
}
8182

82-
let mut cmd = build.tool_cmd(&compiler, "rustdoc");
83+
let mut cmd = Command::new(&rustdoc);
8384
cmd.arg("--html-after-content").arg(&footer)
8485
.arg("--html-before-content").arg(&version_info)
8586
.arg("--html-in-header").arg(&favicon)
@@ -102,3 +103,52 @@ pub fn standalone(build: &Build, stage: u32, host: &str, out: &Path) {
102103
build.run(&mut cmd);
103104
}
104105
}
106+
107+
pub fn std(build: &Build, stage: u32, host: &str, out: &Path) {
108+
println!("Documenting stage{} std ({})", stage, host);
109+
let compiler = Compiler::new(stage, host);
110+
let out_dir = build.stage_out(stage, host, Mode::Libstd)
111+
.join(host).join("doc");
112+
let rustdoc = build.rustdoc(&compiler);
113+
114+
build.clear_if_dirty(&out_dir, &rustdoc);
115+
116+
let mut cargo = build.cargo(stage, &compiler, Mode::Libstd, Some(host),
117+
"doc");
118+
cargo.arg("--manifest-path")
119+
.arg(build.src.join("src/rustc/std_shim/Cargo.toml"))
120+
.arg("--features").arg(build.std_features());
121+
build.run(&mut cargo);
122+
cp_r(&out_dir, out)
123+
}
124+
125+
pub fn rustc(build: &Build, stage: u32, host: &str, out: &Path) {
126+
println!("Documenting stage{} compiler ({})", stage, host);
127+
let compiler = Compiler::new(stage, host);
128+
let out_dir = build.stage_out(stage, host, Mode::Librustc)
129+
.join(host).join("doc");
130+
let rustdoc = build.rustdoc(&compiler);
131+
if !up_to_date(&rustdoc, &out_dir.join("rustc/index.html")) {
132+
t!(fs::remove_dir_all(&out_dir));
133+
}
134+
let mut cargo = build.cargo(stage, &compiler, Mode::Librustc, Some(host),
135+
"doc");
136+
cargo.arg("--manifest-path")
137+
.arg(build.src.join("src/rustc/Cargo.toml"))
138+
.arg("--features").arg(build.rustc_features());
139+
build.run(&mut cargo);
140+
cp_r(&out_dir, out)
141+
}
142+
143+
pub fn error_index(build: &Build, stage: u32, host: &str, out: &Path) {
144+
println!("Documenting stage{} error index ({})", stage, host);
145+
let compiler = Compiler::new(stage, host);
146+
let mut index = Command::new(build.tool(&compiler, "error_index_generator"));
147+
index.arg("html");
148+
index.arg(out.join("error-index.html"));
149+
150+
// FIXME: shouldn't have to pass this env var
151+
index.env("CFG_BUILD", &build.config.build);
152+
153+
build.run(&mut index);
154+
}

0 commit comments

Comments
 (0)