Skip to content

Commit 0d9a4e0

Browse files
committed
---
yaml --- r: 144605 b: refs/heads/try2 c: c8db9e2 h: refs/heads/master i: 144603: 2fc090a v: v3
1 parent cbe986a commit 0d9a4e0

File tree

116 files changed

+3928
-2129
lines changed

Some content is hidden

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

116 files changed

+3928
-2129
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: e2f2a601e85c5897af3e6fd128125832b4328c6c
8+
refs/heads/try2: c8db9e2638924edcbc00e31dddaf64cd2c1b560f
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/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
212+
if impl in
213213
let loop
214214
match mod mut
215215
priv pub

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: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -168,49 +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-
$$(LIBUV_MAKEFILE_$(1)_$(2)): $$(LIBUV_GYP)
177-
(cd $(S)src/libuv/ && \
178-
$$(CFG_PYTHON) ./gyp_uv -f make -Dtarget_arch=$$(LIBUV_ARCH_$(1)) -D ninja \
179-
-Goutput_dir=$$(@D) --generator-output $$(@D))
180-
181171
# XXX: Shouldn't need platform-specific conditions here
182172
ifdef CFG_WINDOWSY_$(1)
183173
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
184-
$$(Q)rm -f $$(S)src/libuv/libuv.a
185-
$$(Q)$$(MAKE) -C $$(S)src/libuv -f Makefile.mingw \
186-
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
187-
AR="$$(AR_$(1))" \
174+
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
175+
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
176+
OS=mingw \
188177
V=$$(VERBOSE)
189-
$$(Q)cp $$(S)src/libuv/libuv.a $$@
190178
else ifeq ($(OSTYPE_$(1)), linux-androideabi)
191-
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)_$(2))
192-
$$(Q)$$(MAKE) -C $$(@D) \
179+
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
180+
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
193181
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
194182
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1)))" \
195183
CC="$$(CC_$(1))" \
196184
CXX="$$(CXX_$(1))" \
185+
LINK="$$(CXX_$(1))" \
197186
AR="$$(AR_$(1))" \
198-
host=android OS=linux \
199-
builddir="." \
187+
PLATFORM=android \
200188
BUILDTYPE=Release \
201-
NO_LOAD="$$(LIBUV_NO_LOAD)" \
189+
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
190+
host=android OS=linux \
202191
V=$$(VERBOSE)
203192
else
204-
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)_$(2))
205-
$$(Q)$$(MAKE) -C $$(@D) \
193+
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
194+
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
206195
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
207196
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1)))" \
208197
CC="$$(CC_$(1))" \
209198
CXX="$$(CXX_$(1))" \
210199
AR="$$(AR_$(1))" \
211-
builddir="." \
212-
BUILDTYPE=Release \
213-
NO_LOAD="$$(LIBUV_NO_LOAD)" \
200+
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
214201
V=$$(VERBOSE)
215202
endif
216203

@@ -274,7 +261,3 @@ endef
274261
$(foreach stage,$(STAGES), \
275262
$(foreach target,$(CFG_TARGET_TRIPLES), \
276263
$(eval $(call DEF_RUNTIME_TARGETS,$(target),$(stage)))))
277-
278-
$(LIBUV_GYP):
279-
mkdir -p $(S)src/libuv/build
280-
git clone https://git.chromium.org/external/gyp.git $(S)src/libuv/build/gyp

branches/try2/mk/tests.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,8 @@ $(foreach host,$(CFG_HOST_TRIPLES), \
869869
$(eval $(foreach target,$(CFG_TARGET_TRIPLES), \
870870
$(eval $(call DEF_CHECK_FAST_FOR_T_H,,$(target),$(host))))))
871871

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

874875
define DEF_CHECK_FAST_FOR_H
875876

branches/try2/src/compiletest/common.rs

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

86-
// Run tests using the new runtime
87-
newrt: bool,
88-
8986
// Target system to be tested
9087
target: ~str,
9188

