Skip to content

Commit c07577c

Browse files
committed
---
yaml --- r: 278166 b: refs/heads/auto c: 0d5f474 h: refs/heads/master
1 parent 22d3363 commit c07577c

File tree

213 files changed

+1904
-5702
lines changed

Some content is hidden

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

213 files changed

+1904
-5702
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 32683ce1930ef1390f20e4ab72650e6804fd1c1b
11+
refs/heads/auto: 0d5f474f30563383aa0c72ec84d3f2c26fa1c348
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/Makefile.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@
5959
# * check-stage$(stage)-$(crate) - Test a crate in a specific stage
6060
# * check-stage$(stage)-{rpass,rfail,cfail,rmake,...} - Run tests in src/test/
6161
# * check-stage1-T-$(target)-H-$(host) - Run cross-compiled-tests
62-
# * tidy - Basic style check, show highest rustc error code and
63-
# the status of language and lib features
62+
# * tidy-basic - show file / line stats
63+
# * tidy-errors - show the highest rustc error code
64+
# * tidy-features - show the status of language and lib features
6465
# * rustc-stage$(stage) - Only build up to a specific stage
6566
#
6667
# Then mix in some of these environment variables to harness the

branches/auto/configure

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,6 @@ valopt build "${DEFAULT_BUILD}" "GNUs ./configure syntax LLVM build triple"
632632
valopt android-cross-path "" "Android NDK standalone path (deprecated)"
633633
valopt i686-linux-android-ndk "" "i686-linux-android NDK standalone path"
634634
valopt arm-linux-androideabi-ndk "" "arm-linux-androideabi NDK standalone path"
635-
valopt armv7-linux-androideabi-ndk "" "armv7-linux-androideabi NDK standalone path"
636635
valopt aarch64-linux-android-ndk "" "aarch64-linux-android NDK standalone path"
637636
valopt nacl-cross-path "" "NaCl SDK path (Pepper Canary is recommended). Must be absolute!"
638637
valopt release-channel "dev" "the name of the release channel to build"
@@ -1145,15 +1144,6 @@ do
11451144

11461145
case $i in
11471146
*android*)
1148-
case $i in
1149-
armv7-linux-androideabi)
1150-
cmd_prefix="arm-linux-androideabi"
1151-
;;
1152-
*)
1153-
cmd_prefix=$i
1154-
;;
1155-
esac
1156-
11571147
upper_snake_target=$(echo "$i" | tr '[:lower:]' '[:upper:]' | tr '\-' '\_')
11581148
eval ndk=\$"CFG_${upper_snake_target}_NDK"
11591149
if [ -z "$ndk" ]
@@ -1164,7 +1154,7 @@ do
11641154
fi
11651155

11661156
# Perform a basic sanity check of the NDK
1167-
for android_ndk_tool in "$ndk/bin/$cmd_prefix-gcc" "$ndk/bin/$cmd_prefix-g++" "$ndk/bin/$cmd_prefix-ar"
1157+
for android_ndk_tool in "$ndk/bin/$i-gcc" "$ndk/bin/$i-g++" "$ndk/bin/$i-ar"
11681158
do
11691159
if [ ! -f $android_ndk_tool ]
11701160
then
@@ -1796,7 +1786,6 @@ putvar CFG_LIBDIR_RELATIVE
17961786
putvar CFG_DISABLE_MANAGE_SUBMODULES
17971787
putvar CFG_AARCH64_LINUX_ANDROID_NDK
17981788
putvar CFG_ARM_LINUX_ANDROIDEABI_NDK
1799-
putvar CFG_ARMV7_LINUX_ANDROIDEABI_NDK
18001789
putvar CFG_I686_LINUX_ANDROID_NDK
18011790
putvar CFG_NACL_CROSS_PATH
18021791
putvar CFG_MANDIR

branches/auto/mk/cfg/armv7-linux-androideabi.mk

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

branches/auto/mk/crates.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ DEPS_rustc_lint := rustc log syntax rustc_const_eval
111111
DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags
112112
DEPS_rustc_metadata := rustc syntax rbml rustc_const_math
113113
DEPS_rustc_passes := syntax rustc core rustc_const_eval
114-
DEPS_rustc_mir := rustc syntax rustc_const_math rustc_const_eval rustc_bitflags
114+
DEPS_rustc_mir := rustc syntax rustc_const_math rustc_const_eval
115115
DEPS_rustc_resolve := arena rustc log syntax
116116
DEPS_rustc_platform_intrinsics := std
117117
DEPS_rustc_plugin := rustc rustc_metadata syntax rustc_mir

branches/auto/mk/ctags.mk

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,14 @@
1515

