Skip to content

Commit 6629b61

Browse files
committed
---
yaml --- r: 177791 b: refs/heads/snap-stage3 c: c5961ad h: refs/heads/master i: 177789: a2f69a2 177787: a3d4767 177783: 1997edb 177775: 2b61b2c 177759: 8f14cc6 177727: f131f99 177663: cb5c1c4 v: v3
1 parent 6778558 commit 6629b61

File tree

730 files changed

+16910
-13457
lines changed

Some content is hidden

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

730 files changed

+16910
-13457
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 474b324eda10440d6568ef872a7307d38e7de95b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 69bc112e723d3117f81552aeee44e9f6beae3584
4+
refs/heads/snap-stage3: c5961ad06d45689b44ff305c15d6ec7ec65755a9
55
refs/heads/try: fde4472848b662a4d1236388c4cf15e2450237e6
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/configure

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ need_ok() {
2828

2929
need_cmd() {
3030
if command -v $1 >/dev/null 2>&1
31-
then msg "found $1"
32-
else err "need $1"
31+
then msg "found program $1"
32+
else err "need program $1"
3333
fi
3434
}
3535

@@ -340,6 +340,7 @@ need_cmd date
340340
need_cmd tr
341341
need_cmd sed
342342
need_cmd file
343+
need_cmd make
343344

344345
msg "inspecting environment"
345346

@@ -645,6 +646,8 @@ probe CFG_ISCC iscc
645646
probe CFG_JAVAC javac
646647
probe CFG_ANTLR4 antlr4
647648
probe CFG_GRUN grun
649+
probe CFG_FLEX flex
650+
probe CFG_BISON bison
648651
probe CFG_PANDOC pandoc
649652
probe CFG_PDFLATEX pdflatex
650653
probe CFG_XELATEX xelatex

branches/snap-stage3/mk/crates.mk

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

5252
TARGET_CRATES := libc std flate arena term \
5353
serialize getopts collections test rand \
54-
log regex graphviz core rbml alloc \
54+
log graphviz core rbml alloc \
5555
unicode rustc_bitflags
5656
RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_resolve rustc_driver \
5757
rustc_trans rustc_back rustc_llvm rustc_privacy
@@ -95,16 +95,15 @@ DEPS_term := std log
9595
DEPS_getopts := std
9696
DEPS_collections := core alloc unicode
9797
DEPS_num := std
98-
DEPS_test := std getopts serialize rbml term regex native:rust_test_helpers
98+
DEPS_test := std getopts serialize rbml term native:rust_test_helpers
9999
DEPS_rand := core
100-
DEPS_log := std regex
101-
DEPS_regex := std
100+
DEPS_log := std
102101
DEPS_fmt_macros = std
103102

104103
TOOL_DEPS_compiletest := test getopts
105104
TOOL_DEPS_rustdoc := rustdoc
106105
TOOL_DEPS_rustc := rustc_driver
107-
TOOL_DEPS_rustbook := std regex rustdoc
106+
TOOL_DEPS_rustbook := std rustdoc
108107
TOOL_SOURCE_compiletest := $(S)src/compiletest/compiletest.rs
109108
TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs
110109
TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
@@ -130,9 +129,8 @@ DOC_CRATES := $(filter-out rustc, \
130129
$(filter-out rustc_driver, \
131130
$(filter-out rustc_privacy, \
132131
$(filter-out log, \
133-
$(filter-out regex, \
134132
$(filter-out getopts, \
135-
$(filter-out syntax, $(CRATES))))))))))))
133+
$(filter-out syntax, $(CRATES)))))))))))
136134
COMPILER_DOC_CRATES := rustc rustc_trans rustc_borrowck rustc_resolve \
137135
rustc_typeck rustc_driver syntax rustc_privacy
138136

