Skip to content

Commit c35c92a

Browse files
committed
---
yaml --- r: 151734 b: refs/heads/try2 c: d0f3cb0 h: refs/heads/master v: v3
1 parent e706dfb commit c35c92a

File tree

413 files changed

+5024
-10053
lines changed

Some content is hidden

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

413 files changed

+5024
-10053
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 632d48640113ab75833f5b2ae613532b8209c9b2
8+
refs/heads/try2: d0f3cb05df41b14b58553fab6a533e0e4c947b06
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
#
6969
# * `TESTNAME=...` - Specify the name of tests to run
7070
# * `CHECK_IGNORED=1` - Run normally-ignored tests
71-
# * `PLEASE_BENCH=1` - Run crate benchmarks (enable `--bench` flag)
71+
# * `NO_BENCH=1` - Don't run crate benchmarks (disable `--bench` flag)
7272
#
7373
# * `CFG_ENABLE_VALGRIND=1` - Run tests under valgrind
7474
# * `VALGRIND_COMPILE=1` - Run the compiler itself under valgrind

branches/try2/man/rustc.1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ A space-separated list of arguments to pass through to LLVM.
138138
If specified, the compiler will save more files (.bc, .o, .no-opt.bc) generated
139139
throughout compilation in the output directory.
140140
.TP
141+
\fBandroid-cross-path\fR=path/to/ndk/bin
142+
Directory to find the Android NDK cross-compilation tools
143+
.TP
141144
\fBno-rpath\fR
142145
If specified, then the rpath value for dynamic libraries will not be set in
143146
either dynamic library or executable outputs.

branches/try2/mk/crates.mk

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,19 @@
5151

5252
TARGET_CRATES := libc std green rustuv native flate arena glob term semver \
5353
uuid serialize sync getopts collections num test time rand \
54-
workcache url log regex graphviz core rlibc
54+
workcache url log regex graphviz core
5555
HOST_CRATES := syntax rustc rustdoc fourcc hexfloat regex_macros fmt_macros
5656
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5757
TOOLS := compiletest rustdoc rustc
5858

5959
DEPS_core :=
60-
DEPS_rlibc :=
6160
DEPS_std := core libc native:rustrt native:compiler-rt native:backtrace native:jemalloc
62-
DEPS_graphviz := std
6361
DEPS_green := std rand native:context_switch
6462
DEPS_rustuv := std native:uv native:uv_support
6563
DEPS_native := std
6664
DEPS_syntax := std term serialize collections log fmt_macros
6765
DEPS_rustc := syntax native:rustllvm flate arena serialize sync getopts \
68-
collections time log graphviz
66+
collections time log
6967
DEPS_rustdoc := rustc native:hoedown serialize sync getopts collections \
7068
test time
7169
DEPS_flate := std native:miniz
@@ -82,7 +80,7 @@ DEPS_collections := std rand
8280
DEPS_fourcc := syntax std
8381
DEPS_hexfloat := syntax std
8482
DEPS_num := std rand
85-
DEPS_test := std collections getopts serialize term time regex
83+
DEPS_test := std collections getopts serialize term time
8684
DEPS_time := std serialize
8785
DEPS_rand := std
8886
DEPS_url := std collections
@@ -100,7 +98,6 @@ TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs
10098
TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
10199

102100
ONLY_RLIB_core := 1
103-
ONLY_RLIB_rlibc := 1
104101

105102
################################################################################
106103
# You should not need to edit below this line

branches/try2/mk/docs.mk

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ DOCS := index intro tutorial guide-ffi guide-macros guide-lifetimes \
3030
guide-tasks guide-container guide-pointers guide-testing \
3131
guide-runtime complement-bugreport complement-cheatsheet \
3232
complement-lang-faq complement-project-faq rust rustdoc \
33-
guide-unsafe
33+
guide-unsafe not_found
3434

3535
PDF_DOCS := tutorial rust
3636

@@ -42,11 +42,10 @@ L10N_LANGS := ja
4242
# Generally no need to edit below here.
4343

4444
# The options are passed to the documentation generators.
45-
RUSTDOC_HTML_OPTS_NO_CSS = --markdown-before-content=doc/version_info.html \
45+
RUSTDOC_HTML_OPTS = --markdown-css rust.css \
46+
--markdown-before-content=doc/version_info.html \
4647
--markdown-in-header=doc/favicon.inc --markdown-after-content=doc/footer.inc
4748

48-
RUSTDOC_HTML_OPTS = $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css rust.css
49-
5049
PANDOC_BASE_OPTS := --standalone --toc --number-sections
5150
PANDOC_TEX_OPTS = $(PANDOC_BASE_OPTS) --include-before-body=doc/version.tex \
5251
--from=markdown --include-before-body=doc/footer.tex --to=latex
@@ -153,11 +152,6 @@ doc/footer.tex: $(D)/footer.inc | doc/
153152
@$(call E, pandoc: $@)
154153
$(CFG_PANDOC) --from=html --to=latex $< --output=$@
155154