1616
.PHONY: TAGS.emacs TAGS.vi
1717

18-
CTAGS_RUSTC_LOCATIONS=$(patsubst ${CFG_SRC_DIR}src/lib%test,, \
19-
$(wildcard ${CFG_SRC_DIR}src/lib*)) ${CFG_SRC_DIR}src/libtest
18+
CTAGS_LOCATIONS=$(wildcard ${CFG_SRC_DIR}src/lib*)
2019
CTAGS_LOCATIONS=$(patsubst ${CFG_SRC_DIR}src/librust%,, \
2120
$(patsubst ${CFG_SRC_DIR}src/lib%test,, \
2221
$(wildcard ${CFG_SRC_DIR}src/lib*))) ${CFG_SRC_DIR}src/libtest
23-
CTAGS_OPTS=--options="${CFG_SRC_DIR}src/etc/ctags.rust" --languages=Rust --recurse
24-
25-
TAGS.rustc.emacs:
26-
ctags -e -f $@ ${CTAGS_OPTS} ${CTAGS_RUSTC_LOCATIONS}
22+
CTAGS_OPTS=--options="${CFG_SRC_DIR}src/etc/ctags.rust" --languages=Rust --recurse ${CTAGS_LOCATIONS}
2723

2824
TAGS.emacs:
29-
ctags -e -f $@ ${CTAGS_OPTS} ${CTAGS_LOCATIONS}
30-
31-
TAGS.rustc.vi:
32-
ctags -f $@ ${CTAGS_OPTS} ${CTAGS_RUSTC_LOCATIONS}
25+
ctags -e -f $@ ${CTAGS_OPTS}
3326

3427
TAGS.vi:
35-
ctags -f $@ ${CTAGS_OPTS} ${CTAGS_LOCATIONS}
28+
ctags -f $@ ${CTAGS_OPTS}

branches/auto/mk/dist.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ $(PKG_TAR): $(PKG_FILES)
7777
$(Q)mkdir -p tmp/dist/$(PKG_NAME)
7878
$(Q)tar \
7979
-C $(S) \
80-
-f - \
8180
--exclude-vcs \
8281
--exclude=*~ \
8382
--exclude=*.pyc \
@@ -87,7 +86,7 @@ $(PKG_TAR): $(PKG_FILES)
8786
--exclude=*/llvm/test/*/*/*.ll \
8887
--exclude=*/llvm/test/*/*/*.td \
8988
--exclude=*/llvm/test/*/*/*.s \
90-
-c $(UNROOTED_PKG_FILES) | tar -x -f - -C tmp/dist/$(PKG_NAME)
89+
-c $(UNROOTED_PKG_FILES) | tar -x -C tmp/dist/$(PKG_NAME)
9190
@$(call E, making $@)
9291
$(Q)tar -czf $(PKG_TAR) -C tmp/dist $(PKG_NAME)
9392
$(Q)rm -Rf tmp/dist/$(PKG_NAME)

branches/auto/mk/platform.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ ifdef CFG_CCACHE_BASEDIR
169169
export CCACHE_BASEDIR
170170
endif
171171

172-
FIND_COMPILER = $(strip $(1:ccache=))
172+
FIND_COMPILER = $(word 1,$(1:ccache=))
173173

174174
define CFG_MAKE_TOOLCHAIN
175175
# Prepend the tools with their prefix if cross compiling
@@ -187,7 +187,7 @@ define CFG_MAKE_TOOLCHAIN
187187
endif
188188
endif
189189

190-
CFG_COMPILE_C_$(1) = '$$(call FIND_COMPILER,$$(CC_$(1)))' \
190+
CFG_COMPILE_C_$(1) = '$$(CC_$(1))' \
191191
$$(CFLAGS) \
192192
$$(CFG_GCCISH_CFLAGS) \
193193
$$(CFG_GCCISH_CFLAGS_$(1)) \
@@ -198,7 +198,7 @@ define CFG_MAKE_TOOLCHAIN
198198
$$(CFG_GCCISH_LINK_FLAGS_$(1)) \
199199
$$(CFG_GCCISH_DEF_FLAG_$(1))$$(3) $$(2) \
200200
$$(call CFG_INSTALL_NAME_$(1),$$(4))
201-
CFG_COMPILE_CXX_$(1) = '$$(call FIND_COMPILER,$$(CXX_$(1)))' \
201+
CFG_COMPILE_CXX_$(1) = '$$(CXX_$(1))' \
202202
$$(CXXFLAGS) \
203203
$$(CFG_GCCISH_CFLAGS) \
204204
$$(CFG_GCCISH_CXXFLAGS) \

