Skip to content

Commit 9a359c7

Browse files
committed
---
yaml --- r: 151851 b: refs/heads/try2 c: 66d8c3c h: refs/heads/master i: 151849: a18fee0 151847: c68d3fe v: v3
1 parent 6067166 commit 9a359c7

File tree

100 files changed

+502
-1454
lines changed

Some content is hidden

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

100 files changed

+502
-1454
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: 84320a4f4bd31206f4a93b82190a867340035135
8+
refs/heads/try2: 66d8c3cb2bc8d872e65c8340783512a5e9520cfd
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/crates.mk

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,14 @@
5151

5252
TARGET_CRATES := libc std green rustuv native flate arena glob term semver \
5353
uuid serialize sync getopts collections num test time rand \
54-
workcache url log regex graphviz core rlibc alloc
54+
workcache url log regex graphviz core rlibc
5555
HOST_CRATES := syntax rustc rustdoc fourcc hexfloat regex_macros fmt_macros
5656
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5757
TOOLS := compiletest rustdoc rustc
5858

5959
DEPS_core :=
6060
DEPS_rlibc :=
61-
DEPS_alloc := core libc native:jemalloc
62-
DEPS_std := core libc alloc native:rustrt native:backtrace
61+
DEPS_std := core libc native:rustrt native:compiler-rt native:backtrace native:jemalloc
6362
DEPS_graphviz := std
6463
DEPS_green := std rand native:context_switch
6564
DEPS_rustuv := std native:uv native:uv_support
@@ -77,7 +76,7 @@ DEPS_serialize := std collections log
7776
DEPS_term := std collections log
7877
DEPS_semver := std
7978
DEPS_uuid := std serialize rand
80-
DEPS_sync := std alloc
79+
DEPS_sync := std
8180
DEPS_getopts := std
8281
DEPS_collections := std rand
8382
DEPS_fourcc := syntax std
@@ -102,7 +101,6 @@ TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
102101

103102
ONLY_RLIB_core := 1
104103
ONLY_RLIB_rlibc := 1
105-
ONLY_RLIB_alloc := 1
106104

107105
################################################################################
108106
# You should not need to edit below this line

branches/try2/mk/main.mk

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -349,45 +349,18 @@ CFGFLAG$(1)_T_$(2)_H_$(3) = stage$(1)
349349
endef
350350

351351
# Same macro/variables as above, but defined in a separate loop so it can use
352-
# all the variables above for all archs. The RPATH_VAR setup sometimes needs to
352+
# all the varibles above for all archs. The RPATH_VAR setup sometimes needs to
353353
# reach across triples to get things in order.
354-
#
355-
# Defines (with the standard $(1)_T_$(2)_H_$(3) suffix):
356-
# * `LD_LIBRARY_PATH_ENV_NAME`: the name for the key to use in the OS
357-
# environment to access or extend the lookup path for dynamic
358-
# libraries. Note on Windows, that key is `$PATH`, and thus not
359-
# only conflates programs with dynamic libraries, but also often
360-
# contains spaces which confuse make.
361-
# * `LD_LIBRARY_PATH_ENV_HOSTDIR`: the entry to add to lookup path for the host
362-
# * `LD_LIBRARY_PATH_ENV_TARGETDIR`: the entry to add to lookup path for target
363-
#
364-
# Below that, HOST_RPATH_VAR and TARGET_RPATH_VAR are defined in terms of the
365-
# above settings.
366-
#
367354
define SREQ_CMDS
368355

369356
ifeq ($$(OSTYPE_$(3)),apple-darwin)
370-
LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3) := DYLD_LIBRARY_PATH
371-
else
372-
ifeq ($$(CFG_WINDOWSY_$(2)),1)
373-
LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3) := PATH
357+
RPATH_VAR$(1)_T_$(2)_H_$(3) := \
358+
DYLD_LIBRARY_PATH="$$$$DYLD_LIBRARY_PATH:$$(CURDIR)/$$(HLIB$(1)_H_$(3))"
374359
else
375-
LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3) := LD_LIBRARY_PATH
376-
endif
360+
RPATH_VAR$(1)_T_$(2)_H_$(3) := \
361+
LD_LIBRARY_PATH="$$$$LD_LIBRARY_PATH:$$(CURDIR)/$$(HLIB$(1)_H_$(3))"
377362
endif
378363