156-
# HTML (rustdoc)
157-
DOC_TARGETS += doc/not_found.html
158-
doc/not_found.html: $(D)/not_found.md $(HTML_DEPS) | doc/
159-
$(RUSTDOC) $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css http://static.rust-lang.org/doc/master/rust.css $<
160-
161155
define DEF_DOC
162156

163157
# HTML (rustdoc)

branches/try2/mk/platform.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ CFG_LDPATH_arm-linux-androideabi :=
307307
CFG_RUN_arm-linux-androideabi=
308308
CFG_RUN_TARG_arm-linux-androideabi=
309309
RUSTC_FLAGS_arm-linux-androideabi :=
310-
RUSTC_CROSS_FLAGS_arm-linux-androideabi :=
310+
RUSTC_CROSS_FLAGS_arm-linux-androideabi :=-C android-cross-path=$(CFG_ANDROID_CROSS_PATH)
311311

312312
# arm-unknown-linux-gnueabihf configuration
313313
CROSS_PREFIX_arm-unknown-linux-gnueabihf=arm-linux-gnueabihf-

branches/try2/mk/tests.mk

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ ifdef CHECK_IGNORED
3232
TESTARGS += --ignored
3333
endif
3434

35-
TEST_BENCH =
35+
TEST_BENCH = --bench
3636

3737
# Arguments to the cfail/rfail/rpass/bench tests
3838
ifdef CFG_VALGRIND
3939
CTEST_RUNTOOL = --runtool "$(CFG_VALGRIND)"
4040
TEST_BENCH =
4141
endif
4242

43-
ifdef PLEASE_BENCH
44-
TEST_BENCH = --bench
43+
ifdef NO_BENCH
44+
TEST_BENCH =
4545
endif
4646

4747
# Arguments to the perf tests
@@ -601,7 +601,6 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
601601
--stage-id stage$(1)-$(2) \
602602
--target $(2) \
603603
--host $(3) \
604-
--android-cross-path=$(CFG_ANDROID_CROSS_PATH) \
605604
--adb-path=$(CFG_ADB) \
606605
--adb-test-dir=$(CFG_ADB_TEST_DIR) \
607606
--host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3))" \

branches/try2/src/compiletest/common.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
use std::from_str::FromStr;
1212
use std::fmt;
13-
use regex::Regex;
1413

