Skip to content

Commit 3e5cef4

Browse files
committed
---
yaml --- r: 97877 b: refs/heads/master c: 1f1838e h: refs/heads/master i: 97875: d111555 v: v3
1 parent 9834a68 commit 3e5cef4

Some content is hidden

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

96 files changed

+2022
-1697
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 7de2379013f4d8a1e08347ab91a029fb8082c9e5
2+
refs/heads/master: 1f1838ea3e6795487521d4541bbd877d8e0797b8
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: b6400f998497c3958f40997a71756ead344a776d
55
refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36

trunk/Makefile.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# stageN - this is the system root, corresponding to, e.g. /usr
3434
# bin - binaries compiled for the host
3535
# lib - libraries used by the host compiler
36-
# rustc - rustc's own place to organize libraries
36+
# rustlib - rustc's own place to organize libraries
3737
# $(target) - target-specific artifacts
3838
# bin - binaries for target architectures
3939
# lib - libraries for target architectures
@@ -415,6 +415,7 @@ export CFG_LLVM_ROOT
415415
export CFG_ENABLE_MINGW_CROSS
416416
export CFG_PREFIX
417417
export CFG_LIBDIR
418+
export CFG_RUSTLIBDIR
418419

419420
######################################################################
420421
# Subprograms
@@ -435,7 +436,7 @@ HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin
435436
HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR)
436437

437438
# Destinations of artifacts for target architectures
438-
TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustc/$(2)
439+
TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/$$(CFG_RUSTLIBDIR)/$(2)
439440
TBIN$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/bin
440441
TLIB$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/$$(CFG_LIBDIR)
441442

trunk/configure

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ valopt datadir "${CFG_PREFIX}/share" "install data"
398398
valopt infodir "${CFG_PREFIX}/share/info" "install additional info"
399399
valopt mandir "${CFG_PREFIX}/share/man" "install man pages in PATH"
400400
valopt libdir "${CFG_PREFIX}/lib" "install libraries"
401+
valopt rustlibdir "rustlib" "subdirectory name for rustc's libraries"
401402

402403
# Validate Options
403404
step_msg "validating $CFG_SELF args"
@@ -775,11 +776,16 @@ do
775776
make_dir $h/stage$i/test
776777

777778
# target bin dir
778-
make_dir $h/stage$i/$CFG_LIBDIR/rustc/$t/bin
779+
make_dir $h/stage$i/$CFG_LIBDIR/$CFG_RUSTLIBDIR/$t/bin
779780

780781
# target lib dir
781-
make_dir $h/stage$i/$CFG_LIBDIR/rustc/$t/$CFG_LIBDIR
782+
make_dir $h/stage$i/$CFG_LIBDIR/$CFG_RUSTLIBDIR/$t/$CFG_LIBDIR
782783
done
784+
785+
# Fix stage0:
786+
make_dir $h/stage0/$CFG_LIBDIR/rustc/$t/bin
787+
make_dir $h/stage0/$CFG_LIBDIR/rustc/$t/$CFG_LIBDIR
788+
783789
done
784790

785791
make_dir $h/test/run-pass
@@ -1031,6 +1037,7 @@ putvar CFG_HOST
10311037
putvar CFG_TARGET
10321038
putvar CFG_C_COMPILER
10331039
putvar CFG_LIBDIR
1040+
putvar CFG_RUSTLIBDIR
10341041
putvar CFG_DISABLE_MANAGE_SUBMODULES
10351042
putvar CFG_ANDROID_CROSS_PATH
10361043
putvar CFG_MINGW32_CROSS_PATH

trunk/doc/rust.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3054,8 +3054,7 @@ assert!(b != "world");
30543054
The vector type constructor represents a homogeneous array of values of a given type.
30553055
A vector has a fixed size.
30563056
(Operations like `vec.push` operate solely on owned vectors.)
3057-
A vector type can be annotated with a _definite_ size,
3058-
written with a trailing asterisk and integer literal, such as `[int * 10]`.
3057+
A vector type can be annotated with a _definite_ size, such as `[int, ..10]`.
30593058
Such a definite-sized vector type is a first-class type, since its size is known statically.
30603059
A vector without such a size is said to be of _indefinite_ size,
30613060
and is therefore not a _first-class_ type.

