Skip to content

Commit 702f215

Browse files
committed
---
yaml --- r: 92296 b: refs/heads/auto c: d7c9493 h: refs/heads/master v: v3
1 parent cc2395d commit 702f215

File tree

15 files changed

+156
-287
lines changed

15 files changed

+156
-287
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: ca54ad8592087dfe7d2b422f35d75f3932c1991b
16+
refs/heads/auto: d7c949368c0df7a17a87e0597e4948c533ecac43
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/compiletest/procsrv.rs

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -46,57 +46,47 @@ pub fn run(lib_path: &str,
4646
prog: &str,
4747
args: &[~str],
4848
env: ~[(~str, ~str)],
49-
input: Option<~str>) -> Option<Result> {
49+
input: Option<~str>) -> Result {
5050

5151
let env = env + target_env(lib_path, prog);
52-
let mut opt_process = run::Process::new(prog, args, run::ProcessOptions {
52+
let mut process = run::Process::new(prog, args, run::ProcessOptions {
5353
env: Some(env),
5454
dir: None,
5555
in_fd: None,
5656
out_fd: None,
5757
err_fd: None
5858
});
5959

60-
match opt_process {
61-
Some(ref mut process) => {
62-
for input in input.iter() {
63-
process.input().write(input.as_bytes());
64-
}
65-
let run::ProcessOutput { status, output, error } = process.finish_with_output();
60+
for input in input.iter() {
61+
process.input().write(input.as_bytes());
62+
}
63+
let run::ProcessOutput { status, output, error } = process.finish_with_output();
6664

67-
Some(Result {
68-
status: status,
69-
out: str::from_utf8_owned(output),
70-
err: str::from_utf8_owned(error)
71-
})
72-
},
73-
None => None
65+
Result {
66+
status: status,
67+
out: str::from_utf8_owned(output),
68+
err: str::from_utf8_owned(error)
7469
}
7570
}
7671

7772
pub fn run_background(lib_path: &str,
7873
prog: &str,
7974
args: &[~str],
8075
env: ~[(~str, ~str)],
81-
input: Option<~str>) -> Option<run::Process> {
76+
input: Option<~str>) -> run::Process {
8277

8378
let env = env + target_env(lib_path, prog);
84-
let opt_process = run::Process::new(prog, args, run::ProcessOptions {
79+
let mut process = run::Process::new(prog, args, run::ProcessOptions {
8580
env: Some(env),
8681
dir: None,
8782
in_fd: None,
8883
out_fd: None,
8984
err_fd: None
9085
});
9186

92-
match opt_process {
93-
Some(mut process) => {
94-
for input in input.iter() {
95-
process.input().write(input.as_bytes());
96-
}
97-
98-
Some(process)
99-
},
100-
None => None
87+
for input in input.iter() {
88+
process.input().write(input.as_bytes());
10189
}
90+
91+
return process;
10292
}

branches/auto/src/compiletest/runtest.rs

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -289,23 +289,20 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
289289
dump_output_file(config, testfile, script_str, "debugger.script");
290290

291291

292-
procsrv::run("", config.adb_path,
292+
procsrv::run("", config.adb_path.clone(),
293293
[~"push", exe_file.as_str().unwrap().to_owned(), config.adb_test_dir.clone()],
294-
~[(~"",~"")], Some(~""))
295-
.expect(format!("failed to exec `{}`", config.adb_path));
294+
~[(~"",~"")], Some(~""));
296295

297296
procsrv::run("", config.adb_path,
298297
[~"forward", ~"tcp:5039", ~"tcp:5039"],
299-
~[(~"",~"")], Some(~""))
300-
.expect(format!("failed to exec `{}`", config.adb_path));
298+
~[(~"",~"")], Some(~""));
301299

302300
let adb_arg = format!("export LD_LIBRARY_PATH={}; gdbserver :5039 {}/{}",
303301
config.adb_test_dir.clone(), config.adb_test_dir.clone(),
304302
str::from_utf8(exe_file.filename().unwrap()));
305303

306-
let mut process = procsrv::run_background("", config.adb_path,
307-
[~"shell",adb_arg.clone()],~[(~"",~"")], Some(~""))
308-
.expect(format!("failed to exec `{}`", config.adb_path));
304+
let mut process = procsrv::run_background("", config.adb_path.clone(),
305+
[~"shell",adb_arg.clone()],~[(~"",~"")], Some(~""));
309306
loop {
310307
//waiting 1 second for gdbserver start
311308
timer::sleep(1000);
@@ -337,12 +334,10 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
337334
let debugger_opts = ~[~"-quiet", ~"-batch", ~"-nx",
338335
"-command=" + debugger_script.as_str().unwrap().to_owned()];
339336

340-
let gdb_path = tool_path.append("/bin/arm-linux-androideabi-gdb");
341337
let procsrv::Result{ out, err, status }=
342338
procsrv::run("",
343-
gdb_path,
344-
debugger_opts, ~[(~"",~"")], None)
345-
.expect(format!("failed to exec `{}`", gdb_path));
339+
tool_path.append("/bin/arm-linux-androideabi-gdb"),
340+
debugger_opts, ~[(~"",~"")], None);
346341
let cmdline = {
347342
let cmdline = make_cmdline("", "arm-linux-androideabi-gdb", debugger_opts);
348343
logv(config, format!("executing {}", cmdline));
@@ -805,8 +800,7 @@ fn program_output(config: &config, testfile: &Path, lib_path: &str, prog: ~str,
805800
cmdline
806801
};
807802
let procsrv::Result{ out, err, status } =
808-
procsrv::run(lib_path, prog, args, env, input)
809-
.expect(format!("failed to exec `{}`", prog));
803+
procsrv::run(lib_path, prog, args, env, input);
810804
dump_output(config, testfile, out, err);
811805
return ProcRes {status: status,
812806
stdout: out,
@@ -914,8 +908,7 @@ fn _arm_exec_compiled_test(config: &config, props: &TestProps,
914908
// copy to target
915909
let copy_result = procsrv::run("", config.adb_path,
916910
[~"push", args.prog.clone(), config.adb_test_dir.clone()],
917-
~[(~"",~"")], Some(~""))
918-
.expect(format!("failed to exec `{}`", config.adb_path));
911+
~[(~"",~"")], Some(~""));
919912

920913
if config.verbose {
921914
println!("push ({}) {} {} {}",
@@ -939,8 +932,7 @@ fn _arm_exec_compiled_test(config: &config, props: &TestProps,
939932
for tv in args.args.iter() {
940933
runargs.push(tv.to_owned());
941934
}
942-
procsrv::run("", config.adb_path, runargs, ~[(~"",~"")], Some(~""))
943-
.expect(format!("failed to exec `{}`", config.adb_path));
935+
procsrv::run("", config.adb_path, runargs, ~[(~"",~"")], Some(~""));
944936

945937
// get exitcode of result
946938
runargs = ~[];
@@ -950,8 +942,7 @@ fn _arm_exec_compiled_test(config: &config, props: &TestProps,
950942

951943
let procsrv::Result{ out: exitcode_out, err: _, status: _ } =
952944
procsrv::run("", config.adb_path, runargs, ~[(~"",~"")],
953-
Some(~""))
954-
.expect(format!("failed to exec `{}`", config.adb_path));
945+
Some(~""));
955946

956947
let mut exitcode : int = 0;
957948
for c in exitcode_out.chars() {
@@ -969,8 +960,7 @@ fn _arm_exec_compiled_test(config: &config, props: &TestProps,
969960
runargs.push(format!("{}/{}.stdout", config.adb_test_dir, prog_short));
970961

971962
let procsrv::Result{ out: stdout_out, err: _, status: _ } =
972-
procsrv::run("", config.adb_path, runargs, ~[(~"",~"")], Some(~""))
973-
.expect(format!("failed to exec `{}`", config.adb_path));
963+
procsrv::run("", config.adb_path, runargs, ~[(~"",~"")], Some(~""));
974964

975965
// get stderr of result
976966
runargs = ~[];
@@ -979,8 +969,7 @@ fn _arm_exec_compiled_test(config: &config, props: &TestProps,
979969
runargs.push(format!("{}/{}.stderr", config.adb_test_dir, prog_short));
980970

981971
let procsrv::Result{ out: stderr_out, err: _, status: _ } =
982-
procsrv::run("", config.adb_path, runargs, ~[(~"",~"")], Some(~""))
983-
.expect(format!("failed to exec `{}`", config.adb_path));
972+
procsrv::run("", config.adb_path, runargs, ~[(~"",~"")], Some(~""));
984973

985974
dump_output(config, testfile, stdout_out, stderr_out);
986975

@@ -1015,8 +1004,7 @@ fn _arm_push_aux_shared_library(config: &config, testfile: &Path) {
10151004
// FIXME (#9639): This needs to handle non-utf8 paths
10161005
let copy_result = procsrv::run("", config.adb_path,
10171006
[~"push", file.as_str().unwrap().to_owned(), config.adb_test_dir.clone()],
1018-
~[(~"",~"")], Some(~""))
1019-
.expect(format!("failed to exec `{}`", config.adb_path));
1007+
~[(~"",~"")], Some(~""));
10201008

10211009
if config.verbose {
10221010
println!("push ({}) {} {} {}",

branches/auto/src/etc/emacs/rust-mode.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
"if" "impl" "in"
135135
"let" "loop"
136136
"match" "mod" "mut"
137-
"priv" "pub"
137+
"priv" "proc" "pub"
138138
"ref" "return"
139139
"self" "static" "struct" "super"
140140
"true" "trait" "type"

branches/auto/src/libextra/test.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,15 +1110,6 @@ impl BenchHarness {
11101110
} else {
11111111
n = 1_000_000 / self.ns_per_iter().max(&1);
11121112
}
1113-
// if the first run took more than 1ms we don't want to just
1114-
// be left doing 0 iterations on every loop. The unfortunate
1115-
// side effect of not being able to do as many runs is
1116-
// automatically handled by the statistical analysis below
1117-
// (i.e. larger error bars).
1118-
if n == 0 { n = 1; }
1119-
1120-
debug!("Initial run took {} ns, iter count that takes 1ms estimated as {}",
1121-
self.ns_per_iter(), n);
11221113
11231114
let mut total_run = 0;
11241115
let samples : &mut [f64] = [0.0_f64, ..50];
@@ -1150,7 +1141,7 @@ impl BenchHarness {
11501141
let now = precise_time_ns();
11511142
let loop_run = now - loop_start;
11521143
1153-
// If we've run for 100ms and seem to have converged to a
1144+
// If we've run for 100ms an seem to have converged to a
11541145
// stable median.
11551146
if loop_run > 100_000_000 &&
11561147
summ.median_abs_dev_pct < 1.0 &&

branches/auto/src/librustc/back/archive.rs

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,15 @@ fn run_ar(sess: Session, args: &str, cwd: Option<&Path>,
4040
Some(p) => { debug!("inside {}", p.display()); }
4141
None => {}
4242
}
43-
let mut opt_prog = Process::new(ar, args.as_slice(), opts);
44-
match opt_prog {
45-
Some(ref mut prog) => {
46-
let o = prog.finish_with_output();
47-
if !o.status.success() {
48-
sess.err(format!("{} {} failed with: {}", ar, args.connect(" "),
49-
o.status));
50-
sess.note(format!("stdout ---\n{}", str::from_utf8(o.output)));
51-
sess.note(format!("stderr ---\n{}", str::from_utf8(o.error)));
52-
sess.abort_if_errors();
53-
}
54-
o
55-
},
56-
None => {
57-
sess.err(format!("could not exec `{}`", ar));
58-
sess.abort_if_errors();
59-
fail!("rustc::back::archive::run_ar() should not reach this point");
60-
}
43+
let o = Process::new(ar, args.as_slice(), opts).finish_with_output();
44+
if !o.status.success() {
45+
sess.err(format!("{} {} failed with: {}", ar, args.connect(" "),
46+
o.status));
47+
sess.note(format!("stdout ---\n{}", str::from_utf8(o.output)));
48+
sess.note(format!("stderr ---\n{}", str::from_utf8(o.error)));
49+
sess.abort_if_errors();
6150
}
51+
o
6252
}
6353

6454
impl Archive {

branches/auto/src/librustc/back/link.rs

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -310,19 +310,13 @@ pub mod write {
310310
assembly.as_str().unwrap().to_owned()];
311311

312312
debug!("{} '{}'", cc, args.connect("' '"));
313-
match run::process_output(cc, args) {
314-
Some(prog) => {
315-
if !prog.status.success() {
316-
sess.err(format!("linking with `{}` failed: {}", cc, prog.status));
317-
sess.note(format!("{} arguments: '{}'", cc, args.connect("' '")));
318-
sess.note(str::from_utf8_owned(prog.error + prog.output));
319-
sess.abort_if_errors();
320-
}
321-
},
322-
None => {
323-
sess.err(format!("could not exec `{}`", cc));
324-
sess.abort_if_errors();
325-
}
313+
let prog = run::process_output(cc, args);
314+
315+
if !prog.status.success() {
316+
sess.err(format!("linking with `{}` failed: {}", cc, prog.status));
317+
sess.note(format!("{} arguments: '{}'", cc, args.connect("' '")));
318+
sess.note(str::from_utf8_owned(prog.error + prog.output));
319+
sess.abort_if_errors();
326320
}
327321
}
328322

@@ -955,22 +949,14 @@ fn link_natively(sess: Session, dylib: bool, obj_filename: &Path,
955949

956950
// Invoke the system linker
957951
debug!("{} {}", cc_prog, cc_args.connect(" "));
958-
let opt_prog = time(sess.time_passes(), "running linker", (), |()|
959-
run::process_output(cc_prog, cc_args));
960-
961-
match opt_prog {
962-
Some(prog) => {
963-
if !prog.status.success() {
964-
sess.err(format!("linking with `{}` failed: {}", cc_prog, prog.status));
965-
sess.note(format!("{} arguments: '{}'", cc_prog, cc_args.connect("' '")));
966-
sess.note(str::from_utf8_owned(prog.error + prog.output));
967-
sess.abort_if_errors();
968-
}
969-
},
970-
None => {
971-
sess.err(format!("could not exec `{}`", cc_prog));
972-
sess.abort_if_errors();
973-
}
952+
let prog = time(sess.time_passes(), "running linker", (), |()|
953+
run::process_output(cc_prog, cc_args));
954+
955+
if !prog.status.success() {
956+
sess.err(format!("linking with `{}` failed: {}", cc_prog, prog.status));
957+
sess.note(format!("{} arguments: '{}'", cc_prog, cc_args.connect("' '")));
958+
sess.note(str::from_utf8_owned(prog.error + prog.output));
959+
sess.abort_if_errors();
974960
}
975961

976962

branches/auto/src/librustpkg/api.rs

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,14 @@ pub fn install_pkg(cx: &BuildContext,
142142
/// Builds an arbitrary library whose short name is `output`,
143143
/// by invoking `tool` with arguments `args` plus "-o %s", where %s
144144
/// is the platform-specific library name for `output`.
145-
/// Returns that platform-specific name, or None if `tool` could not be started.
145+
/// Returns that platform-specific name.
146146
pub fn build_library_in_workspace(exec: &mut workcache::Exec,
147147
context: &mut Context,
148148
package_name: &str,
149149
tool: &str,
150150
flags: &[~str],
151151
paths: &[~str],
152-
output: &str) -> Option<~str> {
152+
output: &str) -> ~str {
153153
use command_failed = conditions::command_failed::cond;
154154

155155
let workspace = my_workspace(context, package_name);
@@ -169,20 +169,16 @@ pub fn build_library_in_workspace(exec: &mut workcache::Exec,
169169

170170
let all_args = flags + absolute_paths + cc_args +
171171
~[~"-o", out_name.as_str().unwrap().to_owned()];
172-
match run::process_status(tool, all_args) {
173-
Some(exit_process) => {
174-
if exit_process.success() {
175-
let out_name_str = out_name.as_str().unwrap().to_owned();
176-
exec.discover_output("binary",
177-
out_name_str,
178-
digest_only_date(&out_name));
179-
context.add_library_path(out_name.dir_path());
180-
Some(out_name_str)
181-
} else {
182-
Some(command_failed.raise((tool.to_owned(), all_args, exit_process)))
183-
}
184-
},
185-
None => None
172+
let exit_process = run::process_status(tool, all_args);
173+
if exit_process.success() {
174+
let out_name_str = out_name.as_str().unwrap().to_owned();
175+
exec.discover_output("binary",
176+
out_name_str,
177+
digest_only_date(&out_name));
178+
context.add_library_path(out_name.dir_path());
179+
out_name_str
180+
} else {
181+
command_failed.raise((tool.to_owned(), all_args, exit_process))
186182
}
187183
}
188184

0 commit comments

Comments
 (0)