1514
#[deriving(Clone, Eq)]
1615
pub enum Mode {
@@ -89,7 +88,7 @@ pub struct Config {
8988
pub run_ignored: bool,
9089

9190
// Only run tests that match this filter
92-
pub filter: Option<Regex>,
91+
pub filter: Option<~str>,
9392

9493
// Write out a parseable log of tests that were run
9594
pub logfile: Option<Path>,
@@ -127,9 +126,6 @@ pub struct Config {
127126
// Host triple for the compiler being invoked
128127
pub host: ~str,
129128

130-
// Path to the android tools
131-
pub android_cross_path: Path,
132-
133129
// Extra parameter to run adb on arm-linux-androideabi
134130
pub adb_path: ~str,
135131

branches/try2/src/compiletest/compiletest.rs

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ extern crate log;
2323
extern crate green;
2424
extern crate rustuv;
2525

26-
extern crate regex;
27-
2826
use std::os;
2927
use std::io;
3028
use std::io::fs;
@@ -81,7 +79,6 @@ pub fn parse_config(args: Vec<~str> ) -> Config {
8179
optflag("", "jit", "run tests under the JIT"),
8280
optopt("", "target", "the target to build for", "TARGET"),
8381
optopt("", "host", "the host to build for", "HOST"),
84-
optopt("", "android-cross-path", "Android NDK standalone path", "PATH"),
8582
optopt("", "adb-path", "path to the android debugger", "PATH"),
8683
optopt("", "adb-test-dir", "path to tests for the android debugger", "PATH"),
8784
optopt("", "lldb-python-dir", "directory containing LLDB's python module", "PATH"),
@@ -115,19 +112,6 @@ pub fn parse_config(args: Vec<~str> ) -> Config {
115112
Path::new(m.opt_str(nm).unwrap())
116113
}
117114

118-
let filter = if !matches.free.is_empty() {
119-
let s = matches.free.get(0).as_slice();
120-
match regex::Regex::new(s) {
121-
Ok(re) => Some(re),
122-
Err(e) => {
123-
println!("failed to parse filter /{}/: {}", s, e);
124-
fail!()
125-
}
126-
}
127-
} else {
128-
None
129-
};
130-
131115
Config {
132116
compile_lib_path: matches.opt_str("compile-lib-path").unwrap(),
133117
run_lib_path: matches.opt_str("run-lib-path").unwrap(),
@@ -140,7 +124,12 @@ pub fn parse_config(args: Vec<~str> ) -> Config {
140124
stage_id: matches.opt_str("stage-id").unwrap(),
141125
mode: FromStr::from_str(matches.opt_str("mode").unwrap()).expect("invalid mode"),
142126
run_ignored: matches.opt_present("ignored"),
143-
filter: filter,
127+
filter:
128+
if !matches.free.is_empty() {
129+
Some((*matches.free.get(0)).clone())
130+
} else {
131+
None
132+
},
144133
logfile: matches.opt_str("logfile").map(|s| Path::new(s)),
145134
save_metrics: matches.opt_str("save-metrics").map(|s| Path::new(s)),
146135
ratchet_metrics:
@@ -153,7 +142,6 @@ pub fn parse_config(args: Vec<~str> ) -> Config {
153142
jit: matches.opt_present("jit"),
154143
target: opt_str2(matches.opt_str("target")).to_str(),
155144
host: opt_str2(matches.opt_str("host")).to_str(),
156-
android_cross_path: opt_path(matches, "android-cross-path"),
157145
adb_path: opt_str2(matches.opt_str("adb-path")).to_str(),
158146
adb_test_dir:
159147
opt_str2(matches.opt_str("adb-test-dir")).to_str(),
@@ -162,8 +150,7 @@ pub fn parse_config(args: Vec<~str> ) -> Config {
162150
"(none)" != opt_str2(matches.opt_str("adb-test-dir")) &&
163151
!opt_str2(matches.opt_str("adb-test-dir")).is_empty(),
164152
lldb_python_dir: matches.opt_str("lldb-python-dir"),
165-
test_shard: test::opt_shard(matches.opt_str("test-shard")
166-
.map(|x| x.to_strbuf())),
153+
test_shard: test::opt_shard(matches.opt_str("test-shard")),
167154
verbose: matches.opt_present("verbose")
168155
}
169156
}
@@ -179,14 +166,13 @@ pub fn log_config(config: &Config) {
179166
logv(c, format!("stage_id: {}", config.stage_id));
180167
logv(c, format!("mode: {}", config.mode));
181168
logv(c, format!("run_ignored: {}", config.run_ignored));
182-
logv(c, format!("filter: {}", opt_str(&config.filter.as_ref().map(|re| re.to_str()))));
169+
logv(c, format!("filter: {}", opt_str(&config.filter)));
183170
logv(c, format!("runtool: {}", opt_str(&config.runtool)));
184171
logv(c, format!("host-rustcflags: {}", opt_str(&config.host_rustcflags)));
185172
logv(c, format!("target-rustcflags: {}", opt_str(&config.target_rustcflags)));
186173
logv(c, format!("jit: {}", config.jit));
187174
logv(c, format!("target: {}", config.target));
188175
logv(c, format!("host: {}", config.host));
189-
logv(c, format!("android-cross-path: {}", config.android_cross_path.display()));
190176
logv(c, format!("adb_path: {}", config.adb_path));
191177
logv(c, format!("adb_test_dir: {}", config.adb_test_dir));
192178
logv(c, format!("adb_device_status: {}", config.adb_device_status));
@@ -246,10 +232,7 @@ pub fn run_tests(config: &Config) {
246232

247233
pub fn test_opts(config: &Config) -> test::TestOpts {
248234
test::TestOpts {
249-
filter: match config.filter {
250-
None => None,
251-
Some(ref filter) => Some(filter.clone()),
252-
},
235+
filter: config.filter.clone(),
253236
run_ignored: config.run_ignored,
254237
logfile: config.logfile.clone(),
255238
run_tests: true,
@@ -328,9 +311,7 @@ pub fn make_test_name(config: &Config, testfile: &Path) -> test::TestName {
328311
format!("{}/{}", dir.unwrap_or(""), filename.unwrap_or(""))
329312
}
330313

331-
test::DynTestName(format_strbuf!("[{}] {}",
332-
config.mode,
333-
shorten(testfile)))
314+
test::DynTestName(format!("[{}] {}", config.mode, shorten(testfile)))
334315
}
335316

336317
pub fn make_test_closure(config: &Config, testfile: &Path) -> test::TestFn {

branches/try2/src/compiletest/procsrv.rs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use std::os;
1212
use std::str;
13-
use std::io::process::{ProcessExit, Command, Process, ProcessOutput};
13+
use std::io::process::{ProcessExit, Process, ProcessConfig, ProcessOutput};
1414

1515
#[cfg(target_os = "win32")]
1616
fn target_env(lib_path: &str, prog: &str) -> Vec<(~str, ~str)> {
@@ -68,7 +68,14 @@ pub fn run(lib_path: &str,
6868
input: Option<~str>) -> Option<Result> {
6969

7070
let env = env.clone().append(target_env(lib_path, prog).as_slice());
71-
match Command::new(prog).args(args).env(env.as_slice()).spawn() {
71+
let opt_process = Process::configure(ProcessConfig {
72+
program: prog,
73+
args: args,
74+
env: Some(env.as_slice()),
75+
.. ProcessConfig::new()
76+
});
77+
78+
match opt_process {
7279
Ok(mut process) => {
7380
for input in input.iter() {
7481
process.stdin.get_mut_ref().write(input.as_bytes()).unwrap();
@@ -93,7 +100,14 @@ pub fn run_background(lib_path: &str,
93100
input: Option<~str>) -> Option<Process> {
94101

95102
let env = env.clone().append(target_env(lib_path, prog).as_slice());
96-
match Command::new(prog).args(args).env(env.as_slice()).spawn() {
103+
let opt_process = Process::configure(ProcessConfig {
104+
program: prog,
105+
args: args,
106+
env: Some(env.as_slice()),
107+
.. ProcessConfig::new()
108+
});
109+
110+
match opt_process {
97111
Ok(mut process) => {
98112
for input in input.iter() {
99113
process.stdin.get_mut_ref().write(input.as_bytes()).unwrap();

branches/try2/src/compiletest/runtest.rs

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,18 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
347347
break;
348348
}
349349

350-
let tool_path = match config.android_cross_path.as_str() {
351-
Some(x) => x.to_strbuf(),
352-
None => fatal("cannot find android cross path".to_owned())
353-
};
350+
let args = split_maybe_args(&config.target_rustcflags);
351+
let mut tool_path = StrBuf::new();
352+
for arg in args.iter() {
353+
if arg.contains("android-cross-path=") {
354+
tool_path = StrBuf::from_str(arg.replace("android-cross-path=", ""));
355+
break;
356+
}
357+
}
358+
359+
if tool_path.is_empty() {
360+
fatal("cannot found android cross path".to_owned());
361+
}
354362

355363
let debugger_script = make_out_name(config, testfile, "debugger.script");
356364
// FIXME (#9639): This needs to handle non-utf8 paths
@@ -420,7 +428,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
420428
}
421429

422430
fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path) {
423-
use std::io::process::{Command, ProcessOutput};
431+
use std::io::process::{Process, ProcessConfig, ProcessOutput};
424432

425433
if config.lldb_python_dir.is_none() {
426434
fatal("Can't run LLDB test because LLDB's python path is not set.".to_owned());
@@ -483,13 +491,25 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
483491

484492
fn run_lldb(config: &Config, test_executable: &Path, debugger_script: &Path) -> ProcRes {
485493
// Prepare the lldb_batchmode which executes the debugger script
486-
let mut cmd = Command::new("python");
487-
cmd.arg("./src/etc/lldb_batchmode.py")
488-
.arg(test_executable)
489-
.arg(debugger_script)
490-
.env([("PYTHONPATH", config.lldb_python_dir.clone().unwrap().as_slice())]);
491-
492-
let (status, out, err) = match cmd.spawn() {
494+
let lldb_batchmode_script = "./src/etc/lldb_batchmode.py".to_owned();
495+
let test_executable_str = test_executable.as_str().unwrap().to_owned();
496+
let debugger_script_str = debugger_script.as_str().unwrap().to_owned();
497+
let commandline = format!("python {} {} {}",
498+
lldb_batchmode_script.as_slice(),
499+
test_executable_str.as_slice(),
500+
debugger_script_str.as_slice());
501+
502+
let args = &[lldb_batchmode_script, test_executable_str, debugger_script_str];
503+
let env = &[("PYTHONPATH".to_owned(), config.lldb_python_dir.clone().unwrap())];
504+
505+
let opt_process = Process::configure(ProcessConfig {
506+
program: "python",
507+
args: args,
508+
env: Some(env),
509+
.. ProcessConfig::new()
510+
});
511+
512+
let (status, out, err) = match opt_process {
493513
Ok(process) => {
494514
let ProcessOutput { status, output, error } =
495515
process.wait_with_output().unwrap();
@@ -508,7 +528,7 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
508528
status: status,
509529
stdout: out,
510530
stderr: err,
511-
cmdline: format!("{}", cmd)
531+
cmdline: commandline
512532
};
513533
}
514534
}

branches/try2/src/doc/complement-cheatsheet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ To return an Owned String (~str) use the str helper function [`from_utf8_owned`]
6060
~~~
6161
use std::str;
6262
63-
let x: Option<~str> = str::from_utf8_owned(~[104u8,105u8]);
63+
let x: Result<~str,~[u8]> = str::from_utf8_owned(~[104u8,105u8]);
6464
let y: ~str = x.unwrap();
6565
~~~
6666

0 commit comments

Comments
 (0)