Skip to content

Commit 5603134

Browse files
committed
---
yaml --- r: 149083 b: refs/heads/try2 c: 1dc6359 h: refs/heads/master i: 149081: 6f14f30 149079: f748688 v: v3
1 parent 84a976b commit 5603134

File tree

12 files changed

+140
-130
lines changed

12 files changed

+140
-130
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: ccd1cda10eaa570e67d8daccfcb3e0e3b651da2d
8+
refs/heads/try2: 1dc6359a0abd414ed2414da2cfd3751f364a59bf
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
################################################################################
5151

5252
TARGET_CRATES := std extra green rustuv native flate arena glob term semver \
53-
uuid serialize sync getopts collections fourcc
54-
HOST_CRATES := syntax rustc rustdoc
53+
uuid serialize sync getopts collections
54+
HOST_CRATES := syntax rustc rustdoc fourcc
5555
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5656
TOOLS := compiletest rustdoc rustc
5757

branches/try2/src/doc/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ li {list-style-type: none; }
4040
* [The `arena` allocation library](arena/index.html)
4141
* [The `collections` library](collections/index.html)
4242
* [The `flate` compression library](flate/index.html)
43+
* [The `fourcc` four-character code library](fourcc/index.html)
4344
* [The `getopts` argument parsing library](getopts/index.html)
4445
* [The `glob` file path matching library](glob/index.html)
4546
* [The `semver` version collation library](semver/index.html)

branches/try2/src/etc/snapshot.py

Lines changed: 115 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@
1111
import re, os, sys, glob, tarfile, shutil, subprocess, tempfile, distutils.spawn
1212

1313
try:
14-
import hashlib
15-
sha_func = hashlib.sha1
14+
import hashlib
15+
sha_func = hashlib.sha1
1616
except ImportError:
17-
import sha
18-
sha_func = sha.new
17+
import sha
18+
sha_func = sha.new
1919

2020
def scrub(b):
21-
if sys.version_info >= (3,) and type(b) == bytes:
22-
return b.decode('ascii')
23-
else:
24-
return b
21+
if sys.version_info >= (3,) and type(b) == bytes:
22+
return b.decode('ascii')
23+
else:
24+
return b
2525

2626
src_dir = scrub(os.getenv("CFG_SRC_DIR"))
2727
if not src_dir:
28-
raise Exception("missing env var CFG_SRC_DIR")
28+
raise Exception("missing env var CFG_SRC_DIR")
2929

3030
snapshotfile = os.path.join(src_dir, "src", "snapshots.txt")
3131
download_url_base = "http://static.rust-lang.org/stage0-snapshots"
@@ -39,36 +39,37 @@ def scrub(b):
3939
"freebsd": ["bin/rustc"],
4040
}
4141

42-
winnt_runtime_deps = ["libgcc_s_dw2-1.dll", "libstdc++-6.dll"]
42+
winnt_runtime_deps = ["libgcc_s_dw2-1.dll",
43+
"libstdc++-6.dll"]
4344

4445
def parse_line(n, line):
45-
global snapshotfile
46+
global snapshotfile
4647

47-
if re.match(r"\s*$", line): return None
48+
if re.match(r"\s*$", line): return None
4849

49-
if re.match(r"^T\s*$", line): return None
50+
if re.match(r"^T\s*$", line): return None
5051

51-
match = re.match(r"\s+([\w_-]+) ([a-fA-F\d]{40})\s*$", line)
52-
if match:
53-
return { "type": "file",
54-
"platform": match.group(1),
55-
"hash": match.group(2).lower() }
52+
match = re.match(r"\s+([\w_-]+) ([a-fA-F\d]{40})\s*$", line)
53+
if match:
54+
return { "type": "file",
55+
"platform": match.group(1),
56+
"hash": match.group(2).lower() }
5657

