Skip to content

Commit 261b9a3

Browse files
committed
---
yaml --- r: 144582 b: refs/heads/try2 c: fdcc415 h: refs/heads/master v: v3
1 parent cd0cb44 commit 261b9a3

Some content is hidden

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

101 files changed

+2525
-3879
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: 116c034791e094840bc7bccee48113426665bc9f
8+
refs/heads/try2: fdcc415957d94fff921e10b234ec3803b13cd9bc
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/.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/brson/libuv.git
7+
url = https://github.com/alexcrichton/libuv.git
88
branch = master

branches/try2/doc/rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ break
209209
do
210210
else enum extern
211211
false fn for
212-
if impl in
212+
if impl
213213
let loop
214214
match mod mut
215215
priv pub

branches/try2/doc/tutorial-tasks.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,21 @@ do spawn {
113113
}
114114
~~~
115115

116+
By default, the scheduler multiplexes tasks across the available cores, running
117+
in parallel. Thus, on a multicore machine, running the following code
118+
should interleave the output in vaguely random order.
119+
120+
~~~
121+
# use std::io::print;
122+
# use std::task::spawn;
123+
124+
for child_task_number in range(0, 20) {
125+
do spawn {
126+
print(fmt!("I am child number %d\n", child_task_number));
127+
}
128+
}
129+
~~~
130+
116131
## Communication
117132

118133
Now that we have spawned a new task, it would be nice if we could

branches/try2/mk/llvm.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ifeq ($(CFG_LLVM_ROOT),)
2626

2727
$$(LLVM_CONFIG_$(1)): $$(LLVM_DEPS)
2828
@$$(call E, make: llvm)
29-
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) $$(CFG_LLVM_BUILD_ENV)
29+
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1))
3030
$$(Q)touch $$(LLVM_CONFIG_$(1))
3131
endif
3232

branches/try2/mk/platform.mk

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ endef
2626
$(foreach t,$(CFG_TARGET_TRIPLES),$(eval $(call DEF_OSTYPE_VAR,$(t))))
2727
$(foreach t,$(CFG_TARGET_TRIPLES),$(info cfg: os for $(t) is $(OSTYPE_$(t))))
2828

29-
# FIXME: no-omit-frame-pointer is just so that task_start_wrapper
30-
# has a frame pointer and the stack walker can understand it. Turning off
31-
# frame pointers everywhere is overkill
32-
CFG_GCCISH_CFLAGS += -fno-omit-frame-pointer -DUSE_UTF8
29+
CFG_GCCISH_CFLAGS += -DUSE_UTF8
3330

3431
# On Darwin, we need to run dsymutil so the debugging information ends
3532
# up in the right place. On other platforms, it automatically gets
@@ -153,7 +150,6 @@ CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-linux-gnu := -Wl,-no-whole-archive
153150
CFG_DEF_SUFFIX_x86_64-unknown-linux-gnu := .linux.def
154151
CFG_INSTALL_NAME_x86_64-unknown-linux-gnu =
155152
CFG_LIBUV_LINK_FLAGS_x86_64-unknown-linux-gnu =
156-
CFG_LLVM_BUILD_ENV_x86_64-unknown-linux-gnu="CXXFLAGS=-fno-omit-frame-pointer"
157153
CFG_EXE_SUFFIX_x86_64-unknown-linux-gnu =
158154
CFG_WINDOWSY_x86_64-unknown-linux-gnu :=
159155
CFG_UNIXY_x86_64-unknown-linux-gnu := 1
@@ -179,7 +175,6 @@ CFG_GCCISH_POST_LIB_FLAGS_i686-unknown-linux-gnu := -Wl,-no-whole-archive
179175
CFG_DEF_SUFFIX_i686-unknown-linux-gnu := .linux.def
180176
CFG_INSTALL_NAME_i686-unknown-linux-gnu =
181177
CFG_LIBUV_LINK_FLAGS_i686-unknown-linux-gnu =
182-
CFG_LLVM_BUILD_ENV_i686-unknown-linux-gnu="CXXFLAGS=-fno-omit-frame-pointer"
183178
CFG_EXE_SUFFIX_i686-unknown-linux-gnu =
184179
CFG_WINDOWSY_i686-unknown-linux-gnu :=
185180
CFG_UNIXY_i686-unknown-linux-gnu := 1

branches/try2/mk/rt.mk

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ ifneq ($(strip $(findstring snap,$(MAKECMDGOALS))),)
4141
SNAP_DEFINES=-DRUST_SNAPSHOT
4242
endif
4343

44-
define DEF_LIBUV_ARCH_VAR
45-
LIBUV_ARCH_$(1) = $$(subst i386,ia32,$$(subst x86_64,x64,$$(HOST_$(1))))
46-
endef
47-
$(foreach t,$(CFG_TARGET_TRIPLES),$(eval $(call DEF_LIBUV_ARCH_VAR,$(t))))
48-
4944
define DEF_RUNTIME_TARGETS
5045

