Skip to content

Commit e36bbf1

Browse files
committed
---
yaml --- r: 277237 b: refs/heads/try c: 14f61c8 h: refs/heads/master i: 277235: a39051b
1 parent e40ac1c commit e36bbf1

File tree

361 files changed

+6920
-2862
lines changed

Some content is hidden

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

361 files changed

+6920
-2862
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 6dbb0e86aec11050480beb76eade6fb805010ba7
33
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
4-
refs/heads/try: 1861951fd99260acc7513881c5105d65ec4599b4
4+
refs/heads/try: 14f61c87ff02e57d565d4fab4ce790156c9a596e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
/stage3/
7979
/test/
8080
/tmp/
81+
/obj/
8182
TAGS
8283
TAGS.emacs
8384
TAGS.vi

branches/try/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ are:
307307
[gsearchdocs]: https://www.google.com/search?q=site:doc.rust-lang.org+your+query+here
308308
[rif]: http://internals.rust-lang.org
309309
[rr]: https://doc.rust-lang.org/book/README.html
310-
[tlgba]: http://tomlee.co/2014/04/03/a-more-detailed-tour-of-the-rust-compiler/
310+
[tlgba]: http://tomlee.co/2014/04/a-more-detailed-tour-of-the-rust-compiler/
311311
[ro]: http://www.rustaceans.org/
312312
[rctd]: ./COMPILER_TESTS.md
313313
[cheatsheet]: http://buildbot.rust-lang.org/homu/

branches/try/RELEASES.md

Lines changed: 290 additions & 2 deletions
Large diffs are not rendered by default.

branches/try/mk/crates.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ TOOL_DEPS_rustdoc := rustdoc
133133
TOOL_DEPS_rustc := rustc_driver
134134
TOOL_DEPS_rustbook := std rustdoc
135135
TOOL_DEPS_error_index_generator := rustdoc syntax serialize
136-
TOOL_SOURCE_compiletest := $(S)src/compiletest/compiletest.rs
136+
TOOL_SOURCE_compiletest := $(S)src/tools/compiletest/src/main.rs
137137
TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs
138138
TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
139139
TOOL_SOURCE_rustbook := $(S)src/tools/rustbook/main.rs