trunk/mk/install.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ TB$(1)$(2) = $$(TBIN$$(ISTAGE)_T_$(1)_H_$(2))
7474
TL$(1)$(2) = $$(TLIB$$(ISTAGE)_T_$(1)_H_$(2))
7575

7676
# PT{R,B,L} == Prefix Target {Root, Bin, Lib}
77-
PTR$(1)$(2) = $$(PREFIX_LIB)/rustc/$(1)
77+
PTR$(1)$(2) = $$(PREFIX_LIB)/$(CFG_RUSTLIBDIR)/$(1)
7878
PTB$(1)$(2) = $$(PTR$(1)$(2))/bin
7979
PTL$(1)$(2) = $$(PTR$(1)$(2))/$(CFG_LIBDIR)
8080

trunk/mk/stage0.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $(SNAPSHOT_RUSTC_POST_CLEANUP): \
1515
# Note: the variable "SNAPSHOT_FILE" is generally not set, and so
1616
# we generally only pass one argument to this script.
1717
ifdef CFG_ENABLE_LOCAL_RUST
18-
$(Q)$(S)src/etc/local_stage0.sh $(CFG_BUILD) $(CFG_LOCAL_RUST_ROOT)
18+
$(Q)$(S)src/etc/local_stage0.sh $(CFG_BUILD) $(CFG_LOCAL_RUST_ROOT) $(CFG_RUSTLIBDIR)
1919
else
2020
$(Q)$(CFG_PYTHON) $(S)src/etc/get-snapshot.py $(CFG_BUILD) $(SNAPSHOT_FILE)
2121
ifdef CFG_ENABLE_PAX_FLAGS