57-
match = re.match(r"([ST]) (\d{4}-\d{2}-\d{2}) ([a-fA-F\d]+)\s*$", line);
58-
if not match:
59-
raise Exception("%s:%d:E syntax error: " % (snapshotfile, n))
60-
return { "type": "snapshot",
61-
"date": match.group(2),
62-
"rev": match.group(3) }
58+
match = re.match(r"([ST]) (\d{4}-\d{2}-\d{2}) ([a-fA-F\d]+)\s*$", line);
59+
if (not match):
60+
raise Exception("%s:%d:E syntax error: " % (snapshotfile, n))
61+
return {"type": "snapshot",
62+
"date": match.group(2),
63+
"rev": match.group(3)}
6364

6465

6566
def partial_snapshot_name(date, rev, platform):
66-
return ("rust-stage0-%s-%s-%s.tar.bz2"
67-
% (date, rev, platform))
67+
return ("rust-stage0-%s-%s-%s.tar.bz2"
68+
% (date, rev, platform))
6869

6970
def full_snapshot_name(date, rev, platform, hsh):
70-
return ("rust-stage0-%s-%s-%s-%s.tar.bz2"
71-
% (date, rev, platform, hsh))
71+
return ("rust-stage0-%s-%s-%s-%s.tar.bz2"
72+
% (date, rev, platform, hsh))
7273

7374

7475
def get_kernel(triple):
@@ -85,22 +86,23 @@ def get_kernel(triple):
8586
def get_cpu(triple):
8687
arch = triple.split('-')[0]
8788
if arch == "i686":
88-
return "i386"
89+
return "i386"
8990
return arch
9091

9192
def get_platform(triple):
92-
return "%s-%s" % (get_kernel(triple), get_cpu(triple))
93+
return "%s-%s" % (get_kernel(triple), get_cpu(triple))
9394

9495

9596
def cmd_out(cmdline):
96-
p = subprocess.Popen(cmdline, stdout=subprocess.PIPE)
97+
p = subprocess.Popen(cmdline,
98+
stdout=subprocess.PIPE)
9799
return scrub(p.communicate()[0].strip())
98100

99101

100102
def local_rev_info(field):
101103
return cmd_out(["git", "--git-dir=" + os.path.join(src_dir, ".git"),
102-
"log", "-n", "1",
103-
"--format=%%%s" % field, "HEAD"])
104+
"log", "-n", "1",
105+
"--format=%%%s" % field, "HEAD"])
104106

105107

106108
def local_rev_full_sha():
@@ -133,10 +135,10 @@ def get_url_to_file(u,f):
133135
os.rename(tmpf, f)
134136

135137
def snap_filename_hash_part(snap):
136-
match = re.match(r".*([a-fA-F\d]{40}).tar.bz2$", snap)
137-
if not match:
138-
raise Exception("unable to find hash in filename: " + snap)
139-
return match.group(1)
138+
match = re.match(r".*([a-fA-F\d]{40}).tar.bz2$", snap)
139+
if not match:
140+
raise Exception("unable to find hash in filename: " + snap)
141+
return match.group(1)
140142

141143
def hash_file(x):
142144
h = sha_func()
@@ -148,13 +150,13 @@ def get_winnt_runtime_deps():
148150
runtime_deps = []
149151
path_dirs = os.environ["PATH"].split(';')
150152
for name in winnt_runtime_deps:
151-
for dir in path_dirs:
152-
matches = glob.glob(os.path.join(dir, name))
153-
if matches:
154-
runtime_deps.append(matches[0])
155-
break
156-
else:
157-
raise Exception("Could not find runtime dependency: %s" % name)
153+
for dir in path_dirs:
154+
matches = glob.glob(os.path.join(dir, name))
155+
if matches:
156+
runtime_deps.append(matches[0])
157+
break
158+
else:
159+
raise Exception("Could not find runtime dependency: %s" % name)
158160
return runtime_deps
159161

160162
def make_snapshot(stage, triple):
@@ -166,31 +168,31 @@ def make_snapshot(stage, triple):
166168
file0 = partial_snapshot_name(date, rev, platform)
167169