branches/auto/mk/tests.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,8 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) = \
635635
--host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3))" \
636636
--lldb-python-dir=$(CFG_LLDB_PYTHON_DIR) \
637637
--target-rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(2))" \
638-
--cc '$$(call FIND_COMPILER,$$(CC_$(2)))' \
639-
--cxx '$$(call FIND_COMPILER,$$(CXX_$(2)))' \
638+
--cc '$$(CC_$(2))' \
639+
--cxx '$$(CXX_$(2))' \
640640
--cflags "$$(CFG_GCCISH_CFLAGS_$(2))" \
641641
--llvm-components "$$(LLVM_ALL_COMPONENTS_$(2))" \
642642
--llvm-cxxflags "$$(LLVM_CXXFLAGS_$(2))" \

branches/auto/src/bootstrap/README.md

Lines changed: 6 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# rustbuild - Bootstrapping Rust
1+
# Bootstrapping Rust
22

33
This is an in-progress README which is targeted at helping to explain how Rust
44
is bootstrapped and in general some of the technical details of the build
@@ -8,64 +8,20 @@ system.
88
> intended to be the primarily used one just yet. The makefiles are currently
99
> the ones that are still "guaranteed to work" as much as possible at least.
1010
11-
## Using rustbuild
11+
## Using the new build system
1212

1313
When configuring Rust via `./configure`, pass the following to enable building
1414
via this build system:
1515

1616
```
1717
./configure --enable-rustbuild
18-
make
1918
```
2019

21-
Afterwards the `Makefile` which is generated will have a few commands like
22-
`make check`, `make tidy`, etc. For finer-grained control, the
23-
`bootstrap.py` entry point can be used:
24-
25-
```
26-
python src/bootstrap/bootstrap.py
27-
```
28-
29-
This accepts a number of options like `--stage` and `--step` which can configure
30-
what's actually being done.
31-
32-
## Configuring rustbuild
33-
34-
There are currently two primary methods for configuring the rustbuild build
35-
system. First, the `./configure` options serialized in `config.mk` will be
36-
parsed and read. That is, if any `./configure` options are passed, they'll be
37-
handled naturally.
38-
39-
Next, rustbuild offers a TOML-based configuration system with a `config.toml`
40-
file in the same location as `config.mk`. An example of this configuration can
41-
be found at `src/bootstrap/config.toml.example`, and the configuration file
42-
can also be passed as `--config path/to/config.toml` if the build system is
43-
being invoked manually (via the python script).
44-
45-
## Build stages
46-
47-
The rustbuild build system goes through a few phases to actually build the
48-
compiler. What actually happens when you invoke rustbuild is:
49-
50-
1. The entry point script, `src/bootstrap/bootstrap.py` is run. This script is
51-
responsible for downloading the stage0 compiler/Cargo binaries, and it then
52-
compiles the build system itself (this folder). Finally, it then invokes the
53-
actual `boostrap` binary build system.
54-
2. In Rust, `bootstrap` will slurp up all configuration, perform a number of
55-
sanity checks (compilers exist for example), and then start building the
56-
stage0 artifacts.
57-
3. The stage0 `cargo` downloaded earlier is used to build the standard library
58-
and the compiler, and then these binaries are then copied to the `stage1`
59-
directory. That compiler is then used to generate the stage1 artifacts which
60-
are then copied to the stage2 directory, and then finally the stage2
61-
artifacts are generated using that compiler.
62-
63-
The goal of each stage is to (a) leverage Cargo as much as possible and failing
64-
that (b) leverage Rust as much as possible!
20+
## ...
6521

6622
## Directory Layout
6723

68-
This build system houses all output under the `build` directory, which looks
24+
This build system houses all output under the `target` directory, which looks
6925
like this:
7026