branches/snap-stage3/mk/grammar.mk

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ B = $(CFG_BUILD_DIR)/$(CFG_BUILD)/stage2/
1414
L = $(B)lib/rustlib/$(CFG_BUILD)/lib
1515
LD = $(CFG_BUILD)/stage2/lib/rustlib/$(CFG_BUILD)/lib/
1616
RUSTC = $(STAGE2_T_$(CFG_BUILD)_H_$(CFG_BUILD))
17+
ifeq ($(CFG_OSTYPE),apple-darwin)
18+
FLEX_LDFLAGS=-ll
19+
else
20+
FLEX_LDFLAGS=-lfl
21+
endif
1722

1823
# Run the reference lexer against libsyntax and compare the tokens and spans.
1924
# If "// ignore-lexer-test" is present in the file, it will be ignored.
@@ -67,3 +72,46 @@ $(info cfg: javac not available, skipping lexer test...)
6772
check-lexer:
6873

6974
endif
75+
76+
$(BG)lex.yy.c: $(SG)lexer.l $(BG)
77+
@$(call E, flex: $@)
78+
$(Q)$(CFG_FLEX) -o $@ $<
79+
80+
$(BG)lexer-lalr.o: $(BG)lex.yy.c $(BG)parser-lalr.tab.h
81+
@$(call E, cc: $@)
82+
$(Q)$(CFG_CC) -include $(BG)parser-lalr.tab.h -c -o $@ $<
83+
84+
$(BG)parser-lalr.tab.c $(BG)parser-lalr.tab.h: $(SG)parser-lalr.y
85+
@$(call E, bison: $@)
86+
$(Q)$(CFG_BISON) $< --output=$(BG)parser-lalr.tab.c --defines=$(BG)parser-lalr.tab.h \
87+
--name-prefix=rs --warnings=error=all
88+
89+
$(BG)parser-lalr.o: $(BG)parser-lalr.tab.c
90+
@$(call E, cc: $@)
91+
$(Q)$(CFG_CC) -c -o $@ $<
92+
93+
$(BG)parser-lalr-main.o: $(SG)parser-lalr-main.c
94+
@$(call E, cc: $@)
95+
$(Q)$(CFG_CC) -std=c99 -c -o $@ $<
96+
97+
$(BG)parser-lalr: $(BG)parser-lalr.o $(BG)parser-lalr-main.o $(BG)lexer-lalr.o
98+
@$(call E, cc: $@)
99+
$(Q)$(CFG_CC) -o $@ $^ $(FLEX_LDFLAGS)
100+
101+
102+
ifdef CFG_FLEX
103+
ifdef CFG_BISON
104+
check-grammar: $(BG) $(BG)parser-lalr
105+
$(info Verifying grammar ...)
106+
$(SG)testparser.py -p $(BG)parser-lalr -s $(S)src
107+
108+
else
109+
$(info cfg: bison not available, skipping parser test...)
110+
check-grammar:
111+
112+
endif
113+
else
114+
$(info cfg: flex not available, skipping parser test...)
115+
check-grammar:
116+
117+
endif

branches/snap-stage3/mk/main.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)
3030
CFG_DISABLE_UNSTABLE_FEATURES=1
3131
endif
3232
ifeq ($(CFG_RELEASE_CHANNEL),beta)
33-
CFG_RELEASE=$(CFG_RELEASE_NUM)-beta(CFG_PRERELEASE_VERSION)
34-
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-beta(CFG_PRERELEASE_VERSION)
33+
CFG_RELEASE=$(CFG_RELEASE_NUM)-beta$(CFG_PRERELEASE_VERSION)
34+
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-beta$(CFG_PRERELEASE_VERSION)
3535
CFG_DISABLE_UNSTABLE_FEATURES=1
3636
endif
3737
ifeq ($(CFG_RELEASE_CHANNEL),nightly)

branches/snap-stage3/mk/tests.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ tidy:
301301
| grep '^$(S)src/rust-installer' -v \
302302
| xargs $(CFG_PYTHON) $(S)src/etc/check-binaries.py
303303
$(Q) $(CFG_PYTHON) $(S)src/etc/errorck.py $(S)src/
304+
$(Q) $(CFG_PYTHON) $(S)src/etc/featureck.py $(S)src/
304305