branches/try/mk/dist.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ PKG_FILES := \
5050
$(addprefix $(S)src/, \
5151
bootstrap \
5252
build_helper \
53-
compiletest \
5453
doc \
5554
driver \
5655
etc \

branches/try/mk/main.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
######################################################################
1414

1515
# The version number
16-
CFG_RELEASE_NUM=1.9.0
16+
CFG_RELEASE_NUM=1.10.0
1717

1818
# An optional number to put after the label, e.g. '.2' -> '-beta.2'
1919
# NB Make sure it starts with a dot to conform to semver pre-release

branches/try/mk/tests.mk

Lines changed: 9 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -240,52 +240,16 @@ cleantestlibs:
240240
# Tidy
241241
######################################################################
242242

243-
ifdef CFG_NOTIDY
244243
.PHONY: tidy
245-
tidy:
246-
else
247-
248-
# Run the tidy script in multiple parts to avoid huge 'echo' commands
249-
.PHONY: tidy
250-
tidy: tidy-basic tidy-binaries tidy-errors tidy-features
251-
252-
endif
253-
254-
.PHONY: tidy-basic
255-
tidy-basic:
256-
@$(call E, check: formatting)
257-
$(Q) $(CFG_PYTHON) $(S)src/etc/tidy.py $(S)src/
258-
259-
.PHONY: tidy-binaries
260-
tidy-binaries:
261-
@$(call E, check: binaries)
262-
$(Q)find $(S)src -type f \
263-
\( -perm -u+x -or -perm -g+x -or -perm -o+x \) \
264-
-not -name '*.rs' -and -not -name '*.py' \
265-
-and -not -name '*.sh' -and -not -name '*.pp' \
266-
| grep '^$(S)src/jemalloc' -v \
267-
| grep '^$(S)src/libuv' -v \
268-
| grep '^$(S)src/llvm' -v \
269-
| grep '^$(S)src/rt/hoedown' -v \
270-
| grep '^$(S)src/gyp' -v \
271-
| grep '^$(S)src/etc' -v \
272-
| grep '^$(S)src/doc' -v \
273-
| grep '^$(S)src/compiler-rt' -v \
274-
| grep '^$(S)src/libbacktrace' -v \
275-
| grep '^$(S)src/rust-installer' -v \
276-
| grep '^$(S)src/liblibc' -v \
277-
| xargs $(CFG_PYTHON) $(S)src/etc/check-binaries.py
278-
279-
.PHONY: tidy-errors
280-
tidy-errors:
281-
@$(call E, check: extended errors)
282-
$(Q) $(CFG_PYTHON) $(S)src/etc/errorck.py $(S)src/
283-
284-
.PHONY: tidy-features
285-
tidy-features:
286-
@$(call E, check: feature sanity)
287-
$(Q) $(CFG_PYTHON) $(S)src/etc/featureck.py $(S)src/
244+
tidy: $(HBIN0_H_$(CFG_BUILD))/tidy$(X_$(CFG_BUILD))
245+
$(TARGET_RPATH_VAR0_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $< $(S)src
288246

247+
$(HBIN0_H_$(CFG_BUILD))/tidy$(X_$(CFG_BUILD)): \
248+
$(TSREQ0_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \
249+
$(TLIB0_T_$(CFG_BUILD)_H_$(CFG_BUILD))/stamp.std \
250+
$(call rwildcard,$(S)src/tools/tidy/src,*.rs)
251+
$(STAGE0_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(S)src/tools/tidy/src/main.rs \
252+
--out-dir $(@D) --crate-name tidy
289253

290254
######################################################################
291255
# Sets of tests
@@ -647,7 +611,7 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
647611
--run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3)) \
648612
--rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
649613
--rustdoc-path $$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
650-
--llvm-bin-path $(CFG_LLVM_INST_DIR_$(CFG_BUILD))/bin \
614+
--llvm-filecheck $(CFG_LLVM_INST_DIR_$(CFG_BUILD))/bin/FileCheck \
651615
--aux-base $$(S)src/test/auxiliary/ \
652616
--stage-id stage$(1)-$(2) \
653617
--target $(2) \

branches/try/src/bootstrap/Cargo.lock

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

branches/try/src/bootstrap/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ path = "rustdoc.rs"
2121

2222
[dependencies]
2323
build_helper = { path = "../build_helper" }
24-
cmake = "0.1.10"
24+
cmake = "0.1.17"
2525
filetime = "0.1"
2626
num_cpus = "0.2"
2727
toml = "0.1"
@@ -31,3 +31,4 @@ winapi = "0.2"
3131
kernel32-sys = "0.2"
3232
gcc = "0.3.17"
3333
libc = "0.2"
34+
md5 = "0.1"

branches/try/src/bootstrap/bootstrap.py

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import argparse
1212
import contextlib
13+
import hashlib
1314
import os
1415
import shutil
1516
import subprocess
@@ -18,13 +19,29 @@
1819

1920
def get(url, path, verbose=False):
2021
print("downloading " + url)
21-
# see http://serverfault.com/questions/301128/how-to-download
22-
if sys.platform == 'win32':
23-
run(["PowerShell.exe", "/nologo", "-Command",
24-
"(New-Object System.Net.WebClient).DownloadFile('" + url +
25-
"', '" + path + "')"], verbose=verbose)
26-
else:
27-
run(["curl", "-o", path, url], verbose=verbose)
22+
sha_url = url + ".sha256"
23+
sha_path = path + ".sha256"
24+
for _url, _path in ((url, path), (sha_url, sha_path)):
25+
# see http://serverfault.com/questions/301128/how-to-download
26+
if sys.platform == 'win32':
27+
run(["PowerShell.exe", "/nologo", "-Command",
28+
"(New-Object System.Net.WebClient)"
29+
".DownloadFile('{}', '{}')".format(_url, _path)],
30+
verbose=verbose)
31+
else:
32+
run(["curl", "-o", _path, _url], verbose=verbose)
33+
print("verifying " + path)
34+
with open(path, "rb") as f:
35+
found = hashlib.sha256(f.read()).hexdigest()
36+
with open(sha_path, "r") as f:
37+
expected, _ = f.readline().split()
38+
if found != expected:
39+
err = ("invalid checksum:\n"
40+
" found: {}\n"
41+
" expected: {}".format(found, expected))
42+
if verbose:
43+
raise RuntimeError(err)
44+
sys.exit(err)
2845

2946
def unpack(tarball, dst, verbose=False, match=None):
3047
print("extracting " + tarball)
@@ -57,9 +74,10 @@ def run(args, verbose=False):
5774
ret = subprocess.Popen(args)
5875
code = ret.wait()
5976
if code != 0:
60-
if not verbose:
61-
print("failed to run: " + ' '.join(args))
62-
raise RuntimeError("failed to run command")
77+
err = "failed to run: " + ' '.join(args)
78+
if verbose:
79+
raise RuntimeError(err)
80+
sys.exit(err)
6381

6482
class RustBuild:
6583
def download_rust_nightly(self):
@@ -210,7 +228,10 @@ def build_triple(self):
210228
if sys.platform == 'win32':
211229
return 'x86_64-pc-windows-msvc'
212230
else:
213-
raise
231+
err = "uname not found"
232+
if self.verbose:
233+
raise Exception(err)
234+
sys.exit(err)
214235

215236
# Darwin's `uname -s` lies and always returns i386. We have to use
216237
# sysctl instead.
@@ -253,7 +274,10 @@ def build_triple(self):
253274
cputype = 'x86_64'
254275
ostype = 'pc-windows-gnu'
255276
else:
256-
raise ValueError("unknown OS type: " + ostype)
277+
err = "unknown OS type: " + ostype
278+
if self.verbose:
279+
raise ValueError(err)
280+
sys.exit(err)
257281

258282
if cputype in {'i386', 'i486', 'i686', 'i786', 'x86'}:
259283
cputype = 'i686'
@@ -269,7 +293,10 @@ def build_triple(self):
269293
elif cputype in {'amd64', 'x86_64', 'x86-64', 'x64'}:
270294
cputype = 'x86_64'
271295
else:
272-
raise ValueError("unknown cpu type: " + cputype)
296+
err = "unknown cpu type: " + cputype
297+
if self.verbose:
298+
raise ValueError(err)
299+
sys.exit(err)
273300

274301
return cputype + '-' + ostype
275302

@@ -308,11 +335,11 @@ def build_triple(self):
308335

309336
# Run the bootstrap
310337
args = [os.path.join(rb.build_dir, "bootstrap/debug/bootstrap")]
311-
args.extend(sys.argv[1:])
312338
args.append('--src')
313339
args.append(rb.rust_root)
314340
args.append('--build')
315341
args.append(rb.build)
342+
args.extend(sys.argv[1:])
316343
env = os.environ.copy()
317344
env["BOOTSTRAP_PARENT_ID"] = str(os.getpid())
318345
rb.run(args, env)

branches/try/src/bootstrap/build/channel.rs

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

11+
use std::env;
1112
use std::fs::{self, File};
1213
use std::io::prelude::*;
13-
use std::path::Path;
1414
use std::process::Command;
1515

1616
use build_helper::output;
17+
use md5;
1718

1819
use build::Build;
19-
use build::util::mtime;
2020

2121
pub fn collect(build: &mut Build) {
2222
let mut main_mk = String::new();
@@ -80,7 +80,8 @@ pub fn collect(build: &mut Build) {
8080
build.short_ver_hash = Some(short_ver_hash);
8181
}
8282

83-
build.bootstrap_key = mtime(Path::new("config.toml")).seconds()
84-
.to_string();
83+
let key = md5::compute(build.release.as_bytes());
84+
build.bootstrap_key = format!("{:02x}{:02x}{:02x}{:02x}",
85+
key[0], key[1], key[2], key[3]);
86+
env::set_var("RUSTC_BOOTSTRAP_KEY", &build.bootstrap_key);
8587
}
86-

branches/try/src/bootstrap/build/check.rs

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

11+
use std::fs;
12+
use std::path::PathBuf;
13+
1114
use build::{Build, Compiler};
1215

1316
pub fn linkcheck(build: &Build, stage: u32, host: &str) {
@@ -29,7 +32,73 @@ pub fn cargotest(build: &Build, stage: u32, host: &str) {
2932
let sep = if cfg!(windows) { ";" } else {":" };
3033
let ref newpath = format!("{}{}{}", path.display(), sep, old_path);
3134

35+
// Note that this is a short, cryptic, and not scoped directory name. This
36+
// is currently to minimize the length of path on Windows where we otherwise
37+
// quickly run into path name limit constraints.
38+
let out_dir = build.out.join("ct");
39+
t!(fs::create_dir_all(&out_dir));
40+
3241
build.run(build.tool_cmd(compiler, "cargotest")
33-
.env("PATH", newpath)
34-
.arg(&build.cargo));
42+
.env("PATH", newpath)
43+
.arg(&build.cargo)
44+
.arg(&out_dir));
45+
}
46+
47+
pub fn tidy(build: &Build, stage: u32, host: &str) {
48+
println!("tidy check stage{} ({})", stage, host);
49+
let compiler = Compiler::new(stage, host);
50+
build.run(build.tool_cmd(&compiler, "tidy")
51+
.arg(build.src.join("src")));
52+
}
53+
54+
fn testdir(build: &Build, host: &str) -> PathBuf {
55+
build.out.join(host).join("test")
56+
}
57+
58+
pub fn compiletest(build: &Build,
59+
compiler: &Compiler,
60+
target: &str,
61+
mode: &str,
62+
suite: &str) {
63+
let mut cmd = build.tool_cmd(compiler, "compiletest");
64+
65+
cmd.arg("--compile-lib-path").arg(build.rustc_libdir(compiler));
66+
cmd.arg("--run-lib-path").arg(build.sysroot_libdir(compiler, target));
67+
cmd.arg("--rustc-path").arg(build.compiler_path(compiler));
68+
cmd.arg("--rustdoc-path").arg(build.rustdoc(compiler));
69+
cmd.arg("--src-base").arg(build.src.join("src/test").join(suite));
70+
cmd.arg("--aux-base").arg(build.src.join("src/test/auxiliary"));
71+
cmd.arg("--build-base").arg(testdir(build, compiler.host).join(suite));
72+
cmd.arg("--stage-id").arg(format!("stage{}-{}", compiler.stage, target));
73+
cmd.arg("--mode").arg(mode);
74+
cmd.arg("--target").arg(target);
75+
cmd.arg("--host").arg(compiler.host);
76+
cmd.arg("--llvm-filecheck").arg(build.llvm_filecheck(&build.config.build));
77+
78+
let linkflag = format!("-Lnative={}", build.test_helpers_out(target).display());
79+
cmd.arg("--host-rustcflags").arg("-Crpath");
80+
cmd.arg("--target-rustcflags").arg(format!("-Crpath {}", linkflag));
81+
82+
// FIXME: needs android support
83+
cmd.arg("--android-cross-path").arg("");
84+
// FIXME: CFG_PYTHON should probably be detected more robustly elsewhere
85+
cmd.arg("--python").arg("python");
86+
87+
if let Some(ref vers) = build.gdb_version {
88+
cmd.arg("--gdb-version").arg(vers);
89+
}
90+
if let Some(ref vers) = build.lldb_version {
91+
cmd.arg("--lldb-version").arg(vers);
92+
}
93+
if let Some(ref dir) = build.lldb_python_dir {
94+
cmd.arg("--lldb-python-dir").arg(dir);
95+
}
96+
97+
cmd.args(&build.flags.args);
98+
99+
if build.config.verbose || build.flags.verbose {
100+
cmd.arg("--verbose");
101+
}
102+
103+
build.run(&mut cmd);
35104
}

0 commit comments

Comments
 (0)