Skip to content

Commit ac8c5b5

Browse files
committed
---
yaml --- r: 144545 b: refs/heads/try2 c: 7c6c751 h: refs/heads/master i: 144543: a0220e8 v: v3
1 parent 94f5ffd commit ac8c5b5

Some content is hidden

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

72 files changed

+1809
-1878
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: 43f851d2cb3976655078f032dc1a8cb88f1c8deb
8+
refs/heads/try2: 7c6c7519a75064d11f855de862bcdaddcbe5df4b
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/alexcrichton/libuv.git
7+
url = https://github.com/brson/libuv.git
88
branch = master

branches/try2/doc/tutorial-tasks.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -113,21 +113,6 @@ 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-
131116
## Communication
132117

133118
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))
29+
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) $$(CFG_LLVM_BUILD_ENV)
3030
$$(Q)touch $$(LLVM_CONFIG_$(1))
3131
endif
3232

branches/try2/mk/platform.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ 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-
CFG_GCCISH_CFLAGS += -DUSE_UTF8
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
3033

3134
# On Darwin, we need to run dsymutil so the debugging information ends
3235
# up in the right place. On other platforms, it automatically gets
@@ -150,6 +153,7 @@ CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-linux-gnu := -Wl,-no-whole-archive
150153
CFG_DEF_SUFFIX_x86_64-unknown-linux-gnu := .linux.def
151154
CFG_INSTALL_NAME_x86_64-unknown-linux-gnu =
152155
CFG_LIBUV_LINK_FLAGS_x86_64-unknown-linux-gnu =
156+
CFG_LLVM_BUILD_ENV_x86_64-unknown-linux-gnu="CXXFLAGS=-fno-omit-frame-pointer"
153157
CFG_EXE_SUFFIX_x86_64-unknown-linux-gnu =
154158
CFG_WINDOWSY_x86_64-unknown-linux-gnu :=
155159
CFG_UNIXY_x86_64-unknown-linux-gnu := 1
@@ -175,6 +179,7 @@ CFG_GCCISH_POST_LIB_FLAGS_i686-unknown-linux-gnu := -Wl,-no-whole-archive
175179
CFG_DEF_SUFFIX_i686-unknown-linux-gnu := .linux.def
176180
CFG_INSTALL_NAME_i686-unknown-linux-gnu =
177181
CFG_LIBUV_LINK_FLAGS_i686-unknown-linux-gnu =
182+
CFG_LLVM_BUILD_ENV_i686-unknown-linux-gnu="CXXFLAGS=-fno-omit-frame-pointer"
178183
CFG_EXE_SUFFIX_i686-unknown-linux-gnu =
179184
CFG_WINDOWSY_i686-unknown-linux-gnu :=
180185
CFG_UNIXY_i686-unknown-linux-gnu := 1

branches/try2/mk/rt.mk

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ 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+
4449
define DEF_RUNTIME_TARGETS
4550