168170
def in_tar_name(fn):
169-
cs = re.split(r"[\\/]", fn)
170-
if len(cs) >= 2:
171-
return os.sep.join(cs[-2:])
171+
cs = re.split(r"[\\/]", fn)
172+
if len(cs) >= 2:
173+
return os.sep.join(cs[-2:])
172174

173175
tar = tarfile.open(file0, "w:bz2")
174176

175177
for name in snapshot_files[kernel]:
176-
dir = stage
177-
if stage == "stage1" and re.match(r"^lib/(lib)?std.*", name):
178-
dir = "stage0"
179-
fn_glob = os.path.join(triple, dir, name)
180-
matches = glob.glob(fn_glob)
181-
if not matches:
182-
raise Exception("Not found file with name like " + fn_glob)
183-
if len(matches) == 1:
184-
tar.add(matches[0], "rust-stage0/" + in_tar_name(matches[0]))
185-
else:
186-
raise Exception("Found stale files: \n %s\n"
187-
"Please make a clean build." % "\n ".join(matches))
178+
dir = stage
179+
if stage == "stage1" and re.match(r"^lib/(lib)?std.*", name):
180+
dir = "stage0"
181+
fn_glob = os.path.join(triple, dir, name)
182+
matches = glob.glob(fn_glob)
183+
if not matches:
184+
raise Exception("Not found file with name like " + fn_glob)
185+
if len(matches) == 1:
186+
tar.add(matches[0], "rust-stage0/" + in_tar_name(matches[0]))
187+
else:
188+
raise Exception("Found stale files: \n %s\n"
189+
"Please make a clean build." % "\n ".join(matches))
188190

189191
if kernel=="winnt":
190-
for path in get_winnt_runtime_deps():
191-
tar.add(path, "rust-stage0/bin/" + os.path.basename(path))
192-
tar.add(os.path.join(os.path.dirname(__file__), "third-party"),
193-
"rust-stage0/bin/third-party")
192+
for path in get_winnt_runtime_deps():
193+
tar.add(path, "rust-stage0/bin/" + os.path.basename(path))
194+
tar.add(os.path.join(os.path.dirname(__file__), "third-party"),
195+
"rust-stage0/bin/third-party")
194196

195197
tar.close()
196198

@@ -202,59 +204,59 @@ def in_tar_name(fn):
202204
return file1
203205

204206
def curr_snapshot_rev():
205-
i = 0
206-
found_snap = False
207-
date = None
208-
rev = None
207+
i = 0
208+
found_snap = False
209+
date = None
210+
rev = None
209211

210-
f = open(snapshotfile)
211-
for line in f.readlines():
212-
i += 1
213-
parsed = parse_line(i, line)
214-
if (not parsed): continue
212+
f = open(snapshotfile)
213+
for line in f.readlines():
214+
i += 1
215+
parsed = parse_line(i, line)
216+
if (not parsed): continue
215217

216-
if parsed["type"] == "snapshot":
217-
date = parsed["date"]
218-
rev = parsed["rev"]
219-
found_snap = True
220-
break
218+
if parsed["type"] == "snapshot":
219+
date = parsed["date"]
220+
rev = parsed["rev"]
221+
found_snap = True
222+
break
221223

222-
if not found_snap:
223-
raise Exception("no snapshot entries in file")
224+
if not found_snap:
225+
raise Exception("no snapshot entries in file")
224226

225-
return (date, rev)
227+
return (date, rev)
226228