379-
LD_LIBRARY_PATH_ENV_HOSTDIR$(1)_T_$(2)_H_$(3) := \
380-
$$(CURDIR)/$$(HLIB$(1)_H_$(3))
381-
LD_LIBRARY_PATH_ENV_TARGETDIR$(1)_T_$(2)_H_$(3) := \
382-
$$(CURDIR)/$$(TLIB1_T_$(2)_H_$(CFG_BUILD))
383-
384-
HOST_RPATH_VAR$(1)_T_$(2)_H_$(3) := \
385-
$$(LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3))=$$$$$$(LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3)):$$(LD_LIBRARY_PATH_ENV_HOSTDIR$(1)_T_$(2)_H_$(3))
386-
TARGET_RPATH_VAR$(1)_T_$(2)_H_$(3) := \
387-
$$(LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3))=$$$$$$(LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3)):$$(LD_LIBRARY_PATH_ENV_TARGETDIR$(1)_T_$(2)_H_$(3))
388-
389-
RPATH_VAR$(1)_T_$(2)_H_$(3) := $$(HOST_RPATH_VAR$(1)_T_$(2)_H_$(3))
390-
391364
# Pass --cfg stage0 only for the build->host part of stage0;
392365
# if you're building a cross config, the host->* parts are
393366
# effectively stage1, since it uses the just-built stage0.
@@ -403,7 +376,13 @@ ifeq ($(1),0)
403376
ifneq ($(strip $(CFG_BUILD)),$(strip $(3)))
404377
CFGFLAG$(1)_T_$(2)_H_$(3) = stage1
405378

406-
RPATH_VAR$(1)_T_$(2)_H_$(3) := $$(TARGET_RPATH_VAR$(1)_T_$(2)_H_$(3))
379+
ifeq ($$(OSTYPE_$(3)),apple-darwin)
380+
RPATH_VAR$(1)_T_$(2)_H_$(3) := \
381+
DYLD_LIBRARY_PATH="$$$$DYLD_LIBRARY_PATH:$$(CURDIR)/$$(TLIB1_T_$(2)_H_$(CFG_BUILD))"
382+
else
383+
RPATH_VAR$(1)_T_$(2)_H_$(3) := \
384+
LD_LIBRARY_PATH="$$$$LD_LIBRARY_PATH:$$(CURDIR)/$$(TLIB1_T_$(2)_H_$(CFG_BUILD))"
385+
endif
407386
endif
408387
endif
409388

branches/try2/mk/tests.mk

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -793,27 +793,8 @@ else
793793
CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
794794
endif
795795

796-
# (Issues #13732, #13983, #14000) The doc for the regex crate includes
797-
# uses of the `regex!` macro from the regex_macros crate. There is
798-
# normally a dependence injected that makes the target's regex depend
799-
# upon the host's regex_macros (see #13845), but that dependency
800-
# injection is currently skipped for stage1 as a special case.
801-
#
802-
# Therefore, as a further special case, this conditional skips
803-
# attempting to run the doc tests for the regex crate atop stage1,
804-
# (since there is no regex_macros crate for the stage1 rustc to load).
805-
#
806-
# (Another approach for solving this would be to inject the desired
807-
# dependence for stage1 as well, by setting things up to generate a
808-
# regex_macros crate that was compatible with the stage1 rustc and
809-
# thus re-enable our ability to run this test.)
810-
ifeq (stage$(1)-crate-$(4),stage1-crate-regex)
811-
check-stage$(1)-T-$(2)-H-$(3)-doc-crate-$(4)-exec:
812-
@$$(call E, skipping doc-crate-$(4) as it uses macros and cannot run at stage$(1))
813-
else
814796
check-stage$(1)-T-$(2)-H-$(3)-doc-crate-$(4)-exec: \
815797
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4))
816-
endif
817798

818799
ifeq ($(2),$$(CFG_BUILD))
819800
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4)): $$(CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4))
@@ -970,10 +951,7 @@ $(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
970951
"$$(CC_$(3)) $$(CFG_GCCISH_CFLAGS_$(3))" \
971952
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
972953
"$$(TESTNAME)" \
973-
$$(LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3)) \
974-
"$$(LD_LIBRARY_PATH_ENV_HOSTDIR$(1)_T_$(2)_H_$(3))" \
975-
"$$(LD_LIBRARY_PATH_ENV_TARGETDIR$(1)_T_$(2)_H_$(3))" \
976-
$(1)
954+
"$$(RPATH_VAR$(1)_T_$(2)_H_$(3))"
977955
@touch $$@
978956
else
979957
# FIXME #11094 - The above rule doesn't work right for multiple targets

