2015-11-19 17:20:12 -06:00
|
|
|
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2016-05-02 17:16:15 -05:00
|
|
|
//! Major workhorse of rustbuild, definition and dependencies between stages of
|
|
|
|
//! the copmile.
|
|
|
|
//!
|
|
|
|
//! The primary purpose of this module is to define the various `Step`s of
|
|
|
|
//! execution of the build. Each `Step` has a corresponding `Source` indicating
|
|
|
|
//! what it's actually doing along with a number of dependencies which must be
|
|
|
|
//! executed first.
|
|
|
|
//!
|
|
|
|
//! This module will take the CLI as input and calculate the steps required for
|
|
|
|
//! the build requested, ensuring that all intermediate pieces are in place.
|
|
|
|
//! Essentially this module is a `make`-replacement, but not as good.
|
|
|
|
|
2015-11-19 17:20:12 -06:00
|
|
|
use std::collections::HashSet;
|
|
|
|
|
|
|
|
use build::{Build, Compiler};
|
|
|
|
|
|
|
|
#[derive(Hash, Eq, PartialEq, Clone, Debug)]
|
|
|
|
pub struct Step<'a> {
|
|
|
|
pub src: Source<'a>,
|
|
|
|
pub target: &'a str,
|
|
|
|
}
|
|
|
|
|
2016-05-02 17:16:15 -05:00
|
|
|
/// Macro used to iterate over all targets that are recognized by the build
|
|
|
|
/// system.
|
|
|
|
///
|
|
|
|
/// Whenever a new step is added it will involve adding an entry here, updating
|
|
|
|
/// the dependencies section below, and then adding an implementation of the
|
|
|
|
/// step in `build/mod.rs`.
|
|
|
|
///
|
|
|
|
/// This macro takes another macro as an argument and then calls that macro with
|
|
|
|
/// all steps that the build system knows about.
|
2015-11-19 17:20:12 -06:00
|
|
|
macro_rules! targets {
|
|
|
|
($m:ident) => {
|
|
|
|
$m! {
|
2016-02-24 23:12:42 -06:00
|
|
|
// Step representing building the stageN compiler. This is just the
|
|
|
|
// compiler executable itself, not any of the support libraries
|
2015-11-19 17:20:12 -06:00
|
|
|
(rustc, Rustc { stage: u32 }),
|
2016-02-24 23:12:42 -06:00
|
|
|
|
rustbuild: Fix dist for non-host targets
The `rust-std` package that we produce is expected to have not only the standard
library but also libtest for compiling unit tests. Unfortunately this does not
currently happen due to the way rustbuild is structured.
There are currently two main stages of compilation in rustbuild, one for the
standard library and one for the compiler. This is primarily done to allow us to
fill in the sysroot right after the standard library has finished compiling to
continue compiling the rest of the crates. Consequently the entire compiler does
not have to explicitly depend on the standard library, and this also should
allow us to pull in crates.io dependencies into the build in the future because
they'll just naturally build against the std we just produced.
These phases, however, do not represent a cross-compiled build. Target-only
builds also require libtest, and libtest is currently part of the
all-encompassing "compiler build". There's unfortunately no way to learn about
just libtest and its dependencies (in a great and robust fashion) so to ensure
that we can copy the right artifacts over this commit introduces a new build
step, libtest.
The new libtest build step has documentation, dist, and link steps as std/rustc
already do. The compiler now depends on libtest instead of libstd, and all
compiler crates can now assume that test and its dependencies are implicitly
part of the sysroot (hence explicit dependencies being removed). This makes the
build a tad less parallel as in theory many rustc crates can be compiled in
parallel with libtest, but this likely isn't where we really need parallelism
either (all the time is still spent in the compiler).
All in all this allows the `dist-std` step to depend on both libstd and libtest,
so `rust-std` packages produced by rustbuild should start having both the
standard library and libtest.
Closes #32523
2016-03-28 00:28:10 -05:00
|
|
|
// Steps for the two main cargo builds. These are parameterized over
|
|
|
|
// the compiler which is producing the artifact.
|
2016-03-11 19:30:16 -06:00
|
|
|
(libstd, Libstd { compiler: Compiler<'a> }),
|
rustbuild: Fix dist for non-host targets
The `rust-std` package that we produce is expected to have not only the standard
library but also libtest for compiling unit tests. Unfortunately this does not
currently happen due to the way rustbuild is structured.
There are currently two main stages of compilation in rustbuild, one for the
standard library and one for the compiler. This is primarily done to allow us to
fill in the sysroot right after the standard library has finished compiling to
continue compiling the rest of the crates. Consequently the entire compiler does
not have to explicitly depend on the standard library, and this also should
allow us to pull in crates.io dependencies into the build in the future because
they'll just naturally build against the std we just produced.
These phases, however, do not represent a cross-compiled build. Target-only
builds also require libtest, and libtest is currently part of the
all-encompassing "compiler build". There's unfortunately no way to learn about
just libtest and its dependencies (in a great and robust fashion) so to ensure
that we can copy the right artifacts over this commit introduces a new build
step, libtest.
The new libtest build step has documentation, dist, and link steps as std/rustc
already do. The compiler now depends on libtest instead of libstd, and all
compiler crates can now assume that test and its dependencies are implicitly
part of the sysroot (hence explicit dependencies being removed). This makes the
build a tad less parallel as in theory many rustc crates can be compiled in
parallel with libtest, but this likely isn't where we really need parallelism
either (all the time is still spent in the compiler).
All in all this allows the `dist-std` step to depend on both libstd and libtest,
so `rust-std` packages produced by rustbuild should start having both the
standard library and libtest.
Closes #32523
2016-03-28 00:28:10 -05:00
|
|
|
(libtest, Libtest { compiler: Compiler<'a> }),
|
2016-03-11 19:30:16 -06:00
|
|
|
(librustc, Librustc { compiler: Compiler<'a> }),
|
2016-02-24 23:12:42 -06:00
|
|
|
|
rustbuild: Fix dist for non-host targets
The `rust-std` package that we produce is expected to have not only the standard
library but also libtest for compiling unit tests. Unfortunately this does not
currently happen due to the way rustbuild is structured.
There are currently two main stages of compilation in rustbuild, one for the
standard library and one for the compiler. This is primarily done to allow us to
fill in the sysroot right after the standard library has finished compiling to
continue compiling the rest of the crates. Consequently the entire compiler does
not have to explicitly depend on the standard library, and this also should
allow us to pull in crates.io dependencies into the build in the future because
they'll just naturally build against the std we just produced.
These phases, however, do not represent a cross-compiled build. Target-only
builds also require libtest, and libtest is currently part of the
all-encompassing "compiler build". There's unfortunately no way to learn about
just libtest and its dependencies (in a great and robust fashion) so to ensure
that we can copy the right artifacts over this commit introduces a new build
step, libtest.
The new libtest build step has documentation, dist, and link steps as std/rustc
already do. The compiler now depends on libtest instead of libstd, and all
compiler crates can now assume that test and its dependencies are implicitly
part of the sysroot (hence explicit dependencies being removed). This makes the
build a tad less parallel as in theory many rustc crates can be compiled in
parallel with libtest, but this likely isn't where we really need parallelism
either (all the time is still spent in the compiler).
All in all this allows the `dist-std` step to depend on both libstd and libtest,
so `rust-std` packages produced by rustbuild should start having both the
standard library and libtest.
Closes #32523
2016-03-28 00:28:10 -05:00
|
|
|
// Links the target produced by the compiler provided into the
|
|
|
|
// host's directory also provided.
|
2016-02-25 01:50:32 -06:00
|
|
|
(libstd_link, LibstdLink {
|
|
|
|
compiler: Compiler<'a>,
|
|
|
|
host: &'a str
|
|
|
|
}),
|
rustbuild: Fix dist for non-host targets
The `rust-std` package that we produce is expected to have not only the standard
library but also libtest for compiling unit tests. Unfortunately this does not
currently happen due to the way rustbuild is structured.
There are currently two main stages of compilation in rustbuild, one for the
standard library and one for the compiler. This is primarily done to allow us to
fill in the sysroot right after the standard library has finished compiling to
continue compiling the rest of the crates. Consequently the entire compiler does
not have to explicitly depend on the standard library, and this also should
allow us to pull in crates.io dependencies into the build in the future because
they'll just naturally build against the std we just produced.
These phases, however, do not represent a cross-compiled build. Target-only
builds also require libtest, and libtest is currently part of the
all-encompassing "compiler build". There's unfortunately no way to learn about
just libtest and its dependencies (in a great and robust fashion) so to ensure
that we can copy the right artifacts over this commit introduces a new build
step, libtest.
The new libtest build step has documentation, dist, and link steps as std/rustc
already do. The compiler now depends on libtest instead of libstd, and all
compiler crates can now assume that test and its dependencies are implicitly
part of the sysroot (hence explicit dependencies being removed). This makes the
build a tad less parallel as in theory many rustc crates can be compiled in
parallel with libtest, but this likely isn't where we really need parallelism
either (all the time is still spent in the compiler).
All in all this allows the `dist-std` step to depend on both libstd and libtest,
so `rust-std` packages produced by rustbuild should start having both the
standard library and libtest.
Closes #32523
2016-03-28 00:28:10 -05:00
|
|
|
(libtest_link, LibtestLink {
|
|
|
|
compiler: Compiler<'a>,
|
|
|
|
host: &'a str
|
|
|
|
}),
|
2016-02-25 01:50:32 -06:00
|
|
|
(librustc_link, LibrustcLink {
|
|
|
|
compiler: Compiler<'a>,
|
|
|
|
host: &'a str
|
|
|
|
}),
|
|
|
|
|
2016-03-08 00:32:37 -06:00
|
|
|
// Various tools that we can build as part of the build.
|
2016-03-08 01:15:55 -06:00
|
|
|
(tool_linkchecker, ToolLinkchecker { stage: u32 }),
|
2016-03-08 00:32:37 -06:00
|
|
|
(tool_rustbook, ToolRustbook { stage: u32 }),
|
2016-03-08 15:42:32 -06:00
|
|
|
(tool_error_index, ToolErrorIndex { stage: u32 }),
|
2016-03-18 15:54:31 -05:00
|
|
|
(tool_cargotest, ToolCargoTest { stage: u32 }),
|
2016-03-29 15:14:52 -05:00
|
|
|
(tool_tidy, ToolTidy { stage: u32 }),
|
2016-04-05 13:34:23 -05:00
|
|
|
(tool_compiletest, ToolCompiletest { stage: u32 }),
|
2016-03-08 00:32:37 -06:00
|
|
|
|
2016-02-24 23:12:42 -06:00
|
|
|
// Steps for long-running native builds. Ideally these wouldn't
|
|
|
|
// actually exist and would be part of build scripts, but for now
|
|
|
|
// these are here.
|
|
|
|
//
|
|
|
|
// There aren't really any parameters to this, but empty structs
|
|
|
|
// with braces are unstable so we just pick something that works.
|
2015-11-19 17:20:12 -06:00
|
|
|
(llvm, Llvm { _dummy: () }),
|
|
|
|
(compiler_rt, CompilerRt { _dummy: () }),
|
2016-04-05 13:34:23 -05:00
|
|
|
(test_helpers, TestHelpers { _dummy: () }),
|
|
|
|
(debugger_scripts, DebuggerScripts { stage: u32 }),
|
2016-03-08 00:34:13 -06:00
|
|
|
|
|
|
|
// Steps for various pieces of documentation that we can generate,
|
|
|
|
// the 'doc' step is just a pseudo target to depend on a bunch of
|
|
|
|
// others.
|
2016-02-16 12:26:43 -06:00
|
|
|
(doc, Doc { stage: u32 }),
|
|
|
|
(doc_book, DocBook { stage: u32 }),
|
|
|
|
(doc_nomicon, DocNomicon { stage: u32 }),
|
|
|
|
(doc_style, DocStyle { stage: u32 }),
|
|
|
|
(doc_standalone, DocStandalone { stage: u32 }),
|
2016-03-08 00:36:21 -06:00
|
|
|
(doc_std, DocStd { stage: u32 }),
|
rustbuild: Fix dist for non-host targets
The `rust-std` package that we produce is expected to have not only the standard
library but also libtest for compiling unit tests. Unfortunately this does not
currently happen due to the way rustbuild is structured.
There are currently two main stages of compilation in rustbuild, one for the
standard library and one for the compiler. This is primarily done to allow us to
fill in the sysroot right after the standard library has finished compiling to
continue compiling the rest of the crates. Consequently the entire compiler does
not have to explicitly depend on the standard library, and this also should
allow us to pull in crates.io dependencies into the build in the future because
they'll just naturally build against the std we just produced.
These phases, however, do not represent a cross-compiled build. Target-only
builds also require libtest, and libtest is currently part of the
all-encompassing "compiler build". There's unfortunately no way to learn about
just libtest and its dependencies (in a great and robust fashion) so to ensure
that we can copy the right artifacts over this commit introduces a new build
step, libtest.
The new libtest build step has documentation, dist, and link steps as std/rustc
already do. The compiler now depends on libtest instead of libstd, and all
compiler crates can now assume that test and its dependencies are implicitly
part of the sysroot (hence explicit dependencies being removed). This makes the
build a tad less parallel as in theory many rustc crates can be compiled in
parallel with libtest, but this likely isn't where we really need parallelism
either (all the time is still spent in the compiler).
All in all this allows the `dist-std` step to depend on both libstd and libtest,
so `rust-std` packages produced by rustbuild should start having both the
standard library and libtest.
Closes #32523
2016-03-28 00:28:10 -05:00
|
|
|
(doc_test, DocTest { stage: u32 }),
|
2016-03-08 00:36:21 -06:00
|
|
|
(doc_rustc, DocRustc { stage: u32 }),
|
2016-03-08 15:42:32 -06:00
|
|
|
(doc_error_index, DocErrorIndex { stage: u32 }),
|
2016-03-08 00:34:13 -06:00
|
|
|
|
|
|
|
// Steps for running tests. The 'check' target is just a pseudo
|
|
|
|
// target to depend on a bunch of others.
|
|
|
|
(check, Check { stage: u32, compiler: Compiler<'a> }),
|
2016-03-08 01:15:55 -06:00
|
|
|
(check_linkcheck, CheckLinkcheck { stage: u32 }),
|
2016-03-18 15:54:31 -05:00
|
|
|
(check_cargotest, CheckCargoTest { stage: u32 }),
|
2016-03-29 15:14:52 -05:00
|
|
|
(check_tidy, CheckTidy { stage: u32 }),
|
2016-04-05 13:34:23 -05:00
|
|
|
(check_rpass, CheckRPass { compiler: Compiler<'a> }),
|
|
|
|
(check_rfail, CheckRFail { compiler: Compiler<'a> }),
|
|
|
|
(check_cfail, CheckCFail { compiler: Compiler<'a> }),
|
|
|
|
(check_pfail, CheckPFail { compiler: Compiler<'a> }),
|
|
|
|
(check_codegen, CheckCodegen { compiler: Compiler<'a> }),
|
|
|
|
(check_codegen_units, CheckCodegenUnits { compiler: Compiler<'a> }),
|
2016-05-13 08:50:30 -05:00
|
|
|
(check_incremental, CheckIncremental { compiler: Compiler<'a> }),
|
|
|
|
(check_ui, CheckUi { compiler: Compiler<'a> }),
|
2016-04-05 13:34:23 -05:00
|
|
|
(check_debuginfo, CheckDebuginfo { compiler: Compiler<'a> }),
|
|
|
|
(check_rustdoc, CheckRustdoc { compiler: Compiler<'a> }),
|
|
|
|
(check_pretty, CheckPretty { compiler: Compiler<'a> }),
|
|
|
|
(check_rpass_valgrind, CheckRPassValgrind { compiler: Compiler<'a> }),
|
|
|
|
(check_rpass_full, CheckRPassFull { compiler: Compiler<'a> }),
|
|
|
|
(check_cfail_full, CheckCFailFull { compiler: Compiler<'a> }),
|
2016-04-14 20:00:35 -05:00
|
|
|
(check_docs, CheckDocs { compiler: Compiler<'a> }),
|
|
|
|
(check_error_index, CheckErrorIndex { compiler: Compiler<'a> }),
|
2016-04-14 17:51:03 -05:00
|
|
|
(check_rmake, CheckRMake { compiler: Compiler<'a> }),
|
2016-04-29 16:23:15 -05:00
|
|
|
(check_crate_std, CheckCrateStd { compiler: Compiler<'a> }),
|
|
|
|
(check_crate_test, CheckCrateTest { compiler: Compiler<'a> }),
|
|
|
|
(check_crate_rustc, CheckCrateRustc { compiler: Compiler<'a> }),
|
2016-03-13 18:52:19 -05:00
|
|
|
|
|
|
|
// Distribution targets, creating tarballs
|
|
|
|
(dist, Dist { stage: u32 }),
|
|
|
|
(dist_docs, DistDocs { stage: u32 }),
|
|
|
|
(dist_mingw, DistMingw { _dummy: () }),
|
|
|
|
(dist_rustc, DistRustc { stage: u32 }),
|
|
|
|
(dist_std, DistStd { compiler: Compiler<'a> }),
|
2015-11-19 17:20:12 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-02 17:16:15 -05:00
|
|
|
// Define the `Source` enum by iterating over all the steps and peeling out just
|
|
|
|
// the types that we want to define.
|
|
|
|
|
2015-11-19 17:20:12 -06:00
|
|
|
macro_rules! item { ($a:item) => ($a) }
|
|
|
|
|
|
|
|
macro_rules! define_source {
|
|
|
|
($(($short:ident, $name:ident { $($args:tt)* }),)*) => {
|
|
|
|
item! {
|
|
|
|
#[derive(Hash, Eq, PartialEq, Clone, Debug)]
|
|
|
|
pub enum Source<'a> {
|
|
|
|
$($name { $($args)* }),*
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
targets!(define_source);
|
|
|
|
|
2016-05-02 17:16:15 -05:00
|
|
|
/// Calculate a list of all steps described by `build`.
|
|
|
|
///
|
|
|
|
/// This will inspect the flags passed in on the command line and use that to
|
|
|
|
/// build up a list of steps to execute. These steps will then be transformed
|
|
|
|
/// into a topologically sorted list which when executed left-to-right will
|
|
|
|
/// correctly sequence the entire build.
|
2015-11-19 17:20:12 -06:00
|
|
|
pub fn all(build: &Build) -> Vec<Step> {
|
|
|
|
let mut ret = Vec::new();
|
|
|
|
let mut all = HashSet::new();
|
|
|
|
for target in top_level(build) {
|
|
|
|
fill(build, &target, &mut ret, &mut all);
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
fn fill<'a>(build: &'a Build,
|
|
|
|
target: &Step<'a>,
|
|
|
|
ret: &mut Vec<Step<'a>>,
|
|
|
|
set: &mut HashSet<Step<'a>>) {
|
|
|
|
if set.insert(target.clone()) {
|
|
|
|
for dep in target.deps(build) {
|
|
|
|
fill(build, &dep, ret, set);
|
|
|
|
}
|
|
|
|
ret.push(target.clone());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-02 17:16:15 -05:00
|
|
|
/// Determines what top-level targets are requested as part of this build,
|
|
|
|
/// returning them as a list.
|
2015-11-19 17:20:12 -06:00
|
|
|
fn top_level(build: &Build) -> Vec<Step> {
|
|
|
|
let mut targets = Vec::new();
|
|
|
|
let stage = build.flags.stage.unwrap_or(2);
|
|
|
|
|
|
|
|
let host = Step {
|
|
|
|
src: Source::Llvm { _dummy: () },
|
|
|
|
target: build.flags.host.iter().next()
|
|
|
|
.unwrap_or(&build.config.build),
|
|
|
|
};
|
|
|
|
let target = Step {
|
|
|
|
src: Source::Llvm { _dummy: () },
|
|
|
|
target: build.flags.target.iter().next().map(|x| &x[..])
|
|
|
|
.unwrap_or(host.target)
|
|
|
|
};
|
|
|
|
|
2016-05-02 17:16:15 -05:00
|
|
|
// First, try to find steps on the command line.
|
2015-11-19 17:20:12 -06:00
|
|
|
add_steps(build, stage, &host, &target, &mut targets);
|
|
|
|
|
2016-05-02 17:16:15 -05:00
|
|
|
// If none are specified, then build everything.
|
2015-11-19 17:20:12 -06:00
|
|
|
if targets.len() == 0 {
|
|
|
|
let t = Step {
|
|
|
|
src: Source::Llvm { _dummy: () },
|
|
|
|
target: &build.config.build,
|
|
|
|
};
|
2016-04-03 23:09:19 -05:00
|
|
|
if build.config.docs {
|
|
|
|
targets.push(t.doc(stage));
|
|
|
|
}
|
2015-11-19 17:20:12 -06:00
|
|
|
for host in build.config.host.iter() {
|
|
|
|
if !build.flags.host.contains(host) {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
let host = t.target(host);
|
2016-02-25 01:50:32 -06:00
|
|
|
if host.target == build.config.build {
|
2016-03-11 19:30:16 -06:00
|
|
|
targets.push(host.librustc(host.compiler(stage)));
|
2016-02-25 01:50:32 -06:00
|
|
|
} else {
|
2016-03-11 19:30:16 -06:00
|
|
|
targets.push(host.librustc_link(t.compiler(stage), host.target));
|
2016-02-25 01:50:32 -06:00
|
|
|
}
|
2015-11-19 17:20:12 -06:00
|
|
|
for target in build.config.target.iter() {
|
|
|
|
if !build.flags.target.contains(target) {
|
|
|
|
continue
|
|
|
|
}
|
2016-02-25 01:50:32 -06:00
|
|
|
|
|
|
|
if host.target == build.config.build {
|
|
|
|
targets.push(host.target(target)
|
rustbuild: Fix dist for non-host targets
The `rust-std` package that we produce is expected to have not only the standard
library but also libtest for compiling unit tests. Unfortunately this does not
currently happen due to the way rustbuild is structured.
There are currently two main stages of compilation in rustbuild, one for the
standard library and one for the compiler. This is primarily done to allow us to
fill in the sysroot right after the standard library has finished compiling to
continue compiling the rest of the crates. Consequently the entire compiler does
not have to explicitly depend on the standard library, and this also should
allow us to pull in crates.io dependencies into the build in the future because
they'll just naturally build against the std we just produced.
These phases, however, do not represent a cross-compiled build. Target-only
builds also require libtest, and libtest is currently part of the
all-encompassing "compiler build". There's unfortunately no way to learn about
just libtest and its dependencies (in a great and robust fashion) so to ensure
that we can copy the right artifacts over this commit introduces a new build
step, libtest.
The new libtest build step has documentation, dist, and link steps as std/rustc
already do. The compiler now depends on libtest instead of libstd, and all
compiler crates can now assume that test and its dependencies are implicitly
part of the sysroot (hence explicit dependencies being removed). This makes the
build a tad less parallel as in theory many rustc crates can be compiled in
parallel with libtest, but this likely isn't where we really need parallelism
either (all the time is still spent in the compiler).
All in all this allows the `dist-std` step to depend on both libstd and libtest,
so `rust-std` packages produced by rustbuild should start having both the
standard library and libtest.
Closes #32523
2016-03-28 00:28:10 -05:00
|
|
|
.libtest(host.compiler(stage)));
|
2016-02-25 01:50:32 -06:00
|
|
|
} else {
|
|
|
|
targets.push(host.target(target)
|
rustbuild: Fix dist for non-host targets
The `rust-std` package that we produce is expected to have not only the standard
library but also libtest for compiling unit tests. Unfortunately this does not
currently happen due to the way rustbuild is structured.
There are currently two main stages of compilation in rustbuild, one for the
standard library and one for the compiler. This is primarily done to allow us to
fill in the sysroot right after the standard library has finished compiling to
continue compiling the rest of the crates. Consequently the entire compiler does
not have to explicitly depend on the standard library, and this also should
allow us to pull in crates.io dependencies into the build in the future because
they'll just naturally build against the std we just produced.
These phases, however, do not represent a cross-compiled build. Target-only
builds also require libtest, and libtest is currently part of the
all-encompassing "compiler build". There's unfortunately no way to learn about
just libtest and its dependencies (in a great and robust fashion) so to ensure
that we can copy the right artifacts over this commit introduces a new build
step, libtest.
The new libtest build step has documentation, dist, and link steps as std/rustc
already do. The compiler now depends on libtest instead of libstd, and all
compiler crates can now assume that test and its dependencies are implicitly
part of the sysroot (hence explicit dependencies being removed). This makes the
build a tad less parallel as in theory many rustc crates can be compiled in
parallel with libtest, but this likely isn't where we really need parallelism
either (all the time is still spent in the compiler).
All in all this allows the `dist-std` step to depend on both libstd and libtest,
so `rust-std` packages produced by rustbuild should start having both the
standard library and libtest.
Closes #32523
2016-03-28 00:28:10 -05:00
|
|
|
.libtest_link(t.compiler(stage), host.target));
|
2016-02-25 01:50:32 -06:00
|
|
|
}
|
2015-11-19 17:20:12 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return targets
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
fn add_steps<'a>(build: &'a Build,
|
|
|
|
stage: u32,
|
|
|
|
host: &Step<'a>,
|
|
|
|
target: &Step<'a>,
|
|
|
|
targets: &mut Vec<Step<'a>>) {
|
2016-03-08 00:50:25 -06:00
|
|
|
struct Context<'a> {
|
|
|
|
stage: u32,
|
|
|
|
compiler: Compiler<'a>,
|
|
|
|
_dummy: (),
|
|
|
|
host: &'a str,
|
|
|
|
}
|
2015-11-19 17:20:12 -06:00
|
|
|
for step in build.flags.step.iter() {
|
2016-03-08 00:50:25 -06:00
|
|
|
|
|
|
|
// The macro below insists on hygienic access to all local variables, so
|
|
|
|
// we shove them all in a struct and subvert hygiene by accessing struct
|
|
|
|
// fields instead,
|
|
|
|
let cx = Context {
|
|
|
|
stage: stage,
|
|
|
|
compiler: host.target(&build.config.build).compiler(stage),
|
|
|
|
_dummy: (),
|
|
|
|
host: host.target,
|
|
|
|
};
|
|
|
|
macro_rules! add_step {
|
|
|
|
($(($short:ident, $name:ident { $($arg:ident: $t:ty),* }),)*) => ({$(
|
|
|
|
let name = stringify!($short).replace("_", "-");
|
|
|
|
if &step[..] == &name[..] {
|
|
|
|
targets.push(target.$short($(cx.$arg),*));
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
drop(name);
|
|
|
|
)*})
|
2015-11-19 17:20:12 -06:00
|
|
|
}
|
2016-03-08 00:50:25 -06:00
|
|
|
|
|
|
|
targets!(add_step);
|
2016-03-08 01:15:55 -06:00
|
|
|
|
|
|
|
panic!("unknown step: {}", step);
|
2015-11-19 17:20:12 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! constructors {
|
|
|
|
($(($short:ident, $name:ident { $($arg:ident: $t:ty),* }),)*) => {$(
|
|
|
|
fn $short(&self, $($arg: $t),*) -> Step<'a> {
|
|
|
|
Step {
|
|
|
|
src: Source::$name { $($arg: $arg),* },
|
|
|
|
target: self.target,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)*}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a> Step<'a> {
|
|
|
|
fn compiler(&self, stage: u32) -> Compiler<'a> {
|
|
|
|
Compiler::new(stage, self.target)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn target(&self, target: &'a str) -> Step<'a> {
|
|
|
|
Step { target: target, src: self.src.clone() }
|
|
|
|
}
|
|
|
|
|
2016-05-02 17:16:15 -05:00
|
|
|
// Define ergonomic constructors for each step defined above so they can be
|
|
|
|
// easily constructed.
|
2015-11-19 17:20:12 -06:00
|
|
|
targets!(constructors);
|
|
|
|
|
2016-05-02 17:16:15 -05:00
|
|
|
/// Mapping of all dependencies for rustbuild.
|
|
|
|
///
|
|
|
|
/// This function receives a step, the build that we're building for, and
|
|
|
|
/// then returns a list of all the dependencies of that step.
|
2015-11-19 17:20:12 -06:00
|
|
|
pub fn deps(&self, build: &'a Build) -> Vec<Step<'a>> {
|
|
|
|
match self.src {
|
|
|
|
Source::Rustc { stage: 0 } => {
|
2016-02-24 01:00:48 -06:00
|
|
|
Vec::new()
|
2015-11-19 17:20:12 -06:00
|
|
|
}
|
|
|
|
Source::Rustc { stage } => {
|
2016-02-24 01:00:48 -06:00
|
|
|
let compiler = Compiler::new(stage - 1, &build.config.build);
|
2016-03-11 19:30:16 -06:00
|
|
|
vec![self.librustc(compiler)]
|
2015-11-19 17:20:12 -06:00
|
|
|
}
|
2016-03-11 19:30:16 -06:00
|
|
|
Source::Librustc { compiler } => {
|
rustbuild: Fix dist for non-host targets
The `rust-std` package that we produce is expected to have not only the standard
library but also libtest for compiling unit tests. Unfortunately this does not
currently happen due to the way rustbuild is structured.
There are currently two main stages of compilation in rustbuild, one for the
standard library and one for the compiler. This is primarily done to allow us to
fill in the sysroot right after the standard library has finished compiling to
continue compiling the rest of the crates. Consequently the entire compiler does
not have to explicitly depend on the standard library, and this also should
allow us to pull in crates.io dependencies into the build in the future because
they'll just naturally build against the std we just produced.
These phases, however, do not represent a cross-compiled build. Target-only
builds also require libtest, and libtest is currently part of the
all-encompassing "compiler build". There's unfortunately no way to learn about
just libtest and its dependencies (in a great and robust fashion) so to ensure
that we can copy the right artifacts over this commit introduces a new build
step, libtest.
The new libtest build step has documentation, dist, and link steps as std/rustc
already do. The compiler now depends on libtest instead of libstd, and all
compiler crates can now assume that test and its dependencies are implicitly
part of the sysroot (hence explicit dependencies being removed). This makes the
build a tad less parallel as in theory many rustc crates can be compiled in
parallel with libtest, but this likely isn't where we really need parallelism
either (all the time is still spent in the compiler).
All in all this allows the `dist-std` step to depend on both libstd and libtest,
so `rust-std` packages produced by rustbuild should start having both the
standard library and libtest.
Closes #32523
2016-03-28 00:28:10 -05:00
|
|
|
vec![self.libtest(compiler), self.llvm(())]
|
|
|
|
}
|
|
|
|
Source::Libtest { compiler } => {
|
|
|
|
vec![self.libstd(compiler)]
|
2015-11-19 17:20:12 -06:00
|
|
|
}
|
2016-03-11 19:30:16 -06:00
|
|
|
Source::Libstd { compiler } => {
|
2015-11-19 17:20:12 -06:00
|
|
|
vec![self.compiler_rt(()),
|
|
|
|
self.rustc(compiler.stage).target(compiler.host)]
|
|
|
|
}
|
2016-03-11 19:30:16 -06:00
|
|
|
Source::LibrustcLink { compiler, host } => {
|
|
|
|
vec![self.librustc(compiler),
|
rustbuild: Fix dist for non-host targets
The `rust-std` package that we produce is expected to have not only the standard
library but also libtest for compiling unit tests. Unfortunately this does not
currently happen due to the way rustbuild is structured.
There are currently two main stages of compilation in rustbuild, one for the
standard library and one for the compiler. This is primarily done to allow us to
fill in the sysroot right after the standard library has finished compiling to
continue compiling the rest of the crates. Consequently the entire compiler does
not have to explicitly depend on the standard library, and this also should
allow us to pull in crates.io dependencies into the build in the future because
they'll just naturally build against the std we just produced.
These phases, however, do not represent a cross-compiled build. Target-only
builds also require libtest, and libtest is currently part of the
all-encompassing "compiler build". There's unfortunately no way to learn about
just libtest and its dependencies (in a great and robust fashion) so to ensure
that we can copy the right artifacts over this commit introduces a new build
step, libtest.
The new libtest build step has documentation, dist, and link steps as std/rustc
already do. The compiler now depends on libtest instead of libstd, and all
compiler crates can now assume that test and its dependencies are implicitly
part of the sysroot (hence explicit dependencies being removed). This makes the
build a tad less parallel as in theory many rustc crates can be compiled in
parallel with libtest, but this likely isn't where we really need parallelism
either (all the time is still spent in the compiler).
All in all this allows the `dist-std` step to depend on both libstd and libtest,
so `rust-std` packages produced by rustbuild should start having both the
standard library and libtest.
Closes #32523
2016-03-28 00:28:10 -05:00
|
|
|
self.libtest_link(compiler, host)]
|
|
|
|
}
|
|
|
|
Source::LibtestLink { compiler, host } => {
|
|
|
|
vec![self.libtest(compiler), self.libstd_link(compiler, host)]
|
2016-02-25 01:50:32 -06:00
|
|
|
}
|
2016-03-11 19:30:16 -06:00
|
|
|
Source::LibstdLink { compiler, host } => {
|
|
|
|
vec![self.libstd(compiler),
|
|
|
|
self.target(host).rustc(compiler.stage)]
|
2016-02-25 01:50:32 -06:00
|
|
|
}
|
2015-11-19 17:20:12 -06:00
|
|
|
Source::CompilerRt { _dummy } => {
|
|
|
|
vec![self.llvm(()).target(&build.config.build)]
|
|
|
|
}
|
|
|
|
Source::Llvm { _dummy } => Vec::new(),
|
2016-04-05 13:34:23 -05:00
|
|
|
Source::TestHelpers { _dummy } => Vec::new(),
|
|
|
|
Source::DebuggerScripts { stage: _ } => Vec::new(),
|
2016-04-05 12:01:31 -05:00
|
|
|
|
|
|
|
// Note that all doc targets depend on artifacts from the build
|
|
|
|
// architecture, not the target (which is where we're generating
|
|
|
|
// docs into).
|
2016-03-08 00:36:21 -06:00
|
|
|
Source::DocStd { stage } => {
|
2016-04-05 12:01:31 -05:00
|
|
|
let compiler = self.target(&build.config.build).compiler(stage);
|
|
|
|
vec![self.libstd(compiler)]
|
2016-03-08 00:36:21 -06:00
|
|
|
}
|
rustbuild: Fix dist for non-host targets
The `rust-std` package that we produce is expected to have not only the standard
library but also libtest for compiling unit tests. Unfortunately this does not
currently happen due to the way rustbuild is structured.
There are currently two main stages of compilation in rustbuild, one for the
standard library and one for the compiler. This is primarily done to allow us to
fill in the sysroot right after the standard library has finished compiling to
continue compiling the rest of the crates. Consequently the entire compiler does
not have to explicitly depend on the standard library, and this also should
allow us to pull in crates.io dependencies into the build in the future because
they'll just naturally build against the std we just produced.
These phases, however, do not represent a cross-compiled build. Target-only
builds also require libtest, and libtest is currently part of the
all-encompassing "compiler build". There's unfortunately no way to learn about
just libtest and its dependencies (in a great and robust fashion) so to ensure
that we can copy the right artifacts over this commit introduces a new build
step, libtest.
The new libtest build step has documentation, dist, and link steps as std/rustc
already do. The compiler now depends on libtest instead of libstd, and all
compiler crates can now assume that test and its dependencies are implicitly
part of the sysroot (hence explicit dependencies being removed). This makes the
build a tad less parallel as in theory many rustc crates can be compiled in
parallel with libtest, but this likely isn't where we really need parallelism
either (all the time is still spent in the compiler).
All in all this allows the `dist-std` step to depend on both libstd and libtest,
so `rust-std` packages produced by rustbuild should start having both the
standard library and libtest.
Closes #32523
2016-03-28 00:28:10 -05:00
|
|
|
Source::DocTest { stage } => {
|
2016-04-05 12:01:31 -05:00
|
|
|
let compiler = self.target(&build.config.build).compiler(stage);
|
|
|
|
vec![self.libtest(compiler)]
|
rustbuild: Fix dist for non-host targets
The `rust-std` package that we produce is expected to have not only the standard
library but also libtest for compiling unit tests. Unfortunately this does not
currently happen due to the way rustbuild is structured.
There are currently two main stages of compilation in rustbuild, one for the
standard library and one for the compiler. This is primarily done to allow us to
fill in the sysroot right after the standard library has finished compiling to
continue compiling the rest of the crates. Consequently the entire compiler does
not have to explicitly depend on the standard library, and this also should
allow us to pull in crates.io dependencies into the build in the future because
they'll just naturally build against the std we just produced.
These phases, however, do not represent a cross-compiled build. Target-only
builds also require libtest, and libtest is currently part of the
all-encompassing "compiler build". There's unfortunately no way to learn about
just libtest and its dependencies (in a great and robust fashion) so to ensure
that we can copy the right artifacts over this commit introduces a new build
step, libtest.
The new libtest build step has documentation, dist, and link steps as std/rustc
already do. The compiler now depends on libtest instead of libstd, and all
compiler crates can now assume that test and its dependencies are implicitly
part of the sysroot (hence explicit dependencies being removed). This makes the
build a tad less parallel as in theory many rustc crates can be compiled in
parallel with libtest, but this likely isn't where we really need parallelism
either (all the time is still spent in the compiler).
All in all this allows the `dist-std` step to depend on both libstd and libtest,
so `rust-std` packages produced by rustbuild should start having both the
standard library and libtest.
Closes #32523
2016-03-28 00:28:10 -05:00
|
|
|
}
|
2016-02-16 12:26:43 -06:00
|
|
|
Source::DocBook { stage } |
|
|
|
|
Source::DocNomicon { stage } |
|
2016-03-08 00:32:37 -06:00
|
|
|
Source::DocStyle { stage } => {
|
2016-04-05 12:01:31 -05:00
|
|
|
vec![self.target(&build.config.build).tool_rustbook(stage)]
|
2016-03-08 00:32:37 -06:00
|
|
|
}
|
2016-03-08 15:42:32 -06:00
|
|
|
Source::DocErrorIndex { stage } => {
|
2016-04-05 12:01:31 -05:00
|
|
|
vec![self.target(&build.config.build).tool_error_index(stage)]
|
2016-03-08 15:42:32 -06:00
|
|
|
}
|
2016-02-16 12:26:43 -06:00
|
|
|
Source::DocStandalone { stage } => {
|
2016-04-05 12:01:31 -05:00
|
|
|
vec![self.target(&build.config.build).rustc(stage)]
|
2016-02-16 12:26:43 -06:00
|
|
|
}
|
2016-03-08 00:36:21 -06:00
|
|
|
Source::DocRustc { stage } => {
|
rustbuild: Fix dist for non-host targets
The `rust-std` package that we produce is expected to have not only the standard
library but also libtest for compiling unit tests. Unfortunately this does not
currently happen due to the way rustbuild is structured.
There are currently two main stages of compilation in rustbuild, one for the
standard library and one for the compiler. This is primarily done to allow us to
fill in the sysroot right after the standard library has finished compiling to
continue compiling the rest of the crates. Consequently the entire compiler does
not have to explicitly depend on the standard library, and this also should
allow us to pull in crates.io dependencies into the build in the future because
they'll just naturally build against the std we just produced.
These phases, however, do not represent a cross-compiled build. Target-only
builds also require libtest, and libtest is currently part of the
all-encompassing "compiler build". There's unfortunately no way to learn about
just libtest and its dependencies (in a great and robust fashion) so to ensure
that we can copy the right artifacts over this commit introduces a new build
step, libtest.
The new libtest build step has documentation, dist, and link steps as std/rustc
already do. The compiler now depends on libtest instead of libstd, and all
compiler crates can now assume that test and its dependencies are implicitly
part of the sysroot (hence explicit dependencies being removed). This makes the
build a tad less parallel as in theory many rustc crates can be compiled in
parallel with libtest, but this likely isn't where we really need parallelism
either (all the time is still spent in the compiler).
All in all this allows the `dist-std` step to depend on both libstd and libtest,
so `rust-std` packages produced by rustbuild should start having both the
standard library and libtest.
Closes #32523
2016-03-28 00:28:10 -05:00
|
|
|
vec![self.doc_test(stage)]
|
2016-03-08 00:36:21 -06:00
|
|
|
}
|
2016-02-16 12:26:43 -06:00
|
|
|
Source::Doc { stage } => {
|
|
|
|
vec![self.doc_book(stage), self.doc_nomicon(stage),
|
2016-03-08 00:36:21 -06:00
|
|
|
self.doc_style(stage), self.doc_standalone(stage),
|
2016-03-08 15:42:32 -06:00
|
|
|
self.doc_std(stage),
|
|
|
|
self.doc_error_index(stage)]
|
2016-02-16 12:26:43 -06:00
|
|
|
}
|
2016-04-05 13:34:23 -05:00
|
|
|
Source::Check { stage, compiler } => {
|
|
|
|
vec![
|
|
|
|
self.check_rpass(compiler),
|
|
|
|
self.check_cfail(compiler),
|
|
|
|
self.check_rfail(compiler),
|
|
|
|
self.check_pfail(compiler),
|
2016-05-13 17:20:30 -05:00
|
|
|
self.check_incremental(compiler),
|
|
|
|
self.check_ui(compiler),
|
2016-04-29 16:23:15 -05:00
|
|
|
self.check_crate_std(compiler),
|
|
|
|
self.check_crate_test(compiler),
|
|
|
|
self.check_crate_rustc(compiler),
|
2016-04-05 13:34:23 -05:00
|
|
|
self.check_codegen(compiler),
|
|
|
|
self.check_codegen_units(compiler),
|
|
|
|
self.check_debuginfo(compiler),
|
|
|
|
self.check_rustdoc(compiler),
|
|
|
|
self.check_pretty(compiler),
|
|
|
|
self.check_rpass_valgrind(compiler),
|
|
|
|
self.check_rpass_full(compiler),
|
|
|
|
self.check_cfail_full(compiler),
|
2016-04-14 20:00:35 -05:00
|
|
|
self.check_error_index(compiler),
|
|
|
|
self.check_docs(compiler),
|
2016-04-14 17:51:03 -05:00
|
|
|
self.check_rmake(compiler),
|
2016-04-05 13:34:23 -05:00
|
|
|
self.check_linkcheck(stage),
|
2016-04-14 20:00:35 -05:00
|
|
|
self.check_tidy(stage),
|
2016-04-05 13:34:23 -05:00
|
|
|
self.dist(stage),
|
|
|
|
]
|
2016-03-08 01:15:55 -06:00
|
|
|
}
|
|
|
|
Source::CheckLinkcheck { stage } => {
|
|
|
|
vec![self.tool_linkchecker(stage), self.doc(stage)]
|
|
|
|
}
|
2016-03-18 15:54:31 -05:00
|
|
|
Source::CheckCargoTest { stage } => {
|
2016-04-14 16:27:51 -05:00
|
|
|
vec![self.tool_cargotest(stage),
|
|
|
|
self.librustc(self.compiler(stage))]
|
2016-03-18 15:54:31 -05:00
|
|
|
}
|
2016-03-29 15:14:52 -05:00
|
|
|
Source::CheckTidy { stage } => {
|
|
|
|
vec![self.tool_tidy(stage)]
|
|
|
|
}
|
2016-04-05 13:34:23 -05:00
|
|
|
Source::CheckRFail { compiler } |
|
|
|
|
Source::CheckPFail { compiler } |
|
|
|
|
Source::CheckCodegen { compiler } |
|
|
|
|
Source::CheckCodegenUnits { compiler } |
|
2016-05-13 08:50:30 -05:00
|
|
|
Source::CheckIncremental { compiler } |
|
|
|
|
Source::CheckUi { compiler } |
|
2016-04-05 13:34:23 -05:00
|
|
|
Source::CheckRustdoc { compiler } |
|
|
|
|
Source::CheckPretty { compiler } |
|
|
|
|
Source::CheckCFail { compiler } |
|
|
|
|
Source::CheckRPassValgrind { compiler } |
|
|
|
|
Source::CheckRPass { compiler } => {
|
|
|
|
vec![
|
|
|
|
self.libtest(compiler),
|
|
|
|
self.tool_compiletest(compiler.stage),
|
|
|
|
self.test_helpers(()),
|
|
|
|
]
|
|
|
|
}
|
|
|
|
Source::CheckDebuginfo { compiler } => {
|
|
|
|
vec![
|
|
|
|
self.libtest(compiler),
|
|
|
|
self.tool_compiletest(compiler.stage),
|
|
|
|
self.test_helpers(()),
|
|
|
|
self.debugger_scripts(compiler.stage),
|
|
|
|
]
|
|
|
|
}
|
|
|
|
Source::CheckRPassFull { compiler } |
|
2016-04-14 17:51:03 -05:00
|
|
|
Source::CheckCFailFull { compiler } |
|
|
|
|
Source::CheckRMake { compiler } => {
|
2016-04-05 13:34:23 -05:00
|
|
|
vec![self.librustc(compiler),
|
|
|
|
self.tool_compiletest(compiler.stage)]
|
|
|
|
}
|
2016-04-14 20:00:35 -05:00
|
|
|
Source::CheckDocs { compiler } => {
|
|
|
|
vec![self.libstd(compiler)]
|
|
|
|
}
|
|
|
|
Source::CheckErrorIndex { compiler } => {
|
|
|
|
vec![self.libstd(compiler), self.tool_error_index(compiler.stage)]
|
|
|
|
}
|
2016-04-29 16:23:15 -05:00
|
|
|
Source::CheckCrateStd { compiler } => {
|
|
|
|
vec![self.libtest(compiler)]
|
|
|
|
}
|
|
|
|
Source::CheckCrateTest { compiler } => {
|
|
|
|
vec![self.libtest(compiler)]
|
|
|
|
}
|
|
|
|
Source::CheckCrateRustc { compiler } => {
|
|
|
|
vec![self.libtest(compiler)]
|
|
|
|
}
|
2016-03-08 01:15:55 -06:00
|
|
|
|
2016-03-29 15:14:52 -05:00
|
|
|
Source::ToolLinkchecker { stage } |
|
2016-04-05 13:18:24 -05:00
|
|
|
Source::ToolTidy { stage } => {
|
2016-03-11 19:30:16 -06:00
|
|
|
vec![self.libstd(self.compiler(stage))]
|
2016-03-08 01:15:55 -06:00
|
|
|
}
|
2016-03-08 15:42:32 -06:00
|
|
|
Source::ToolErrorIndex { stage } |
|
2016-03-08 00:32:37 -06:00
|
|
|
Source::ToolRustbook { stage } => {
|
2016-03-11 19:30:16 -06:00
|
|
|
vec![self.librustc(self.compiler(stage))]
|
2016-03-08 00:34:13 -06:00
|
|
|
}
|
2016-03-18 15:54:31 -05:00
|
|
|
Source::ToolCargoTest { stage } => {
|
2016-04-14 16:27:51 -05:00
|
|
|
vec![self.libstd(self.compiler(stage))]
|
2016-03-18 15:54:31 -05:00
|
|
|
}
|
2016-04-05 13:34:23 -05:00
|
|
|
Source::ToolCompiletest { stage } => {
|
|
|
|
vec![self.libtest(self.compiler(stage))]
|
|
|
|
}
|
2016-03-13 18:52:19 -05:00
|
|
|
|
|
|
|
Source::DistDocs { stage } => vec![self.doc(stage)],
|
|
|
|
Source::DistMingw { _dummy: _ } => Vec::new(),
|
|
|
|
Source::DistRustc { stage } => {
|
|
|
|
vec![self.rustc(stage)]
|
|
|
|
}
|
|
|
|
Source::DistStd { compiler } => {
|
2016-04-15 15:51:50 -05:00
|
|
|
// We want to package up as many target libraries as possible
|
|
|
|
// for the `rust-std` package, so if this is a host target we
|
|
|
|
// depend on librustc and otherwise we just depend on libtest.
|
|
|
|
if build.config.host.iter().any(|t| t == self.target) {
|
|
|
|
vec![self.librustc(compiler)]
|
|
|
|
} else {
|
|
|
|
vec![self.libtest(compiler)]
|
|
|
|
}
|
2016-03-13 18:52:19 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
Source::Dist { stage } => {
|
|
|
|
let mut base = Vec::new();
|
|
|
|
|
|
|
|
for host in build.config.host.iter() {
|
|
|
|
let host = self.target(host);
|
|
|
|
base.push(host.dist_rustc(stage));
|
|
|
|
if host.target.contains("windows-gnu") {
|
|
|
|
base.push(host.dist_mingw(()));
|
|
|
|
}
|
|
|
|
|
|
|
|
let compiler = self.compiler(stage);
|
|
|
|
for target in build.config.target.iter() {
|
2016-04-05 12:01:31 -05:00
|
|
|
let target = self.target(target);
|
2016-04-03 23:09:19 -05:00
|
|
|
if build.config.docs {
|
|
|
|
base.push(target.dist_docs(stage));
|
|
|
|
}
|
2016-04-05 12:01:31 -05:00
|
|
|
base.push(target.dist_std(compiler));
|
2016-03-13 18:52:19 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return base
|
|
|
|
}
|
2015-11-19 17:20:12 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|