Skip to content

Commit 7b7e3b6

Browse files
committed
---
yaml --- r: 77807 b: refs/heads/master c: 7c6c751 h: refs/heads/master i: 77805: 92f8093 77803: 6eaf538 77799: 55cd437 77791: 2aee5cd v: v3
1 parent a9f0605 commit 7b7e3b6

Some content is hidden

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

66 files changed

+1152
-1189
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 05bb4c4e1bea99295f93d9a2382f534d675daee0
2+
refs/heads/master: 7c6c7519a75064d11f855de862bcdaddcbe5df4b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 60fba4d7d677ec098e6a43014132fe99f7547363
55
refs/heads/try: ebfe63cd1c0b5d23f7ea60c69b4fde2e30cfd42a

trunk/.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
branch = master
55
[submodule "src/libuv"]
66
path = src/libuv
7-
url = https://github.com/alexcrichton/libuv.git
7+
url = https://github.com/brson/libuv.git
88
branch = master

trunk/mk/rt.mk

Lines changed: 10 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -168,58 +168,36 @@ LIBUV_DEPS := $$(wildcard \
168168
$$(S)src/libuv/*/*/*/*)
169169
endif
170170

171-
LIBUV_GYP := $$(S)src/libuv/build/gyp
172-
LIBUV_MAKEFILE_$(1)_$(2) := $$(CFG_BUILD_DIR)rt/$(1)/stage$(2)/libuv/Makefile
173-
LIBUV_NO_LOAD = run-benchmarks.target.mk run-tests.target.mk \
174-
uv_dtrace_header.target.mk uv_dtrace_provider.target.mk
175-
176-
ifeq ($(OSTYPE_$(1)), linux-androideabi)
177-
$$(LIBUV_MAKEFILE_$(1)_$(2)): $$(LIBUV_GYP)
178-
(cd $(S)src/libuv/ && \
179-
$$(CFG_PYTHON) ./gyp_uv -f make -Dtarget_arch=$$(LIBUV_ARCH_$(1)) -D ninja -DOS=android \
180-
-Goutput_dir=$$(@D) --generator-output $$(@D))
181-
else
182-
$$(LIBUV_MAKEFILE_$(1)_$(2)): $$(LIBUV_GYP)
183-
(cd $(S)src/libuv/ && \
184-
$$(CFG_PYTHON) ./gyp_uv -f make -Dtarget_arch=$$(LIBUV_ARCH_$(1)) -D ninja \
185-
-Goutput_dir=$$(@D) --generator-output $$(@D))
186-
endif
187-
188171
# XXX: Shouldn't need platform-specific conditions here
189172
ifdef CFG_WINDOWSY_$(1)
190173
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
191-
$$(Q)rm -f $$(S)src/libuv/libuv.a
192-
$$(Q)$$(MAKE) -C $$(S)src/libuv -f Makefile.mingw \
193-
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
194-
AR="$$(AR_$(1))" \
174+
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
175+
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
176+
OS=mingw \
195177
V=$$(VERBOSE)
196-
$$(Q)cp $$(S)src/libuv/libuv.a $$@
197178
else ifeq ($(OSTYPE_$(1)), linux-androideabi)
198-
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)_$(2))
199-
$$(Q)$$(MAKE) -C $$(@D) \
179+
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
180+
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
200181
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
201182
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1)))" \
202183
CC="$$(CC_$(1))" \
203184
CXX="$$(CXX_$(1))" \
204185
LINK="$$(CXX_$(1))" \
205186
AR="$$(AR_$(1))" \
206-
host=android OS=linux \
207187
PLATFORM=android \
208-
builddir="." \
209188
BUILDTYPE=Release \
210-
NO_LOAD="$$(LIBUV_NO_LOAD)" \
189+
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
190+
host=android OS=linux \
211191
V=$$(VERBOSE)
212192
else
213-
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)_$(2))
214-
$$(Q)$$(MAKE) -C $$(@D) \
193+
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
194+
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
215195
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
216196
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1)))" \
217197
CC="$$(CC_$(1))" \
218198
CXX="$$(CXX_$(1))" \
219199
AR="$$(AR_$(1))" \
220-
builddir="." \
221-
BUILDTYPE=Release \
222-
NO_LOAD="$$(LIBUV_NO_LOAD)" \
200+
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
223201
V=$$(VERBOSE)
224202
endif
225203

@@ -283,7 +261,3 @@ endef
283261
$(foreach stage,$(STAGES), \
284262
$(foreach target,$(CFG_TARGET_TRIPLES), \
285263
$(eval $(call DEF_RUNTIME_TARGETS,$(target),$(stage)))))
286-
287-
$(LIBUV_GYP):
288-
mkdir -p $(S)src/libuv/build
289-
git clone https://git.chromium.org/external/gyp.git $(S)src/libuv/build/gyp

trunk/mk/tests.mk

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -476,15 +476,15 @@ RFAIL_RC := $(wildcard $(S)src/test/run-fail/*.rc)
476476
RFAIL_RS := $(wildcard $(S)src/test/run-fail/*.rs)
477477
CFAIL_RC := $(wildcard $(S)src/test/compile-fail/*.rc)
478478
CFAIL_RS := $(wildcard $(S)src/test/compile-fail/*.rs)
479-
BENCH_RS := $(wildcard $(S)src/test/bench/*.rs)
479+
BENCH_RS := $(wildcard $(S)src/test/bench/rt/*.rs $(S)src/test/bench/shootout/*.rs $(S)src/test/bench/std/*.rs $(S)src/test/bench/*.rs)
480480
PRETTY_RS := $(wildcard $(S)src/test/pretty/*.rs)
481481
DEBUGINFO_RS := $(wildcard $(S)src/test/debug-info/*.rs)
482482
CODEGEN_RS := $(wildcard $(S)src/test/codegen/*.rs)
483483
CODEGEN_CC := $(wildcard $(S)src/test/codegen/*.cc)
484484

485485
# perf tests are the same as bench tests only they run under
486486
# a performance monitor.
487-
PERF_RS := $(wildcard $(S)src/test/bench/*.rs)
487+
PERF_RS := $(BENCH_RS)
488488

489489
RPASS_TESTS := $(RPASS_RC) $(RPASS_RS)
490490
RPASS_FULL_TESTS := $(RPASS_FULL_RC) $(RPASS_FULL_RS)
@@ -516,7 +516,7 @@ CTEST_BUILD_BASE_cfail = compile-fail
516516
CTEST_MODE_cfail = compile-fail
517517
CTEST_RUNTOOL_cfail = $(CTEST_RUNTOOL)
518518

519-
CTEST_SRC_BASE_bench = bench
519+
CTEST_SRC_BASE_bench = bench bench/rt bench/shootout bench/std
520520
CTEST_BUILD_BASE_bench = bench
521521
CTEST_MODE_bench = run-pass
522522
CTEST_RUNTOOL_bench = $(CTEST_RUNTOOL)
@@ -610,7 +610,8 @@ define DEF_RUN_COMPILETEST
610610

611611
CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
612612
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
613-
--src-base $$(S)src/test/$$(CTEST_SRC_BASE_$(4))/ \
613+
$(foreach base,$$(CTEST_SRC_BASE_$(4)), \
614+
--src-base $$(S)src/test/$$(base))/ \
614615
--build-base $(3)/test/$$(CTEST_BUILD_BASE_$(4))/ \
615616
--ratchet-metrics $(call TEST_RATCHET_FILE,$(1),$(2),$(3),$(4)) \
616617
--mode $$(CTEST_MODE_$(4)) \

trunk/src/compiletest/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub struct config {
3636
llvm_bin_path: Option<Path>,
3737

3838
// The directory containing the tests to run
39-
src_base: Path,
39+
src_base: ~[Path],
4040

4141
// The directory where programs should be built
4242
build_base: Path,

trunk/src/compiletest/compiletest.rs

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::os;
1919
use std::f64;
2020

2121
use extra::getopts;
22-
use extra::getopts::groups::{optopt, optflag, reqopt};
22+
use extra::getopts::groups::{optopt, optflag, reqopt, optmulti};
2323
use extra::test;
2424

2525
use common::config;
@@ -49,19 +49,19 @@ pub fn main() {
4949
pub fn parse_config(args: ~[~str]) -> config {
5050

5151
let groups : ~[getopts::groups::OptGroup] =
52-
~[reqopt("", "compile-lib-path", "path to host shared libraries", "PATH"),
53-
reqopt("", "run-lib-path", "path to target shared libraries", "PATH"),
54-
reqopt("", "rustc-path", "path to rustc to use for compiling", "PATH"),
55-
optopt("", "clang-path", "path to executable for codegen tests", "PATH"),
56-
optopt("", "llvm-bin-path", "path to directory holding llvm binaries", "DIR"),
57-
reqopt("", "src-base", "directory to scan for test files", "PATH"),
58-
reqopt("", "build-base", "directory to deposit test outputs", "PATH"),
59-
reqopt("", "aux-base", "directory to find auxiliary test files", "PATH"),
60-
reqopt("", "stage-id", "the target-stage identifier", "stageN-TARGET"),
61-
reqopt("", "mode", "which sort of compile tests to run",
62-
"(compile-fail|run-fail|run-pass|pretty|debug-info)"),
63-
optflag("", "ignored", "run tests marked as ignored / xfailed"),
64-
optopt("", "runtool", "supervisor program to run tests under \
52+
~[reqopt ("", "compile-lib-path", "path to host shared libraries", "PATH"),
53+
reqopt ("", "run-lib-path", "path to target shared libraries", "PATH"),
54+
reqopt ("", "rustc-path", "path to rustc to use for compiling", "PATH"),
55+
optopt ("", "clang-path", "path to executable for codegen tests", "PATH"),
56+
optopt ("", "llvm-bin-path", "path to directory holding llvm binaries", "DIR"),
57+
optmulti ("", "src-base", "directory to scan for test files", "PATH"),
58+
reqopt ("", "build-base", "directory to deposit test outputs", "PATH"),
59+
reqopt ("", "aux-base", "directory to find auxiliary test files", "PATH"),
60+
reqopt ("", "stage-id", "the target-stage identifier", "stageN-TARGET"),
61+
reqopt ("", "mode", "which sort of compile tests to run",
62+
" (compile-fail|run-fail|run-pass|pretty|debug-info)"),
63+
optflag ("", "ignored", "run tests marked as ignored / xfailed"),
64+
optopt ("", "runtool", "supervisor program to run tests under \
6565
(eg. emulator, valgrind)", "PROGRAM"),
6666
optopt("", "rustcflags", "flags to pass to rustc", "FLAGS"),
6767
optflag("", "verbose", "run tests verbosely, showing all output"),
@@ -106,13 +106,15 @@ pub fn parse_config(args: ~[~str]) -> config {
106106
Path(getopts::opt_str(m, nm))
107107
}
108108

109+
let src_base = getopts::opt_strs(matches, "src-base");
110+
109111
config {
110112
compile_lib_path: getopts::opt_str(matches, "compile-lib-path"),
111113
run_lib_path: getopts::opt_str(matches, "run-lib-path"),
112114
rustc_path: opt_path(matches, "rustc-path"),
113115
clang_path: getopts::opt_maybe_str(matches, "clang-path").map_move(|s| Path(s)),
114116
llvm_bin_path: getopts::opt_maybe_str(matches, "llvm-bin-path").map_move(|s| Path(s)),
115-
src_base: opt_path(matches, "src-base"),
117+
src_base: src_base.iter().map(|x| Path(x.clone())).collect(),
116118
build_base: opt_path(matches, "build-base"),
117119
aux_base: opt_path(matches, "aux-base"),
118120
stage_id: getopts::opt_str(matches, "stage-id"),
@@ -248,7 +250,7 @@ pub fn make_tests(config: &config) -> ~[test::TestDescAndFn] {
248250
debug!("making tests from %s",
249251
config.src_base.to_str());
250252
let mut tests = ~[];
251-
let dirs = os::list_dir_path(&config.src_base);
253+
let dirs = config.src_base.iter().flat_map(|x| os::list_dir_path(x).move_iter()).to_owned_vec();
252254
for file in dirs.iter() {
253255
let file = file.clone();
254256
debug!("inspecting file %s", file.to_str());

trunk/src/compiletest/procsrv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ pub fn run(lib_path: &str,
5454
in_fd: None,
5555
out_fd: None,
5656
err_fd: None
57-
}).unwrap();
57+
});
5858

5959
for input in input.iter() {
60-
proc.input().write(input.as_bytes());
60+
proc.input().write_str(*input);
6161
}
6262
let output = proc.finish_with_output();
6363

trunk/src/compiletest/runtest.rs

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,41 @@ use procsrv;
2020
use util;
2121
use util::logv;
2222

23+
use std::cell::Cell;
2324
use std::io;
2425
use std::os;
2526
use std::str;
27+
use std::task::{spawn_sched, SingleThreaded};
2628
use std::vec;
29+
use std::unstable::running_on_valgrind;
2730

2831
use extra::test::MetricMap;
2932

3033
pub fn run(config: config, testfile: ~str) {
31-
let mut _mm = MetricMap::new();
32-
run_metrics(config, testfile, &mut _mm);
34+
let config = Cell::new(config);
35+
let testfile = Cell::new(testfile);
36+
// FIXME #6436: Creating another thread to run the test because this
37+
// is going to call waitpid. The new scheduler has some strange
38+
// interaction between the blocking tasks and 'friend' schedulers
39+
// that destroys parallelism if we let normal schedulers block.
40+
// It should be possible to remove this spawn once std::run is
41+
// rewritten to be non-blocking.
42+
//
43+
// We do _not_ create another thread if we're running on V because
44+
// it serializes all threads anyways.
45+
if running_on_valgrind() {
46+
let config = config.take();
47+
let testfile = testfile.take();
48+
let mut _mm = MetricMap::new();
49+
run_metrics(config, testfile, &mut _mm);
50+
} else {
51+
do spawn_sched(SingleThreaded) {
52+
let config = config.take();
53+
let testfile = testfile.take();
54+
let mut _mm = MetricMap::new();
55+
run_metrics(config, testfile, &mut _mm);
56+
}
57+
}
3358
}
3459

3560
pub fn run_metrics(config: config, testfile: ~str, mm: &mut MetricMap) {

trunk/src/librustdoc/markdown_writer.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ fn pandoc_writer(
104104
];
105105
106106
do generic_writer |markdown| {
107+
use std::io::WriterUtil;
108+
107109
debug!("pandoc cmd: %s", pandoc_cmd);
108110
debug!("pandoc args: %s", pandoc_args.connect(" "));
109111

110-
let proc = run::Process::new(pandoc_cmd, pandoc_args,
111-
run::ProcessOptions::new());
112-
let mut proc = proc.unwrap();
112+
let mut proc = run::Process::new(pandoc_cmd, pandoc_args, run::ProcessOptions::new());
113113

114-
proc.input().write(markdown.as_bytes());
114+
proc.input().write_str(markdown);
115115
let output = proc.finish_with_output();
116116

117117
debug!("pandoc result: %i", output.status);

trunk/src/librustpkg/source_control.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pub fn git_clone_general(source: &str, target: &Path, v: &Version) -> bool {
8989

9090
fn process_output_in_cwd(prog: &str, args: &[~str], cwd: &Path) -> ProcessOutput {
9191
let mut prog = Process::new(prog, args, ProcessOptions{ dir: Some(cwd)
92-
,..ProcessOptions::new()}).unwrap();
92+
,..ProcessOptions::new()});
9393
prog.finish_with_output()
9494
}
9595

trunk/src/librustpkg/tests.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,13 @@ fn mk_temp_workspace(short_name: &Path, version: &Version) -> Path {
112112

113113
fn run_git(args: &[~str], env: Option<~[(~str, ~str)]>, cwd: &Path, err_msg: &str) {
114114
let cwd = (*cwd).clone();
115-
let prog = run::Process::new("git", args, run::ProcessOptions {
115+
let mut prog = run::Process::new("git", args, run::ProcessOptions {
116116
env: env,
117117
dir: Some(&cwd),
118118
in_fd: None,
119119
out_fd: None,
120120
err_fd: None
121121
});
122-
let mut prog = prog.unwrap();
123122
let rslt = prog.finish_with_output();
124123
if rslt.status != 0 {
125124
fail!("%s [git returned %?, output = %s, error = %s]", err_msg,
@@ -227,7 +226,7 @@ fn command_line_test_with_env(args: &[~str], cwd: &Path, env: Option<~[(~str, ~s
227226
in_fd: None,
228227
out_fd: None,
229228
err_fd: None
230-
}).unwrap();
229+
});
231230
let output = prog.finish_with_output();
232231
debug!("Output from command %s with args %? was %s {%s}[%?]",
233232
cmd, args, str::from_bytes(output.output),
@@ -1028,17 +1027,16 @@ fn test_extern_mod() {
10281027
test_sysroot().to_str(),
10291028
exec_file.to_str());
10301029
1031-
let prog = run::Process::new(rustc.to_str(), [main_file.to_str(),
1032-
~"--sysroot", test_sysroot().to_str(),
1033-
~"-o", exec_file.to_str()],
1034-
run::ProcessOptions {
1030+
let mut prog = run::Process::new(rustc.to_str(), [main_file.to_str(),
1031+
~"--sysroot", test_sysroot().to_str(),
1032+
~"-o", exec_file.to_str()],
1033+
run::ProcessOptions {
10351034
env: env,
10361035
dir: Some(&dir),
10371036
in_fd: None,
10381037
out_fd: None,
10391038
err_fd: None
10401039
});
1041-
let mut prog = prog.unwrap();
10421040
let outp = prog.finish_with_output();
10431041
if outp.status != 0 {
10441042
fail!("output was %s, error was %s",

trunk/src/libstd/rt/io/file.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ pub struct FileStream {
7171
last_nread: int,
7272
}
7373

74+
impl FileStream {
75+
}
76+
7477
impl Reader for FileStream {
7578
fn read(&mut self, buf: &mut [u8]) -> Option<uint> {
7679
match self.fd.read(buf) {

trunk/src/libstd/rt/io/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,6 @@ pub use self::extensions::WriterByteConversions;
268268
/// Synchronous, non-blocking file I/O.
269269
pub mod file;
270270

271-
/// Synchronous, in-memory I/O.
272-
pub mod pipe;
273-
274271
/// Synchronous, non-blocking network I/O.
275272
pub mod net {
276273
pub mod tcp;

trunk/src/libstd/rt/io/net/tcp.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use rt::io::{io_error, read_error, EndOfFile};
1616
use rt::rtio::{IoFactory, IoFactoryObject,
1717
RtioSocket, RtioTcpListener,
1818
RtioTcpListenerObject, RtioTcpStream,
19-
RtioTcpStreamObject, RtioStream};
19+
RtioTcpStreamObject};
2020
use rt::local::Local;
2121

2222
pub struct TcpStream(~RtioTcpStreamObject);
@@ -69,7 +69,7 @@ impl TcpStream {
6969

7070
impl Reader for TcpStream {
7171
fn read(&mut self, buf: &mut [u8]) -> Option<uint> {
72-
match (***self).read(buf) {
72+
match (**self).read(buf) {
7373
Ok(read) => Some(read),
7474
Err(ioerr) => {
7575
// EOF is indicated by returning None
@@ -86,7 +86,7 @@ impl Reader for TcpStream {
8686

8787
impl Writer for TcpStream {
8888
fn write(&mut self, buf: &[u8]) {
89-
match (***self).write(buf) {
89+
match (**self).write(buf) {
9090
Ok(_) => (),
9191
Err(ioerr) => io_error::cond.raise(ioerr),
9292
}
@@ -166,7 +166,7 @@ mod test {
166166
do run_in_newsched_task {
167167
let mut called = false;
168168
do io_error::cond.trap(|e| {
169-
assert_eq!(e.kind, ConnectionRefused);
169+
assert!(e.kind == ConnectionRefused);
170170
called = true;
171171
}).inside {
172172
let addr = SocketAddr { ip: Ipv4Addr(0, 0, 0, 0), port: 1 };

0 commit comments

Comments
 (0)