trunk/mk/target.mk

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB_$(2)): \
5959
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
6060
| $$(TLIB$(1)_T_$(2)_H_$(3))/
6161
@$$(call E, compile_and_link: $$@)
62+
ifeq ($(1),0)
63+
$$(Q)cp $(3)/stage0/$(CFG_LIBDIR)/rustlib/$(2)/$(CFG_LIBDIR)/* \
64+
$(3)/stage0/$(CFG_LIBDIR)/rustc/$(2)/$(CFG_LIBDIR)/
65+
endif
6266
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(STDLIB_GLOB_$(2)),$$(notdir $$@))
6367
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(STDLIB_RGLOB_$(2)),$$(notdir $$@))
6468
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) --out-dir $$(@D) $$< && touch $$@
@@ -71,6 +75,10 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_EXTRALIB_$(2)): \
7175
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
7276
| $$(TLIB$(1)_T_$(2)_H_$(3))/
7377
@$$(call E, compile_and_link: $$@)
78+
ifeq ($(1),0)
79+
$$(Q)cp $(3)/stage0/$(CFG_LIBDIR)/rustlib/$(2)/$(CFG_LIBDIR)/* \
80+
$(3)/stage0/$(CFG_LIBDIR)/rustc/$(2)/$(CFG_LIBDIR)/
81+
endif
7482
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(EXTRALIB_GLOB_$(2)),$$(notdir $$@))
7583
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(EXTRALIB_RGLOB_$(2)),$$(notdir $$@))
7684
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) --out-dir $$(@D) $$< && touch $$@
@@ -127,6 +135,10 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBSYNTAX_$(3)): \
127135
$$(TEXTRALIB_DEFAULT$(1)_T_$(2)_H_$(3)) \
128136
| $$(TLIB$(1)_T_$(2)_H_$(3))/
129137
@$$(call E, compile_and_link: $$@)
138+
ifeq ($(1),0)
139+
$$(Q)cp $(3)/stage0/$(CFG_LIBDIR)/rustlib/$(2)/$(CFG_LIBDIR)/* \
140+
$(3)/stage0/$(CFG_LIBDIR)/rustc/$(2)/$(CFG_LIBDIR)/
141+
endif
130142
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBSYNTAX_GLOB_$(2)),$$(notdir $$@))
131143
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBSYNTAX_RGLOB_$(2)),$$(notdir $$@))
132144
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) $(BORROWCK) --out-dir $$(@D) $$< && touch $$@
@@ -152,6 +164,10 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTC_$(3)): \
152164
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUSTLLVM_$(3)) \
153165
| $$(TLIB$(1)_T_$(2)_H_$(3))/
154166
@$$(call E, compile_and_link: $$@)
167+
ifeq ($(1),0)
168+
$$(Q)cp $(3)/stage0/$(CFG_LIBDIR)/rustlib/$(2)/$(CFG_LIBDIR)/* \
169+
$(3)/stage0/$(CFG_LIBDIR)/rustc/$(2)/$(CFG_LIBDIR)/
170+
endif
155171
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTC_GLOB_$(2)),$$(notdir $$@))
156172
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTC_RGLOB_$(2)),$$(notdir $$@))
157173
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) \
@@ -166,6 +182,10 @@ $$(TBIN$(1)_T_$(2)_H_$(3))/rustc$$(X_$(3)): \
166182
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTC_$(3)) \
167183
| $$(TBIN$(1)_T_$(2)_H_$(3))/
168184
@$$(call E, compile_and_link: $$@)
185+
ifeq ($(1),0)
186+
$$(Q)cp $(3)/stage0/$(CFG_LIBDIR)/rustlib/$(2)/$(CFG_LIBDIR)/* \
187+
$(3)/stage0/$(CFG_LIBDIR)/rustc/$(2)/$(CFG_LIBDIR)/
188+
endif
169189
$$(STAGE$(1)_T_$(2)_H_$(3)) --cfg rustc -o $$@ $$<
170190
ifdef CFG_ENABLE_PAX_FLAGS
171191
@$$(call E, apply PaX flags: $$@)

trunk/mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ ifdef CFG_WINDOWSY_$(1)
108108
stage2/$$(CFG_LIBDIR), \
109109
$$(if $$(findstring stage3,$$(1)), \
110110
stage3/$$(CFG_LIBDIR), \
111-
)))))/rustc/$$(CFG_BUILD)/$$(CFG_LIBDIR)
111+
)))))/$$(CFG_RUSTLIBDIR)/$$(CFG_BUILD)/$$(CFG_LIBDIR)
112112
CFG_RUN_TEST_$(1)=$$(call CFG_RUN_$(1),$$(call CFG_TESTLIB_$(1),$$(1),$$(3)),$$(1))
113113
endif
114114

trunk/src/etc/get-snapshot.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -32,40 +32,6 @@ def unpack_snapshot(triple, dl_path):
3232
tar.close()
3333
shutil.rmtree(download_unpack_base)
3434

35-
def determine_curr_snapshot(triple):
36-
i = 0
37-
platform = get_platform(triple)
38-
39-
found_file = False
40-
found_snap = False
41-
hsh = None
42-
date = None
43-
rev = None
44-
45-
f = open(snapshotfile)
46-
for line in f.readlines():
47-
i += 1
48-
parsed = parse_line(i, line)
49-
if (not parsed): continue
50-
51-
if found_snap and parsed["type"] == "file":
52-
if parsed["platform"] == platform:
53-
hsh = parsed["hash"]
54-
found_file = True
55-
break;
56-
elif parsed["type"] == "snapshot":
57-
date = parsed["date"]
58-
rev = parsed["rev"]
59-
found_snap = True
60-
61-
if not found_snap:
62-
raise Exception("no snapshot entries in file")
63-
64-
if not found_file:
65-
raise Exception("no snapshot file found for platform %s, rev %s" %
66-
(platform, rev))
67-
68-
return full_snapshot_name(date, rev, platform, hsh)
6935

7036
# Main
7137

trunk/src/etc/local_stage0.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
TARG_DIR=$1
44
PREFIX=$2
5+
RUSTLIBDIR=$3
56

67
LIB_DIR=lib
78
LIB_PREFIX=lib
@@ -43,7 +44,7 @@ if [ -z $TARG_DIR ]; then
4344
fi
4445

4546
cp ${PREFIX}/bin/rustc${BIN_SUF} ${TARG_DIR}/stage0/bin/
46-
cp ${PREFIX}/${LIB_DIR}/rustc/${TARG_DIR}/${LIB_DIR}/* ${TARG_DIR}/stage0/${LIB_DIR}/
47+
cp ${PREFIX}/${LIB_DIR}/${RUSTLIBDIR}/${TARG_DIR}/${LIB_DIR}/* ${TARG_DIR}/stage0/${LIB_DIR}/
4748
cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}extra*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
4849
cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}rust*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
4950
cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}std*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/

trunk/src/etc/snapshot.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,3 +194,41 @@ def in_tar_name(fn):
194194
shutil.move(file0, file1)
195195

196196
return file1
197+
198+
def determine_curr_snapshot_info(triple):
199+
i = 0
200+
platform = get_platform(triple)
201+
202+
found_file = False
203+
found_snap = False
204+
hsh = None
205+
date = None
206+
rev = None
207+
208+
f = open(snapshotfile)
209+
for line in f.readlines():
210+
i += 1
211+
parsed = parse_line(i, line)
212+
if (not parsed): continue
213+
214+
if found_snap and parsed["type"] == "file":
215+
if parsed["platform"] == platform:
216+
hsh = parsed["hash"]
217+
found_file = True
218+
break;
219+
elif parsed["type"] == "snapshot":
220+
date = parsed["date"]
221+
rev = parsed["rev"]
222+
found_snap = True
223+
224+
if not found_snap:
225+
raise Exception("no snapshot entries in file")
226+
227+
if not found_file:
228+
raise Exception("no snapshot file found for platform %s, rev %s" %
229+
(platform, rev))
230+
231+
return (date, rev, platform, hsh)
232+
233+
def determine_curr_snapshot(triple):
234+
return full_snapshot_name(*determine_curr_snapshot_info(triple))

trunk/src/etc/tidy.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import sys, fileinput, subprocess, re
55
from licenseck import *
6+
import snapshot
67

78
err=0
89
cols=100
@@ -51,7 +52,19 @@ def do_license_check(name, contents):
5152
report_err("TODO is deprecated; use FIXME")
5253
match = re.match(r'^.*//\s*(NOTE.*)$', line)
5354
if match:
54-
report_warn(match.group(1))
55+
m = match.group(1)
56+
if "snap" in m.lower():
57+
report_warn(match.group(1))
58+
match = re.match(r'^.*//\s*SNAP\s+(\w+)', line)
59+
if match:
60+
hsh = match.group(1)
61+
a, b, c, phash = snapshot.determine_curr_snapshot_info()
62+
if not phash.startswith(hsh):
63+
report_err("Snapshot out of date: " + line)
64+
else:
65+
if "SNAP" in line:
66+
report_warn("Unmatched SNAP line: " + line)
67+
5568
if (line.find('\t') != -1 and
5669
fileinput.filename().find("Makefile") == -1):
5770
report_err("tab character")

trunk/src/libextra/getopts.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1522,6 +1522,9 @@ mod tests {
15221522
optmulti("l")
15231523
];
15241524
1525+
// short and verbose should always be in the same order. if they
1526+
// aren't the test will fail (and in mysterious ways)
1527+
15251528
let verbose = ~[
15261529
groups::reqopt("b", "banana", "Desc", "VAL"),
15271530
groups::optopt("a", "apple", "Desc", "VAL"),
@@ -1533,7 +1536,6 @@ mod tests {
15331536
let sample_args = ~[~"--kiwi", ~"15", ~"--apple", ~"1", ~"k",
15341537
~"-p", ~"16", ~"l", ~"35"];
15351538
1536-
// FIXME #4681: sort options here?
15371539
assert!(getopts(sample_args, short)
15381540
== groups::getopts(sample_args, verbose));
15391541
}

0 commit comments

Comments
 (0)