Skip to content

Commit 7c2974f

Browse files
committed
---
yaml --- r: 274347 b: refs/heads/stable c: f05bc16 h: refs/heads/master i: 274345: 92da98c 274343: 0041345
1 parent b52dd43 commit 7c2974f

File tree

288 files changed

+3270
-8033
lines changed

Some content is hidden

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

288 files changed

+3270
-8033
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 33b73e9643fdf7b5d3be47d92e996ab04d6212e9
32+
refs/heads/stable: f05bc16a5d8bb1bfb0ee2b281fb3dc6fdefa258c
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/CONTRIBUTING.md

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ links to the major sections:
66

77
* [Feature Requests](#feature-requests)
88
* [Bug Reports](#bug-reports)
9-
* [The Build System](#the-build-system)
109
* [Pull Requests](#pull-requests)
1110
* [Writing Documentation](#writing-documentation)
1211
* [Issue Triage](#issue-triage)
@@ -78,66 +77,6 @@ to do this is to invoke `rustc` like this:
7877
$ RUST_BACKTRACE=1 rustc ...
7978
```
8079

81-
## The Build System
82-
83-
Rust's build system allows you to bootstrap the compiler, run tests &
84-
benchmarks, generate documentation, install a fresh build of Rust, and more.
85-
It's your best friend when working on Rust, allowing you to compile & test
86-
your contributions before submission.
87-
88-
All the configuration for the build system lives in [the `mk` directory][mkdir]
89-
in the project root. It can be hard to follow in places, as it uses some
90-
advanced Make features which make for some challenging reading. If you have
91-
questions on the build system internals, try asking in
92-
[`#rust-internals`][pound-rust-internals].
93-
94-
[mkdir]: https://github.com/rust-lang/rust/tree/master/mk/
95-
96-
### Configuration
97-
98-
Before you can start building the compiler you need to configure the build for
99-
your system. In most cases, that will just mean using the defaults provided
100-
for Rust. Configuring involves invoking the `configure` script in the project
101-
root.
102-
103-
```
104-
./configure
105-
```
106-
107-
There are large number of options accepted by this script to alter the
108-
configuration used later in the build process. Some options to note:
109-
110-
- `--enable-debug` - Build a debug version of the compiler (disables optimizations)
111-
- `--enable-optimize` - Enable optimizations (can be used with `--enable-debug`
112-
to make a debug build with optimizations)
113-
- `--disable-valgrind-rpass` - Don't run tests with valgrind
114-
- `--enable-clang` - Prefer clang to gcc for building dependencies (e.g., LLVM)
115-
- `--enable-ccache` - Invoke clang/gcc with ccache to re-use object files between builds
116-
- `--enable-compiler-docs` - Build compiler documentation
117-
118-
To see a full list of options, run `./configure --help`.
119-
120-
### Useful Targets
121-
122-
Some common make targets are:
123-
124-
- `make rustc-stage1` - build up to (and including) the first stage. For most
125-
cases we don't need to build the stage2 compiler, so we can save time by not
126-
building it. The stage1 compiler is a fully functioning compiler and
127-
(probably) will be enough to determine if your change works as expected.
128-
- `make check` - build the full compiler & run all tests (takes a while). This
129-
is what gets run by the continuous integration system against your pull
130-
request. You should run this before submitting to make sure your tests pass
131-
& everything builds in the correct manner.
132-
- `make check-stage1-std NO_REBUILD=1` - test the standard library without
133-
rebuilding the entire compiler
134-
- `make check TESTNAME=<path-to-test-file>.rs` - Run a single test file
135-
- `make check-stage1-rpass TESTNAME=<path-to-test-file>.rs` - Run a single
136-
rpass test with the stage1 compiler (this will be quicker than running the
137-
command above as we only build the stage1 compiler, not the entire thing).
138-
You can also leave off the `-rpass` to run all stage1 test types.
139-
- `make check-stage1-coretest` - Run stage1 tests in `libcore`.
140-
14180
## Pull Requests
14281

14382
Pull requests are the primary mechanism we use to change Rust. GitHub itself

branches/stable/COPYRIGHT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ terms.
77
Longer version:
88

99
The Rust Project is copyright 2016, The Rust Project
10-
Developers.
10+
Developers (given in the file AUTHORS.txt).
1111

1212
Licensed under the Apache License, Version 2.0
1313
<LICENSE-APACHE or

branches/stable/Makefile.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,19 @@ endif
220220
# The test suite
221221
ifneq ($(strip $(findstring check,$(MAKECMDGOALS)) \
222222
$(findstring test,$(MAKECMDGOALS)) \
223+
$(findstring perf,$(MAKECMDGOALS)) \
223224
$(findstring tidy,$(MAKECMDGOALS))),)
224225
CFG_INFO := $(info cfg: including test rules)
225226
include $(CFG_SRC_DIR)mk/tests.mk
226227
include $(CFG_SRC_DIR)mk/grammar.mk
227228
endif
228229

230+
# Performance and benchmarking
231+
ifneq ($(findstring perf,$(MAKECMDGOALS)),)
232+
CFG_INFO := $(info cfg: including perf rules)
233+
include $(CFG_SRC_DIR)mk/perf.mk
234+
endif
235+
229236
# Copy all the distributables to another directory for binary install
230237
ifneq ($(strip $(findstring prepare,$(MAKECMDGOALS)) \
231238
$(findstring dist,$(MAKECMDGOALS)) \

branches/stable/configure

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ then
10511051
esac
10521052
else
10531053
case $CFG_CLANG_VERSION in
1054-
(3.2* | 3.3* | 3.4* | 3.5* | 3.6* | 3.7* | 3.8* | 3.9*)
1054+
(3.2* | 3.3* | 3.4* | 3.5* | 3.6* | 3.7* | 3.8*)
10551055
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
10561056
;;
10571057
(*)
@@ -1361,22 +1361,16 @@ for h in $CFG_HOST
13611361
do
13621362
for t in $CFG_TARGET
13631363
do
1364-
# host bin dir stage0
1365-
make_dir $h/stage0/bin
1366-
13671364
# host lib dir stage0
13681365
make_dir $h/stage0/lib
13691366

1370-
# host test dir stage0
1371-
make_dir $h/stage0/test
1372-
13731367
# target bin dir stage0
13741368
make_dir $h/stage0/lib/rustlib/$t/bin
13751369

13761370
# target lib dir stage0
13771371
make_dir $h/stage0/lib/rustlib/$t/lib
13781372

1379-
for i in 1 2 3
1373+
for i in 0 1 2 3
13801374
do
13811375
# host bin dir
13821376
make_dir $h/stage$i/bin
@@ -1409,7 +1403,6 @@ do
14091403
make_dir $h/test/debuginfo-gdb
14101404
make_dir $h/test/debuginfo-lldb
14111405
make_dir $h/test/codegen
1412-
make_dir $h/test/codegen-units
14131406
make_dir $h/test/rustdoc
14141407
done
14151408

branches/stable/mk/cfg/armv7-unknown-linux-gnueabihf.mk

Lines changed: 0 additions & 26 deletions
This file was deleted.

branches/stable/mk/main.mk

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,14 @@ STAGE$(1)_T_$(2)_H_$(3) := \
522522
$$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2)) \
523523
$$(RUSTC_FLAGS_$(2))
524524

525+
PERF_STAGE$(1)_T_$(2)_H_$(3) := \
526+
$$(Q)$$(call CFG_RUN_TARG_$(3),$(1), \
527+
$$(CFG_PERF_TOOL) \
528+
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
529+
--cfg $$(CFGFLAG$(1)_T_$(2)_H_$(3)) \
530+
$$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2)) \
531+
$$(RUSTC_FLAGS_$(2))
532+
525533
endef
526534

527535
$(foreach build,$(CFG_HOST), \

branches/stable/mk/perf.mk

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2+
# file at the top-level directory of this distribution and at
3+
# http://rust-lang.org/COPYRIGHT.
4+
#
5+
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
# option. This file may not be copied, modified, or distributed
9+
# except according to those terms.
10+
11+
12+
ifdef CFG_PERF_TOOL
13+
rustc-perf$(X): $(CFG_BUILD)/stage2/bin/rustc$(X_$(CFG_BUILD))
14+
@$(call E, perf compile: $@)
15+
$(PERF_STAGE2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \
16+
-o $@ $(COMPILER_CRATE) >rustc-perf.err 2>&1
17+
$(Q)rm -f $(LIBRUSTC_GLOB)
18+
else
19+
rustc-perf$(X): $(CFG_BUILD)/stage2/bin/rustc$(X_$(CFG_BUILD))
20+
$(Q)touch $@
21+
endif
22+
23+
perf: check-stage2-perf rustc-perf$(X_$(CFG_BUILD))
24+
$(Q)find $(CFG_BUILD)/test/perf -name \*.err | xargs cat
25+
$(Q)cat rustc-perf.err

branches/stable/mk/platform.mk

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,23 @@ define DEF_GOOD_VALGRIND
7777
endef
7878
$(foreach t,$(CFG_TARGET),$(eval $(call DEF_GOOD_VALGRIND,$(t))))
7979

80+
ifneq ($(findstring linux,$(CFG_OSTYPE)),)
81+
ifdef CFG_PERF
82+
ifneq ($(CFG_PERF_WITH_LOGFD),)
83+
CFG_PERF_TOOL := $(CFG_PERF) stat -r 3 --log-fd 2
84+
else
85+
CFG_PERF_TOOL := $(CFG_PERF) stat -r 3
86+
endif
87+
else
88+
ifdef CFG_VALGRIND
89+
CFG_PERF_TOOL := \
90+
$(CFG_VALGRIND) --tool=cachegrind --cache-sim=yes --branch-sim=yes
91+
else
92+
CFG_PERF_TOOL := /usr/bin/time --verbose
93+
endif
94+
endif
95+
endif
96+
8097
AR := ar
8198

8299
define SET_FROM_CFG

branches/stable/mk/target.mk

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ export CFG_COMPILER_HOST_TRIPLE
1717
export CFG_DEFAULT_LINKER
1818
export CFG_DEFAULT_AR
1919

20+
# The standard libraries should be held up to a higher standard than any old
21+
# code, make sure that these common warnings are denied by default. These can
22+
# be overridden during development temporarily. For stage0, we allow warnings
23+
# which may be bugs in stage0 (should be fixed in stage1+)
24+
RUST_LIB_FLAGS_ST0 += -W warnings
25+
RUST_LIB_FLAGS_ST1 += -D warnings
26+
RUST_LIB_FLAGS_ST2 += -D warnings
27+
2028
# Macro that generates the full list of dependencies for a crate at a particular
2129
# stage/target/host tuple.
2230
#

branches/stable/mk/tests.mk

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ ifdef CFG_VALGRIND
5050
CTEST_RUNTOOL = --runtool "$(CFG_VALGRIND)"
5151
endif
5252

53+
# Arguments to the perf tests
54+
ifdef CFG_PERF_TOOL
55+
CTEST_PERF_RUNTOOL = --runtool "$(CFG_PERF_TOOL)"
56+
endif
57+
5358
CTEST_TESTARGS := $(TESTARGS)
5459

5560
# --bench is only relevant for crate tests, not for the compile tests
@@ -65,6 +70,12 @@ endif
6570
# This prevents tests from failing with some locales (fixes #17423).
6671
export LC_ALL=C
6772

73+
# If we're running perf then set this environment variable
74+
# to put the benchmarks into 'hard mode'
75+
ifeq ($(MAKECMDGOALS),perf)
76+
export RUST_BENCH=1
77+
endif
78+
6879
TEST_LOG_FILE=tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
6980
TEST_OK_FILE=tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).ok
7081

@@ -310,7 +321,6 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
310321
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-gdb-exec \
311322
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-lldb-exec \
312323
check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
313-
check-stage$(1)-T-$(2)-H-$(3)-codegen-units-exec \
314324
check-stage$(1)-T-$(2)-H-$(3)-doc-exec \
315325
check-stage$(1)-T-$(2)-H-$(3)-pretty-exec
316326

@@ -474,9 +484,12 @@ DEBUGINFO_GDB_RS := $(wildcard $(S)src/test/debuginfo/*.rs)
474484
DEBUGINFO_LLDB_RS := $(wildcard $(S)src/test/debuginfo/*.rs)
475485
CODEGEN_RS := $(wildcard $(S)src/test/codegen/*.rs)
476486
CODEGEN_CC := $(wildcard $(S)src/test/codegen/*.cc)
477-
CODEGEN_UNITS_RS := $(wildcard $(S)src/test/codegen-units/*.rs)
478487
RUSTDOCCK_RS := $(wildcard $(S)src/test/rustdoc/*.rs)
479488

489+
# perf tests are the same as bench tests only they run under
490+
# a performance monitor.
491+
PERF_RS := $(wildcard $(S)src/test/bench/*.rs)
492+
480493
RPASS_TESTS := $(RPASS_RS)
481494
RPASS_VALGRIND_TESTS := $(RPASS_VALGRIND_RS)
482495
RPASS_FULL_TESTS := $(RPASS_FULL_RS)
@@ -486,11 +499,11 @@ RFAIL_TESTS := $(RFAIL_RS)
486499
CFAIL_TESTS := $(CFAIL_RS)
487500
PFAIL_TESTS := $(PFAIL_RS)
488501
BENCH_TESTS := $(BENCH_RS)
502+
PERF_TESTS := $(PERF_RS)
489503
PRETTY_TESTS := $(PRETTY_RS)
490504
DEBUGINFO_GDB_TESTS := $(DEBUGINFO_GDB_RS)
491505
DEBUGINFO_LLDB_TESTS := $(DEBUGINFO_LLDB_RS)
492506
CODEGEN_TESTS := $(CODEGEN_RS) $(CODEGEN_CC)
493-
CODEGEN_UNITS_TESTS := $(CODEGEN_UNITS_RS)
494507
RUSTDOCCK_TESTS := $(RUSTDOCCK_RS)
495508

496509
CTEST_SRC_BASE_rpass = run-pass
@@ -538,6 +551,11 @@ CTEST_BUILD_BASE_bench = bench
538551
CTEST_MODE_bench = run-pass
539552
CTEST_RUNTOOL_bench = $(CTEST_RUNTOOL)
540553

554+
CTEST_SRC_BASE_perf = bench
555+
CTEST_BUILD_BASE_perf = perf
556+
CTEST_MODE_perf = run-pass
557+
CTEST_RUNTOOL_perf = $(CTEST_PERF_RUNTOOL)
558+
541559
CTEST_SRC_BASE_debuginfo-gdb = debuginfo
542560
CTEST_BUILD_BASE_debuginfo-gdb = debuginfo-gdb
543561
CTEST_MODE_debuginfo-gdb = debuginfo-gdb
@@ -553,11 +571,6 @@ CTEST_BUILD_BASE_codegen = codegen
553571
CTEST_MODE_codegen = codegen
554572
CTEST_RUNTOOL_codegen = $(CTEST_RUNTOOL)
555573

556-
CTEST_SRC_BASE_codegen-units = codegen-units
557-
CTEST_BUILD_BASE_codegen-units = codegen-units
558-
CTEST_MODE_codegen-units = codegen-units
559-
CTEST_RUNTOOL_codegen-units = $(CTEST_RUNTOOL)
560-
561574
CTEST_SRC_BASE_rustdocck = rustdoc
562575
CTEST_BUILD_BASE_rustdocck = rustdoc
563576
CTEST_MODE_rustdocck = rustdoc
@@ -612,7 +625,7 @@ TEST_SREQ$(1)_T_$(2)_H_$(3) = \
612625
$$(HBIN$(1)_H_$(3))/compiletest$$(X_$(3)) \
613626
$$(SREQ$(1)_T_$(2)_H_$(3))
614627

615-
# Rules for the cfail/rfail/rpass/bench test runner
628+
# Rules for the cfail/rfail/rpass/bench/perf test runner
616629

617630
# The tests select when to use debug configuration on their own;
618631
# remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
@@ -676,12 +689,12 @@ CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
676689
CTEST_DEPS_cfail_$(1)-T-$(2)-H-$(3) = $$(CFAIL_TESTS)
677690
CTEST_DEPS_pfail_$(1)-T-$(2)-H-$(3) = $$(PFAIL_TESTS)
678691
CTEST_DEPS_bench_$(1)-T-$(2)-H-$(3) = $$(BENCH_TESTS)
692+
CTEST_DEPS_perf_$(1)-T-$(2)-H-$(3) = $$(PERF_TESTS)
679693
CTEST_DEPS_debuginfo-gdb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_GDB_TESTS)
680694
CTEST_DEPS_debuginfo-lldb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_LLDB_TESTS) \
681695
$(S)src/etc/lldb_batchmode.py \
682696
$(S)src/etc/lldb_rust_formatters.py
683697
CTEST_DEPS_codegen_$(1)-T-$(2)-H-$(3) = $$(CODEGEN_TESTS)
684-
CTEST_DEPS_codegen-units_$(1)-T-$(2)-H-$(3) = $$(CODEGEN_UNITS_TESTS)
685698
CTEST_DEPS_rustdocck_$(1)-T-$(2)-H-$(3) = $$(RUSTDOCCK_TESTS) \
686699
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
687700
$(S)src/etc/htmldocck.py
@@ -748,7 +761,7 @@ endif
748761
endef
749762

750763
CTEST_NAMES = rpass rpass-valgrind rpass-full rfail-full cfail-full rfail cfail pfail \
751-
bench debuginfo-gdb debuginfo-lldb codegen codegen-units rustdocck
764+
bench perf debuginfo-gdb debuginfo-lldb codegen rustdocck
752765

753766
$(foreach host,$(CFG_HOST), \
754767
$(eval $(foreach target,$(CFG_TARGET), \
@@ -921,12 +934,12 @@ TEST_GROUPS = \
921934
cfail \
922935
pfail \
923936
bench \
937+
perf \
924938
rmake \
925939
rustdocck \
926940
debuginfo-gdb \
927941
debuginfo-lldb \
928942
codegen \
929-
codegen-units \
930943
doc \
931944
$(foreach docname,$(DOC_NAMES),doc-$(docname)) \
932945
pretty \

0 commit comments

Comments
 (0)