7127
```
@@ -86,12 +42,6 @@ build/
8642
debug/
8743
release/
8844
89-
# Output of the dist-related steps like dist-std, dist-rustc, and dist-docs
90-
dist/
91-
92-
# Temporary directory used for various input/output as part of various stages
93-
tmp/
94-
9545
# Each remaining directory is scoped by the "host" triple of compilation at
9646
# hand.
9747
x86_64-unknown-linux-gnu/
@@ -100,8 +50,7 @@ build/
10050
# folder is under. The exact layout here will likely depend on the platform,
10151
# and this is also built with CMake so the build system is also likely
10252
# different.
103-
compiler-rt/
104-
build/
53+
compiler-rt/build/
10554
10655
# Output folder for LLVM if it is compiled for this target
10756
llvm/
@@ -118,17 +67,6 @@ build/
11867
share/
11968
...
12069
121-
# Output folder for all documentation of this target. This is what's filled
122-
# in whenever the `doc` step is run.
123-
doc/
124-
125-
# Output for all compiletest-based test suites
126-
test/
127-
run-pass/
128-
compile-fail/
129-
debuginfo/
130-
...
131-
13270
# Location where the stage0 Cargo and Rust compiler are unpacked. This
13371
# directory is purely an extracted and overlaid tarball of these two (done
13472
# by the bootstrapy python script). In theory the build system does not
@@ -144,9 +82,7 @@ build/
14482
# invocation. The build system instruments calling Cargo in the right order
14583
# with the right variables to ensure these are filled in correctly.
14684
stageN-std/
147-
stageN-test/
14885
stageN-rustc/
149-
stageN-tools/
15086
15187
# This is a special case of the above directories, **not** filled in via
15288
# Cargo but rather the build system itself. The stage0 compiler already has
@@ -160,7 +96,7 @@ build/
16096
# Basically this directory is just a temporary artifact use to configure the
16197
# stage0 compiler to ensure that the libstd we just built is used to
16298
# compile the stage1 compiler.
163-
stage0-sysroot/lib/
99+
stage0-rustc/lib/
164100
165101
# These output directories are intended to be standalone working
166102
# implementations of the compiler (corresponding to each stage). The build
@@ -172,69 +108,3 @@ build/
172108
stage2/
173109
stage3/
174110
```
175-
176-
## Cargo projects
177-
178-
The current build is unfortunately not quite as simple as `cargo build` in a
179-
directory, but rather the compiler is split into three different Cargo projects:
180-
181-
* `src/rustc/std_shim` - a project which builds and compiles libstd
182-
* `src/rustc/test_shim` - a project which builds and compiles libtest
183-
* `src/rustc` - the actual compiler itself
184-
185-
Each "project" has a corresponding Cargo.lock file with all dependencies, and
186-
this means that building the compiler involves running Cargo three times. The
187-
structure here serves two goals:
188-
189-
1. Facilitating dependencies coming from crates.io. These dependencies don't
190-
depend on `std`, so libstd is a separate project compiled ahead of time
191-
before the actual compiler builds.
192-
2. Splitting "host artifacts" from "target artifacts". That is, when building
193-
code for an arbitrary target you don't need the entire compiler, but you'll
194-
end up needing libraries like libtest that depend on std but also want to use
195-
crates.io dependencies. Hence, libtest is split out as its own project that
196-
is sequenced after `std` but before `rustc`. This project is built for all
197-
targets.
198-
199-
There is some loss in build parallelism here because libtest can be compiled in
200-
parallel with a number of rustc artifacts, but in theory the loss isn't too bad!
201-
202-
## Build tools
203-
204-
We've actually got quite a few tools that we use in the compiler's build system
205-
and for testing. To organize these, each tool is a project in `src/tools` with a
206-
corresponding `Cargo.toml`. All tools are compiled with Cargo (currently having
207-
independent `Cargo.lock` files) and do not currently explicitly depend on the
208-
compiler or standard library. Compiling each tool is sequenced after the
209-
appropriate libstd/libtest/librustc compile above.
210-
211-
## Extending rustbuild
212-
213-
So you'd like to add a feature to the rustbuild build system or just fix a bug.
214-
Great! One of the major motivational factors for moving away from `make` is that
215-
Rust is in theory much easier to read, modify, and write. If you find anything
216-
excessively confusing, please open an issue on this and we'll try to get it
217-
documented or simplified pronto.
218-
219-
First up, you'll probably want to read over the documentation above as that'll
220-
give you a high level overview of what rustbuild is doing. You also probably
221-
want to play around a bit yourself by just getting it up and running before you
222-
dive too much into the actual build system itself.
223-
224-
After that, each module in rustbuild should have enough documentation to keep
225-
you up and running. Some general areas that you may be interested in modifying
226-
are:
227-
228-
* Adding a new build tool? Take a look at `build/step.rs` for examples of other
229-
tools, as well as `build/mod.rs`.
230-
* Adding a new compiler crate? Look no further! Adding crates can be done by
231-
adding a new directory with `Cargo.toml` followed by configuring all
232-
`Cargo.toml` files accordingly.
233-
* Adding a new dependency from crates.io? We're still working on that, so hold
234-
off on that for now.
235-
* Adding a new configuration option? Take a look at `build/config.rs` or perhaps
236-
`build/flags.rs` and then modify the build elsewhere to read that option.
237-
* Adding a sanity check? Take a look at `build/sanity.rs`.
238-
239-
If you have any questions feel free to reach out on `#rust-internals` on IRC or
240-
open an issue in the bug tracker!

0 commit comments

Comments
 (0)