4651
######################################################################
@@ -163,49 +168,36 @@ LIBUV_DEPS := $$(wildcard \
163168
$$(S)src/libuv/*/*/*/*)
164169
endif
165170

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-
176171
# XXX: Shouldn't need platform-specific conditions here
177172
ifdef CFG_WINDOWSY_$(1)
178173
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
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))" \
174+
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
175+
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
176+
OS=mingw \
183177
V=$$(VERBOSE)
184-
$$(Q)cp $$(S)src/libuv/libuv.a $$@
185178
else ifeq ($(OSTYPE_$(1)), linux-androideabi)
186-
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)_$(2))
187-
$$(Q)$$(MAKE) -C $$(@D) \
179+
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
180+
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
188181
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
189182
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1)))" \
190183
CC="$$(CC_$(1))" \
191184
CXX="$$(CXX_$(1))" \
185+
LINK="$$(CXX_$(1))" \
192186
AR="$$(AR_$(1))" \
193-
host=android OS=linux \
194-
builddir="." \
187+
PLATFORM=android \
195188
BUILDTYPE=Release \
196-
NO_LOAD="$$(LIBUV_NO_LOAD)" \
189+
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
190+
host=android OS=linux \
197191
V=$$(VERBOSE)
198192
else
199-
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)_$(2))
200-
$$(Q)$$(MAKE) -C $$(@D) \
193+
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
194+
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
201195
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
202196
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1)))" \
203197
CC="$$(CC_$(1))" \
204198
CXX="$$(CXX_$(1))" \
205199
AR="$$(AR_$(1))" \
206-
builddir="." \
207-
BUILDTYPE=Release \
208-
NO_LOAD="$$(LIBUV_NO_LOAD)" \
200+
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
209201
V=$$(VERBOSE)
210202
endif
211203

@@ -269,7 +261,3 @@ endef
269261
$(foreach stage,$(STAGES), \
270262
$(foreach target,$(CFG_TARGET_TRIPLES), \
271263
$(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/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

branches/try2/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) {

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@
2929

3030
table))
3131

32-
(defcustom rust-indent-offset default-tab-width
33-
"*Indent Rust code by this number of spaces.
34-
35-
The initializer is `DEFAULT-TAB-WIDTH'.")
32+
(defcustom rust-indent-offset 4
33+
"*Indent Rust code by this number of spaces.")
3634

3735
(defun rust-paren-level () (nth 0 (syntax-ppss)))
3836
(defun rust-in-str-or-cmnt () (nth 8 (syntax-ppss)))
@@ -61,7 +59,7 @@ The initializer is `DEFAULT-TAB-WIDTH'.")
6159

6260
;; If we're in any other token-tree / sexp, then:
6361
;; - [ or ( means line up with the opening token
64-
;; - { means indent to either nesting-level * tab width,
62+
;; - { means indent to either nesting-level * rust-indent-offset,
6563
;; or one further indent from that if either current line
6664
;; begins with 'else', or previous line didn't end in
6765
;; semi, comma or brace, and wasn't an attribute. PHEW.

branches/try2/src/etc/vim/syntax/rust.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:spac
3333
syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
3434

3535
" reserved
36-
syn keyword rustKeyword be
36+
syn keyword rustKeyword be yield typeof
3737

3838
syn keyword rustType int uint float char bool u8 u16 u32 u64 f32
3939
syn keyword rustType f64 i8 i16 i32 i64 str Self

branches/try2/src/libextra/test.rs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ The FILTER is matched against the name of all tests to run, and if any tests
203203
have a substring match, only those tests are run.
204204
205205
By default, all tests are run in parallel. This can be altered with the
206-
RUST_THREADS environment variable when running tests (set it to 1).
206+
RUST_TEST_TASKS environment variable when running tests (set it to 1).
207207
208208
Test Attributes:
209209
@@ -740,9 +740,20 @@ static SCHED_OVERCOMMIT : uint = 4u;
740740

741741
fn get_concurrency() -> uint {
742742
use std::rt;
743-
let threads = rt::util::default_sched_threads();
744-
if threads == 1 { 1 }
745-
else { threads * SCHED_OVERCOMMIT }
743+
match os::getenv("RUST_TEST_TASKS") {
744+
Some(s) => {
745+
let opt_n: Option<uint> = FromStr::from_str(s);
746+
match opt_n {
747+
Some(n) if n > 0 => n,
748+
_ => fail!("RUST_TEST_TASKS is `%s`, should be a non-negative integer.", s)
749+
}
750+
}
751+
None => {
752+
let threads = rt::util::default_sched_threads();
753+
if threads == 1 { 1 }
754+
else { threads * SCHED_OVERCOMMIT }
755+
}
756+
}
746757
}
747758

748759
pub fn filter_tests(

branches/try2/src/librustc/middle/trans/base.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2366,20 +2366,12 @@ pub fn create_entry_wrapper(ccx: @mut CrateContext,
23662366
&ccx.int_type);
23672367

23682368
// FIXME #4404 android JNI hacks
2369-
let llfn = if *ccx.sess.building_library {
2370-
decl_cdecl_fn(ccx.llmod, "amain", llfty)
2369+
let main_name = if *ccx.sess.building_library {
2370+
"amain"
23712371
} else {
2372-
let main_name = match ccx.sess.targ_cfg.os {
2373-
session::os_win32 => {
2374-
match ccx.sess.targ_cfg.arch {
2375-
X86 => ~"WinMain@16",
2376-
_ => ~"WinMain",
2377-
}
2378-
},
2379-
_ => ~"main",
2380-
};
2381-
decl_cdecl_fn(ccx.llmod, main_name, llfty)
2372+
"main"
23822373
};
2374+
let llfn = decl_cdecl_fn(ccx.llmod, main_name, llfty);
23832375
let llbb = do "top".with_c_str |buf| {
23842376
unsafe {
23852377
llvm::LLVMAppendBasicBlockInContext(ccx.llcx, llfn, buf)

branches/try2/src/librustc/middle/trans/type_use.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ pub fn type_uses_for(ccx: @mut CrateContext, fn_id: def_id, n_tps: uint)
149149
"visit_tydesc" | "forget" | "frame_address" |
150150
"morestack_addr" => 0,
151151

152-
"offset" | "offset_inbounds" |
152+
"offset" |
153153
"memcpy32" | "memcpy64" | "memmove32" | "memmove64" |
154154
"memset32" | "memset64" => use_repr,
155155

branches/try2/src/librustc/middle/typeck/astconv.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,9 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:region_scope + Clone + 'static>(
517517
}
518518
}
519519
}
520+
ast::ty_typeof(_e) => {
521+
tcx.sess.span_bug(ast_ty.span, "typeof is reserved but unimplemented");
522+
}
520523
ast::ty_infer => {
521524
// ty_infer should only appear as the type of arguments or return
522525
// values in a fn_expr, or as the type of local variables. Both of

branches/try2/src/librustc/middle/typeck/check/mod.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3663,20 +3663,6 @@ pub fn check_intrinsic_type(ccx: @mut CrateCtxt, it: @ast::foreign_item) {
36633663
mutbl: ast::m_imm
36643664
}))
36653665
}
3666-
"offset_inbounds" => {
3667-
(1,
3668-
~[
3669-
ty::mk_ptr(tcx, ty::mt {
3670-
ty: param(ccx, 0),
3671-
mutbl: ast::m_imm
3672-
}),
3673-
ty::mk_int()
3674-
],
3675-
ty::mk_ptr(tcx, ty::mt {
3676-
ty: param(ccx, 0),
3677-
mutbl: ast::m_imm
3678-
}))
3679-
}
36803666
"memcpy32" => {
36813667
(1,
36823668
~[

branches/try2/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);

branches/try2/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

0 commit comments

Comments
 (0)