227229
def determine_curr_snapshot(triple):
228-
i = 0
229-
platform = get_platform(triple)
230-
231-
found_file = False
232-
found_snap = False
233-
hsh = None
234-
date = None
235-
rev = None
236-
237-
f = open(snapshotfile)
238-
for line in f.readlines():
239-
i += 1
240-
parsed = parse_line(i, line)
241-
if (not parsed): continue
242-
243-
if found_snap and parsed["type"] == "file":
244-
if parsed["platform"] == platform:
245-
hsh = parsed["hash"]
246-
found_file = True
247-
break;
248-
elif parsed["type"] == "snapshot":
249-
date = parsed["date"]
250-
rev = parsed["rev"]
251-
found_snap = True
252-
253-
if not found_snap:
254-
raise Exception("no snapshot entries in file")
255-
256-
if not found_file:
257-
raise Exception("no snapshot file found for platform %s, rev %s" %
258-
(platform, rev))
259-
260-
return full_snapshot_name(date, rev, platform, hsh)
230+
i = 0
231+
platform = get_platform(triple)
232+
233+
found_file = False
234+
found_snap = False
235+
hsh = None
236+
date = None
237+
rev = None
238+
239+
f = open(snapshotfile)
240+
for line in f.readlines():
241+
i += 1
242+
parsed = parse_line(i, line)
243+
if (not parsed): continue
244+
245+
if found_snap and parsed["type"] == "file":
246+
if parsed["platform"] == platform:
247+
hsh = parsed["hash"]
248+
found_file = True
249+
break;
250+
elif parsed["type"] == "snapshot":
251+
date = parsed["date"]
252+
rev = parsed["rev"]
253+
found_snap = True
254+
255+
if not found_snap:
256+
raise Exception("no snapshot entries in file")
257+
258+
if not found_file:
259+
raise Exception("no snapshot file found for platform %s, rev %s" %
260+
(platform, rev))
261+
262+
return full_snapshot_name(date, rev, platform, hsh)

branches/try2/src/librustc/driver/driver.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -728,8 +728,7 @@ pub fn host_triple() -> ~str {
728728
(env!("CFG_COMPILER")).to_owned()
729729
}
730730
731-
pub fn build_session_options(binary: ~str,
732-
matches: &getopts::Matches)
731+
pub fn build_session_options(matches: &getopts::Matches)
733732
-> @session::Options {
734733
let crate_types = matches.opt_strs("crate-type").flat_map(|s| {
735734
s.split(',').map(|part| {
@@ -864,7 +863,6 @@ pub fn build_session_options(binary: ~str,
864863
maybe_sysroot: sysroot_opt,
865864
target_triple: target,
866865
cfg: cfg,
867-
binary: binary,
868866
test: test,
869867
parse_only: parse_only,
870868
no_trans: no_trans,
@@ -1159,7 +1157,7 @@ mod test {
11591157
Ok(m) => m,
11601158
Err(f) => fail!("test_switch_implies_cfg_test: {}", f.to_err_msg())
11611159
};
1162-
let sessopts = build_session_options(~"rustc", matches);
1160+
let sessopts = build_session_options(matches);
11631161
let sess = build_session(sessopts, None);
11641162
let cfg = build_configuration(sess);
11651163
assert!((attr::contains_name(cfg, "test")));
@@ -1177,7 +1175,7 @@ mod test {
11771175
f.to_err_msg());
11781176
}
11791177
};
1180-
let sessopts = build_session_options(~"rustc", matches);
1178+
let sessopts = build_session_options(matches);
11811179
let sess = build_session(sessopts, None);
11821180
let cfg = build_configuration(sess);
11831181
let mut test_items = cfg.iter().filter(|m| m.name().equiv(&("test")));

branches/try2/src/librustc/driver/session.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ pub struct Options {
132132
// will be added to the crate AST node. This should not be used for
133133
// anything except building the full crate config prior to parsing.
134134
cfg: ast::CrateConfig,
135-
binary: ~str,
136135
test: bool,
137136
parse_only: bool,
138137
no_trans: bool,
@@ -334,7 +333,6 @@ pub fn basic_options() -> @Options {
334333
maybe_sysroot: None,
335334
target_triple: host_triple(),
336335
cfg: ~[],
337-
binary: ~"rustc",
338336
test: false,
339337
parse_only: false,
340338
no_trans: false,

0 commit comments

Comments
 (0)