branches/try2/src/compiletest/compiletest.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ 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"),
7574
optopt("", "target", "the target to build for", "TARGET"),
7675
optopt("", "adb-path", "path to the android debugger", "PATH"),
7776
optopt("", "adb-test-dir", "path to tests for the android debugger", "PATH"),
@@ -135,7 +134,6 @@ pub fn parse_config(args: ~[~str]) -> config {
135134
runtool: getopts::opt_maybe_str(matches, "runtool"),
136135
rustcflags: getopts::opt_maybe_str(matches, "rustcflags"),
137136
jit: getopts::opt_present(matches, "jit"),
138-
newrt: getopts::opt_present(matches, "newrt"),
139137
target: opt_str2(getopts::opt_maybe_str(matches, "target")).to_str(),
140138
adb_path: opt_str2(getopts::opt_maybe_str(matches, "adb-path")).to_str(),
141139
adb_test_dir:
@@ -169,7 +167,6 @@ pub fn log_config(config: &config) {
169167
logv(c, fmt!("runtool: %s", opt_str(&config.runtool)));
170168
logv(c, fmt!("rustcflags: %s", opt_str(&config.rustcflags)));
171169
logv(c, fmt!("jit: %b", config.jit));
172-
logv(c, fmt!("newrt: %b", config.newrt));
173170
logv(c, fmt!("target: %s", config.target));
174171
logv(c, fmt!("adb_path: %s", config.adb_path));
175172
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-
}).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: 32 additions & 6 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) {
@@ -522,15 +547,13 @@ fn compile_test_(config: &config, props: &TestProps,
522547
fn exec_compiled_test(config: &config, props: &TestProps,
523548
testfile: &Path) -> ProcRes {
524549

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

529552
match config.target {
530553

531554
~"arm-linux-androideabi" => {
532555
if (config.adb_device_status) {
533-
_arm_exec_compiled_test(config, props, testfile)
556+
_arm_exec_compiled_test(config, props, testfile, env)
534557
} else {
535558
_dummy_exec_compiled_test(config, props, testfile)
536559
}
@@ -756,7 +779,7 @@ stderr:\n\
756779
}
757780

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

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

783806
// run test via adb_run_wrapper
784807
runargs.push(~"shell");
808+
for (key, val) in env.move_iter() {
809+
runargs.push(fmt!("%s=%s", key, val));
810+
}
785811
runargs.push(fmt!("%s/adb_run_wrapper.sh", config.adb_test_dir));
786812
runargs.push(fmt!("%s", config.adb_test_dir));
787813
runargs.push(fmt!("%s", prog_short));

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

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
;; Url: https://github.com/mozilla/rust
66

77
(eval-when-compile (require 'cl))
8+
(eval-when-compile (require 'misc))
89

910
;; Syntax definitions and helpers
1011
(defvar rust-mode-syntax-table
@@ -29,10 +30,8 @@
2930

3031
table))
3132

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'.")
33+
(defcustom rust-indent-offset 4
34+
"*Indent Rust code by this number of spaces.")
3635

3736
(defun rust-paren-level () (nth 0 (syntax-ppss)))
3837
(defun rust-in-str-or-cmnt () (nth 8 (syntax-ppss)))
@@ -59,19 +58,39 @@ The initializer is `DEFAULT-TAB-WIDTH'.")
5958
;; A closing brace is 1 level unindended
6059
((looking-at "}") (* rust-indent-offset (- level 1)))
6160

61+
; Doc comments in /** style with leading * indent to line up the *s
62+
((and (nth 4 (syntax-ppss)) (looking-at "*"))
63+
(+ 1 (* rust-indent-offset level)))
64+
6265
;; If we're in any other token-tree / sexp, then:
6366
;; - [ or ( means line up with the opening token
64-
;; - { means indent to either nesting-level * tab width,
67+
;; - { means indent to either nesting-level * rust-indent-offset,
6568
;; or one further indent from that if either current line
6669
;; begins with 'else', or previous line didn't end in
67-
;; semi, comma or brace, and wasn't an attribute. PHEW.
70+
;; semi, comma or brace (other than whitespace and line
71+
;; comments) , and wasn't an attribute. But if we have
72+
;; something after the open brace and ending with a comma,
73+
;; treat it as fields and align them. PHEW.
6874
((> level 0)
6975
(let ((pt (point)))
7076
(rust-rewind-irrelevant)
7177
(backward-up-list)
72-
(if (looking-at "[[(]")
73-
(+ 1 (current-column))
78+
(cond
79+
((and
80+
(looking-at "[[(]")
81+
; We don't want to indent out to the open bracket if the
82+
; open bracket ends the line
83+
(save-excursion
84+
(forward-char)
85+
(not (looking-at "[[:space:]]*\\(?://.*\\)?$"))))
86+
(+ 1 (current-column)))
87+
;; Check for fields on the same line as the open curly brace:
88+
((looking-at "{[[:blank:]]*[^}\n]*,[[:space:]]*$")
7489
(progn
90+
(forward-char)
91+
(forward-to-word 1)
92+
(current-column)))
93+
(t (progn
7594
(goto-char pt)
7695
(back-to-indentation)
7796
(if (looking-at "\\<else\\>")
@@ -81,12 +100,12 @@ The initializer is `DEFAULT-TAB-WIDTH'.")
81100
(beginning-of-line)
82101
(rust-rewind-irrelevant)
83102
(end-of-line)
84-
(if (looking-back "[{};,]")
103+
(if (looking-back "[,;{}(][[:space:]]*\\(?://.*\\)?")
85104
(* rust-indent-offset level)
86105
(back-to-indentation)
87106
(if (looking-at "#")
88107
(* rust-indent-offset level)
89-
(* rust-indent-offset (+ 1 level))))))))))
108+
(* rust-indent-offset (+ 1 level)))))))))))
90109

91110
;; Otherwise we're in a column-zero definition
92111
(t 0))))))

branches/try2/src/libextra/dlist.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ impl<A: Eq> Eq for DList<A> {
594594
}
595595

596596
fn ne(&self, other: &DList<A>) -> bool {
597-
self.len() != other.len() &&
597+
self.len() != other.len() ||
598598
iterator::order::ne(self.iter(), other.iter())
599599
}
600600
}
@@ -978,6 +978,10 @@ mod tests {
978978
assert!(n != m);
979979
m.push_back(1);
980980
assert_eq!(&n, &m);
981+
982+
let n = list_from([2,3,4]);
983+
let m = list_from([1,2,3]);
984+
assert!(n != m);
981985
}
982986

983987
#[test]

branches/try2/src/libextra/json.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -1164,9 +1164,6 @@ impl Ord for Json {
11641164
}
11651165
}
11661166
}
1167-
fn le(&self, other: &Json) -> bool { !(*other).lt(&(*self)) }
1168-
fn ge(&self, other: &Json) -> bool { !(*self).lt(other) }
1169-
fn gt(&self, other: &Json) -> bool { (*other).lt(&(*self)) }
11701167
}
11711168

11721169
/// A trait for converting values to JSON

0 commit comments

Comments
 (0)