branches/try2/src/compiletest/common.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2014 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
//
@@ -91,6 +91,9 @@ pub struct Config {
9191
// Only run tests that match this filter
9292
pub filter: Option<Regex>,
9393

94+
// Precompiled regex for finding expected errors in cfail
95+
pub cfail_regex: Regex,
96+
9497
// Write out a parseable log of tests that were run
9598
pub logfile: Option<Path>,
9699

@@ -144,5 +147,4 @@ pub struct Config {
144147

145148
// Explain what's going on
146149
pub verbose: bool
147-
148150
}

branches/try2/src/compiletest/compiletest.rs

Lines changed: 3 additions & 1 deletion
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-2014 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
//
@@ -33,6 +33,7 @@ use getopts::{optopt, optflag, reqopt};
3333
use common::Config;
3434
use common::{Pretty, DebugInfoGdb, Codegen};
3535
use util::logv;
36+
use regex::Regex;
3637

3738
pub mod procsrv;
3839
pub mod util;
@@ -147,6 +148,7 @@ pub fn parse_config(args: Vec<StrBuf> ) -> Config {
147148
.as_slice()).expect("invalid mode"),
148149
run_ignored: matches.opt_present("ignored"),
149150
filter: filter,
151+
cfail_regex: Regex::new(errors::EXPECTED_PATTERN).unwrap(),
150152
logfile: matches.opt_str("logfile").map(|s| Path::new(s)),
151153
save_metrics: matches.opt_str("save-metrics").map(|s| Path::new(s)),
152154
ratchet_metrics:
Lines changed: 22 additions & 54 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-2014 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
//
@@ -9,68 +9,36 @@
99
// except according to those terms.
1010

1111
use std::io::{BufferedReader, File};
12+
use regex::Regex;
1213

1314
pub struct ExpectedError {
1415
pub line: uint,
1516
pub kind: StrBuf,
1617
pub msg: StrBuf,
1718
}
1819

19-
// Load any test directives embedded in the file
20-
pub fn load_errors(testfile: &Path) -> Vec<ExpectedError> {
20+
pub static EXPECTED_PATTERN : &'static str = r"//~(?P<adjusts>\^*)\s*(?P<kind>\S*)\s*(?P<msg>.*)";
2121

22-
let mut error_patterns = Vec::new();
22+
// Load any test directives embedded in the file
23+
pub fn load_errors(re: &Regex, testfile: &Path) -> Vec<ExpectedError> {
2324
let mut rdr = BufferedReader::new(File::open(testfile).unwrap());
24-
let mut line_num = 1u;
25-
for ln in rdr.lines() {
26-
error_patterns.push_all_move(parse_expected(line_num,
27-
ln.unwrap().to_strbuf()));
28-
line_num += 1u;
29-
}
30-
return error_patterns;
31-
}
32-
33-
fn parse_expected(line_num: uint, line: StrBuf) -> Vec<ExpectedError> {
34-
let line = line.as_slice().trim().to_strbuf();
35-
let error_tag = "//~".to_strbuf();
36-
let mut idx;
37-
match line.as_slice().find_str(error_tag.as_slice()) {
38-
None => return Vec::new(),
39-
Some(nn) => { idx = (nn as uint) + error_tag.len(); }
40-
}
41-
42-
// "//~^^^ kind msg" denotes a message expected
43-
// three lines above current line:
44-
let mut adjust_line = 0u;
45-
let len = line.len();
46-
while idx < len && line.as_slice()[idx] == ('^' as u8) {
47-
adjust_line += 1u;
48-
idx += 1u;
49-
}
5025

51-
// Extract kind:
52-
while idx < len && line.as_slice()[idx] == (' ' as u8) {
53-
idx += 1u;
54-
}
55-
let start_kind = idx;
56-
while idx < len && line.as_slice()[idx] != (' ' as u8) {
57-
idx += 1u;
58-
}
59-
60-
let kind = line.as_slice().slice(start_kind, idx);
61-
let kind = kind.to_ascii().to_lower().into_str().to_strbuf();
62-
63-
// Extract msg:
64-
while idx < len && line.as_slice()[idx] == (' ' as u8) {
65-
idx += 1u;
66-
}
67-
let msg = line.as_slice().slice(idx, len).to_strbuf();
68-
69-
debug!("line={} kind={} msg={}", line_num - adjust_line, kind, msg);
26+
rdr.lines().enumerate().filter_map(|(line_no, ln)| {
27+
parse_expected(line_no + 1, ln.unwrap(), re)
28+
}).collect()
29+
}
7030

71-
return vec!(ExpectedError{
72-
line: line_num - adjust_line,
73-
kind: kind,
74-
msg: msg,
75-
});
31+
fn parse_expected(line_num: uint, line: &str, re: &Regex) -> Option<ExpectedError> {
32+
re.captures(line).and_then(|caps| {
33+
let adjusts = caps.name("adjusts").len();
34+
let kind = caps.name("kind").to_ascii().to_lower().into_str().to_strbuf();
35+
let msg = caps.name("msg").trim().to_strbuf();
36+
37+
debug!("line={} kind={} msg={}", line_num, kind, msg);
38+
Some(ExpectedError {
39+
line: line_num - adjusts,
40+
kind: kind,
41+
msg: msg,
42+
})
43+
})
7644
}

branches/try2/src/compiletest/procsrv.rs

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,54 @@
1111
use std::os;
1212
use std::str;
1313
use std::io::process::{ProcessExit, Command, Process, ProcessOutput};
14-
use std::unstable::dynamic_lib::DynamicLibrary;
1514

15+
#[cfg(target_os = "win32")]
1616
fn target_env(lib_path: &str, prog: &str) -> Vec<(StrBuf, StrBuf)> {
17-
let prog = if cfg!(windows) {prog.slice_to(prog.len() - 4)} else {prog};
18-
let aux_path = prog + ".libaux";
17+
let env = os::env();
1918

20-
// Need to be sure to put both the lib_path and the aux path in the dylib
21-
// search path for the child.
22-
let mut path = DynamicLibrary::search_path();
23-
path.insert(0, Path::new(aux_path));
24-
path.insert(0, Path::new(lib_path));
19+
// Make sure we include the aux directory in the path
20+
assert!(prog.ends_with(".exe"));
21+
let aux_path = prog.slice(0u, prog.len() - 4u).to_owned() + ".libaux";
2522

26-
// Remove the previous dylib search path var
27-
let var = DynamicLibrary::envvar();
28-
let mut env: Vec<(StrBuf,StrBuf)> =
29-
os::env().move_iter().map(|(a,b)|(a.to_strbuf(), b.to_strbuf())).collect();
30-
match env.iter().position(|&(ref k, _)| k.as_slice() == var) {
31-
Some(i) => { env.remove(i); }
32-
None => {}
23+
let mut new_env: Vec<_> = env.move_iter().map(|(k, v)| {
24+
let new_v = if "PATH" == k {
25+
format_strbuf!("{};{};{}", v, lib_path, aux_path)
26+
} else {
27+
v.to_strbuf()
28+
};
29+
(k.to_strbuf(), new_v)
30+
}).collect();
31+
if prog.ends_with("rustc.exe") {
32+
new_env.push(("RUST_THREADS".to_strbuf(), "1".to_strbuf()));
3333
}
34+
return new_env;
35+
}
3436

35-
// Add the new dylib search path var
36-
let newpath = DynamicLibrary::create_path(path.as_slice());
37-
env.push((var.to_strbuf(),
38-
str::from_utf8(newpath.as_slice()).unwrap().to_strbuf()));
37+
#[cfg(target_os = "linux")]
38+
#[cfg(target_os = "macos")]
39+
#[cfg(target_os = "freebsd")]
40+
fn target_env(lib_path: &str, prog: &str) -> Vec<(StrBuf,StrBuf)> {
41+
// Make sure we include the aux directory in the path
42+
let aux_path = prog + ".libaux";
43+
44+
let mut env: Vec<(StrBuf,StrBuf)> =
45+
os::env().move_iter()
46+
.map(|(ref k, ref v)| (k.to_strbuf(), v.to_strbuf()))
47+
.collect();
48+
let var = if cfg!(target_os = "macos") {
49+
"DYLD_LIBRARY_PATH"
50+
} else {
51+
"LD_LIBRARY_PATH"
52+
};
53+
let prev = match env.iter().position(|&(ref k, _)| k.as_slice() == var) {
54+
Some(i) => env.remove(i).unwrap().val1(),
55+
None => "".to_strbuf(),
56+
};
57+
env.push((var.to_strbuf(), if prev.is_empty() {
58+
format_strbuf!("{}:{}", lib_path, aux_path)
59+
} else {
60+
format_strbuf!("{}:{}:{}", lib_path, aux_path, prev)
61+
}));
3962
return env;
4063
}
4164

branches/try2/src/compiletest/runtest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2014 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
//
@@ -79,7 +79,7 @@ fn run_cfail_test(config: &Config, props: &TestProps, testfile: &Path) {
7979

8080
check_correct_failure_status(&proc_res);
8181

82-
let expected_errors = errors::load_errors(testfile);
82+
let expected_errors = errors::load_errors(&config.cfail_regex, testfile);
8383
if !expected_errors.is_empty() {
8484
if !props.error_patterns.is_empty() {
8585
fatal("both error pattern and expected errors \

0 commit comments

Comments
 (0)