305306

306307
endif

branches/snap-stage3/src/compiletest/common.rs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ pub use self::Mode::*;
1111

1212
use std::fmt;
1313
use std::str::FromStr;
14-
use regex::Regex;
1514

16-
#[derive(Clone, PartialEq, Debug)]
15+
#[cfg(stage0)] // NOTE: remove impl after snapshot
16+
#[derive(Clone, Copy, PartialEq, Show)]
1717
pub enum Mode {
1818
CompileFail,
1919
RunFail,
@@ -25,7 +25,18 @@ pub enum Mode {
2525
Codegen
2626
}
2727

28-
impl Copy for Mode {}
28+
#[cfg(not(stage0))] // NOTE: remove cfg after snapshot
29+
#[derive(Clone, Copy, PartialEq, Debug)]
30+
pub enum Mode {
31+
CompileFail,
32+
RunFail,
33+
RunPass,
34+
RunPassValgrind,
35+
Pretty,
36+
DebugInfoGdb,
37+
DebugInfoLldb,
38+
Codegen
39+
}
2940

3041
impl FromStr for Mode {
3142
fn from_str(s: &str) -> Option<Mode> {
@@ -101,10 +112,7 @@ pub struct Config {
101112
pub run_ignored: bool,
102113

103114
// Only run tests that match this filter
104-
pub filter: Option<Regex>,
105-
106-
// Precompiled regex for finding expected errors in cfail
107-
pub cfail_regex: Regex,
115+
pub filter: Option<String>,
108116

109117
// Write out a parseable log of tests that were run
110118
pub logfile: Option<Path>,

branches/snap-stage3/src/compiletest/compiletest.rs

Lines changed: 50 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,15 @@
1313
#![feature(slicing_syntax, unboxed_closures)]
1414
#![feature(box_syntax)]
1515
#![feature(int_uint)]
16-
#![allow(unstable)]
16+
#![feature(test)]
17+
#![feature(rustc_private)]
18+
#![feature(std_misc)]
19+
#![feature(path)]
20+
#![feature(io)]
21+
#![feature(core)]
22+
#![feature(collections)]
23+
#![feature(os)]
24+
#![feature(unicode)]
1725

1826
#![deny(warnings)]
1927

@@ -22,18 +30,16 @@ extern crate getopts;
2230

2331
#[macro_use]
2432
extern crate log;
25-
extern crate regex;
2633

2734
use std::os;
28-
use std::io;
29-
use std::io::fs;
35+
use std::old_io;
36+
use std::old_io::fs;
3037
use std::str::FromStr;
3138
use std::thunk::Thunk;
3239
use getopts::{optopt, optflag, reqopt};
3340
use common::Config;
3441
use common::{Pretty, DebugInfoGdb, DebugInfoLldb, Codegen};
3542
use util::logv;
36-
use regex::Regex;
3743

3844
pub mod procsrv;
3945
pub mod util;
@@ -116,14 +122,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
116122
}
117123

118124
let filter = if !matches.free.is_empty() {
119-
let s = matches.free[0].as_slice();
120-
match regex::Regex::new(s) {
121-
Ok(re) => Some(re),
122-
Err(e) => {
123-
println!("failed to parse filter /{}/: {:?}", s, e);
124-
panic!()
125-
}
126-
}
125+
Some(matches.free[0].clone())
127126
} else {
128127
None
129128
};
@@ -145,7 +144,6 @@ pub fn parse_config(args: Vec<String> ) -> Config {
145144
.as_slice()).expect("invalid mode"),
146145
run_ignored: matches.opt_present("ignored"),
147146
filter: filter,
148-
cfail_regex: Regex::new(errors::EXPECTED_PATTERN).unwrap(),
149147
logfile: matches.opt_str("logfile").map(|s| Path::new(s)),
150148
runtool: matches.opt_str("runtool"),
151149
host_rustcflags: matches.opt_str("host-rustcflags"),
@@ -247,7 +245,10 @@ pub fn run_tests(config: &Config) {
247245
// sadly osx needs some file descriptor limits raised for running tests in
248246
// parallel (especially when we have lots and lots of child processes).
249247
// For context, see #8904
250-
io::test::raise_fd_limit();
248+
old_io::test::raise_fd_limit();
249+
// Prevent issue #21352 UAC blocking .exe containing 'patch' etc. on Windows
250+
// If #11207 is resolved (adding manifest to .exe) this becomes unnecessary
251+
os::setenv("__COMPAT_LAYER", "RunAsInvoker");
251252
let res = test::run_tests_console(&opts, tests.into_iter().collect());
252253
match res {
253254
Ok(true) => {}
@@ -371,18 +372,24 @@ fn extract_gdb_version(full_version_line: Option<String>) -> Option<String> {
371372
if full_version_line.as_slice().trim().len() > 0 => {
372373
let full_version_line = full_version_line.as_slice().trim();
373374

374-
let re = Regex::new(r"(^|[^0-9])([0-9]\.[0-9])([^0-9]|$)").unwrap();
375-
376-
match re.captures(full_version_line) {
377-
Some(captures) => {
378-
Some(captures.at(2).unwrap_or("").to_string())
375+
// used to be a regex "(^|[^0-9])([0-9]\.[0-9])([^0-9]|$)"
376+
for (pos, c) in full_version_line.char_indices() {
377+
if !c.is_digit(10) { continue }
378+
if pos + 2 >= full_version_line.len() { continue }
379+
if full_version_line.char_at(pos + 1) != '.' { continue }
380+
if !full_version_line.char_at(pos + 2).is_digit(10) { continue }
381+
if pos > 0 && full_version_line.char_at_reverse(pos).is_digit(10) {
382+
continue
379383
}
380-
None => {
381-
println!("Could not extract GDB version from line '{}'",
382-
full_version_line);
383-
None
384+
if pos + 3 < full_version_line.len() &&
385+
full_version_line.char_at(pos + 3).is_digit(10) {
386+
continue
384387
}
388+
return Some(full_version_line[pos..pos+3].to_string());
385389
}
390+
println!("Could not extract GDB version from line '{}'",
391+
full_version_line);
392+
None
386393
},
387394
_ => None
388395
}
@@ -405,18 +412,26 @@ fn extract_lldb_version(full_version_line: Option<String>) -> Option<String> {
405412
if full_version_line.as_slice().trim().len() > 0 => {
406413
let full_version_line = full_version_line.as_slice().trim();
407414

408-
let re = Regex::new(r"[Ll][Ll][Dd][Bb]-([0-9]+)").unwrap();
409-
410-
match re.captures(full_version_line) {
411-
Some(captures) => {
412-
Some(captures.at(1).unwrap_or("").to_string())
413-
}
414-
None => {
415-
println!("Could not extract LLDB version from line '{}'",
416-
full_version_line);
417-
None
418-
}
415+
for (pos, l) in full_version_line.char_indices() {
416+
if l != 'l' && l != 'L' { continue }
417+
if pos + 5 >= full_version_line.len() { continue }
418+
let l = full_version_line.char_at(pos + 1);
419+
if l != 'l' && l != 'L' { continue }
420+
let d = full_version_line.char_at(pos + 2);
421+
if d != 'd' && d != 'D' { continue }
422+
let b = full_version_line.char_at(pos + 3);
423+
if b != 'b' && b != 'B' { continue }
424+
let dash = full_version_line.char_at(pos + 4);
425+
if dash != '-' { continue }
426+
427+
let vers = full_version_line[pos + 5..].chars().take_while(|c| {
428+
c.is_digit(10)
429+
}).collect::<String>();
430+
if vers.len() > 0 { return Some(vers) }
419431
}
432+
println!("Could not extract LLDB version from line '{}'",
433+
full_version_line);
434+
None
420435
},
421436
_ => None
422437
}

0 commit comments

Comments
 (0)