5146
######################################################################
@@ -168,36 +163,49 @@ LIBUV_DEPS := $$(wildcard \
168163
$$(S)src/libuv/*/*/*/*)
169164
endif
170165

166+
LIBUV_GYP := $$(S)src/libuv/build/gyp
167+
LIBUV_MAKEFILE_$(1)_$(2) := $$(CFG_BUILD_DIR)rt/$(1)/stage$(2)/libuv/Makefile
168+
LIBUV_NO_LOAD = run-benchmarks.target.mk run-tests.target.mk \
169+
uv_dtrace_header.target.mk uv_dtrace_provider.target.mk
170+
171+
$$(LIBUV_MAKEFILE_$(1)_$(2)): $$(LIBUV_GYP)
172+
(cd $(S)src/libuv/ && \
173+
$$(CFG_PYTHON) ./gyp_uv -f make -Dtarget_arch=$$(HOST_$(1)) -D ninja \
174+
-Goutput_dir=$$(@D) --generator-output $$(@D))
175+
171176
# XXX: Shouldn't need platform-specific conditions here
172177
ifdef CFG_WINDOWSY_$(1)
173178
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
174-
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
175-
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
176-
OS=mingw \
179+
$$(Q)rm -f $$(S)src/libuv/libuv.a
180+
$$(Q)$$(MAKE) -C $$(S)src/libuv -f Makefile.mingw \
181+
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
182+
AR="$$(AR_$(1))" \
177183
V=$$(VERBOSE)
184+
$$(Q)cp $$(S)src/libuv/libuv.a $$@
178185
else ifeq ($(OSTYPE_$(1)), linux-androideabi)
179-
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
180-
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
186+
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)_$(2))
187+
$$(Q)$$(MAKE) -C $$(@D) \
181188
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
182189
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1)))" \
183190
CC="$$(CC_$(1))" \
184191
CXX="$$(CXX_$(1))" \
185-
LINK="$$(CXX_$(1))" \
186192
AR="$$(AR_$(1))" \
187-
PLATFORM=android \
188-
BUILDTYPE=Release \
189-
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
190193
host=android OS=linux \
194+
builddir="." \
195+
BUILDTYPE=Release \
196+
NO_LOAD="$$(LIBUV_NO_LOAD)" \
191197
V=$$(VERBOSE)
192198
else
193-
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
194-
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
199+
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)_$(2))
200+
$$(Q)$$(MAKE) -C $$(@D) \
195201
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
196202
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1)))" \
197203
CC="$$(CC_$(1))" \
198204
CXX="$$(CXX_$(1))" \
199205
AR="$$(AR_$(1))" \
200-
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
206+
builddir="." \
207+
BUILDTYPE=Release \
208+
NO_LOAD="$$(LIBUV_NO_LOAD)" \
201209
V=$$(VERBOSE)
202210
endif
203211

@@ -261,3 +269,7 @@ endef
261269
$(foreach stage,$(STAGES), \
262270
$(foreach target,$(CFG_TARGET_TRIPLES), \
263271
$(eval $(call DEF_RUNTIME_TARGETS,$(target),$(stage)))))
272+
273+
$(LIBUV_GYP):
274+
mkdir -p $(S)src/libuv/build
275+
git clone https://git.chromium.org/external/gyp.git $(S)src/libuv/build/gyp

branches/try2/mk/tests.mk

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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 bench/rt bench/shootout bench/std
519+
CTEST_SRC_BASE_bench = bench
520520
CTEST_BUILD_BASE_bench = bench
521521
CTEST_MODE_bench = run-pass
522522
CTEST_RUNTOOL_bench = $(CTEST_RUNTOOL)
@@ -610,8 +610,7 @@ define DEF_RUN_COMPILETEST
610610

611611
CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
612612
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
613-
$(foreach base,$$(CTEST_SRC_BASE_$(4)), \
614-
--src-base $$(S)src/test/$$(base))/ \
613+
--src-base $$(S)src/test/$$(CTEST_SRC_BASE_$(4))/ \
615614
--build-base $(3)/test/$$(CTEST_BUILD_BASE_$(4))/ \
616615
--ratchet-metrics $(call TEST_RATCHET_FILE,$(1),$(2),$(3),$(4)) \
617616
--mode $$(CTEST_MODE_$(4)) \
@@ -870,8 +869,7 @@ $(foreach host,$(CFG_HOST_TRIPLES), \
870869
$(eval $(foreach target,$(CFG_TARGET_TRIPLES), \
871870
$(eval $(call DEF_CHECK_FAST_FOR_T_H,,$(target),$(host))))))
872871

873-
check-fast: tidy check-fast-H-$(CFG_BUILD_TRIPLE) check-stage2-std check-stage2-extra
874-
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
872+
check-fast: tidy check-fast-H-$(CFG_BUILD_TRIPLE)
875873

876874
define DEF_CHECK_FAST_FOR_H
877875

branches/try2/src/compiletest/common.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ pub struct config {
8383
// Run tests using the JIT
8484
jit: bool,
8585

86+
// Run tests using the new runtime
87+
newrt: bool,
88+
8689
// Target system to be tested
8790
target: ~str,
8891

branches/try2/src/compiletest/compiletest.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ pub fn parse_config(args: ~[~str]) -> config {
7171
optopt("", "ratchet-noise-percent",
7272
"percent change in metrics to consider noise", "N"),
7373
optflag("", "jit", "run tests under the JIT"),
74+
optflag("", "newrt", "run tests on the new runtime / scheduler"),
7475
optopt("", "target", "the target to build for", "TARGET"),
7576
optopt("", "adb-path", "path to the android debugger", "PATH"),
7677
optopt("", "adb-test-dir", "path to tests for the android debugger", "PATH"),
@@ -104,7 +105,7 @@ pub fn parse_config(args: ~[~str]) -> config {
104105
fn opt_path(m: &getopts::Matches, nm: &str) -> Path {
105106
Path(getopts::opt_str(m, nm))
106107
}
107-
108+
108109
let src_base = getopts::opt_strs(matches, "src-base");
109110

110111
config {
@@ -136,6 +137,7 @@ pub fn parse_config(args: ~[~str]) -> config {
136137
runtool: getopts::opt_maybe_str(matches, "runtool"),
137138
rustcflags: getopts::opt_maybe_str(matches, "rustcflags"),
138139
jit: getopts::opt_present(matches, "jit"),
140+
newrt: getopts::opt_present(matches, "newrt"),
139141
target: opt_str2(getopts::opt_maybe_str(matches, "target")).to_str(),
140142
adb_path: opt_str2(getopts::opt_maybe_str(matches, "adb-path")).to_str(),
141143
adb_test_dir:
@@ -169,6 +171,7 @@ pub fn log_config(config: &config) {
169171
logv(c, fmt!("runtool: %s", opt_str(&config.runtool)));
170172
logv(c, fmt!("rustcflags: %s", opt_str(&config.rustcflags)));
171173
logv(c, fmt!("jit: %b", config.jit));
174+
logv(c, fmt!("newrt: %b", config.newrt));
172175
logv(c, fmt!("target: %s", config.target));
173176
logv(c, fmt!("adb_path: %s", config.adb_path));
174177
logv(c, fmt!("adb_test_dir: %s", config.adb_test_dir));

branches/try2/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-
});
57+
}).unwrap();
5858

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

branches/try2/src/compiletest/runtest.rs

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

23-
use std::cell::Cell;
2423
use std::io;
2524
use std::os;
2625
use std::str;
27-
use std::task::{spawn_sched, SingleThreaded};
2826
use std::vec;
29-
use std::unstable::running_on_valgrind;
3027

3128
use extra::test::MetricMap;
3229

3330
pub fn run(config: config, testfile: ~str) {
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-
}
31+
let mut _mm = MetricMap::new();
32+
run_metrics(config, testfile, &mut _mm);
5833
}
5934

6035
pub fn run_metrics(config: config, testfile: ~str, mm: &mut MetricMap) {
@@ -547,13 +522,15 @@ fn compile_test_(config: &config, props: &TestProps,
547522
fn exec_compiled_test(config: &config, props: &TestProps,
548523
testfile: &Path) -> ProcRes {
549524

525+
// If testing the new runtime then set the RUST_NEWRT env var
550526
let env = props.exec_env.clone();
527+
let env = if config.newrt { env + &[(~"RUST_NEWRT", ~"1")] } else { env };
551528

552529
match config.target {
553530

554531
~"arm-linux-androideabi" => {
555532
if (config.adb_device_status) {
556-
_arm_exec_compiled_test(config, props, testfile, env)
533+
_arm_exec_compiled_test(config, props, testfile)
557534
} else {
558535
_dummy_exec_compiled_test(config, props, testfile)
559536
}
@@ -779,7 +756,7 @@ stderr:\n\
779756
}
780757

781758
fn _arm_exec_compiled_test(config: &config, props: &TestProps,
782-
testfile: &Path, env: ~[(~str, ~str)]) -> ProcRes {
759+
testfile: &Path) -> ProcRes {
783760

784761
let args = make_run_args(config, props, testfile);
785762
let cmdline = make_cmdline("", args.prog, args.args);
@@ -805,9 +782,6 @@ fn _arm_exec_compiled_test(config: &config, props: &TestProps,
805782

806783
// run test via adb_run_wrapper
807784
runargs.push(~"shell");
808-
for (key, val) in env.move_iter() {
809-
runargs.push(fmt!("%s=%s", key, val));
810-
}
811785
runargs.push(fmt!("%s/adb_run_wrapper.sh", config.adb_test_dir));
812786
runargs.push(fmt!("%s", config.adb_test_dir));
813787
runargs.push(fmt!("%s", prog_short));

0 commit comments

Comments
 (0)