Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 647912 | Differences between
and this patch

Collapse All | Expand All

(-)a/config.toml.example (+4 lines)
Lines 152-157 Link Here
152
# default.
152
# default.
153
#extended = false
153
#extended = false
154
154
155
# Installs choosen set of extended tools if enables. By default builds all.
156
# If choosen tool failed to build the installation fails.
157
#tools = ["cargo", "rls", "rustfmt", "analysis", "src"]
158
155
# Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose
159
# Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose
156
#verbose = 0
160
#verbose = 0
157
161
(-)a/src/bootstrap/config.rs (-1 / +4 lines)
Lines 13-19 Link Here
13
//! This module implements parsing `config.toml` configuration files to tweak
13
//! This module implements parsing `config.toml` configuration files to tweak
14
//! how the build runs.
14
//! how the build runs.
15
15
16
use std::collections::HashMap;
16
use std::collections::{HashMap, HashSet};
17
use std::env;
17
use std::env;
18
use std::fs::File;
18
use std::fs::File;
19
use std::io::prelude::*;
19
use std::io::prelude::*;
Lines 53-58 pub struct Config { Link Here
53
    pub target_config: HashMap<Interned<String>, Target>,
53
    pub target_config: HashMap<Interned<String>, Target>,
54
    pub full_bootstrap: bool,
54
    pub full_bootstrap: bool,
55
    pub extended: bool,
55
    pub extended: bool,
56
    pub tools: Option<HashSet<String>>,
56
    pub sanitizers: bool,
57
    pub sanitizers: bool,
57
    pub profiler: bool,
58
    pub profiler: bool,
58
    pub ignore_git: bool,
59
    pub ignore_git: bool,
Lines 188-193 struct Build { Link Here
188
    python: Option<String>,
189
    python: Option<String>,
189
    full_bootstrap: Option<bool>,
190
    full_bootstrap: Option<bool>,
190
    extended: Option<bool>,
191
    extended: Option<bool>,
192
    tools: Option<HashSet<String>>,
191
    verbose: Option<usize>,
193
    verbose: Option<usize>,
192
    sanitizers: Option<bool>,
194
    sanitizers: Option<bool>,
193
    profiler: Option<bool>,
195
    profiler: Option<bool>,
Lines 398-403 impl Config { Link Here
398
        set(&mut config.vendor, build.vendor);
400
        set(&mut config.vendor, build.vendor);
399
        set(&mut config.full_bootstrap, build.full_bootstrap);
401
        set(&mut config.full_bootstrap, build.full_bootstrap);
400
        set(&mut config.extended, build.extended);
402
        set(&mut config.extended, build.extended);
403
        config.tools = build.tools;
401
        set(&mut config.verbose, build.verbose);
404
        set(&mut config.verbose, build.verbose);
402
        set(&mut config.sanitizers, build.sanitizers);
405
        set(&mut config.sanitizers, build.sanitizers);
403
        set(&mut config.profiler, build.profiler);
406
        set(&mut config.profiler, build.profiler);
(-)a/src/bootstrap/configure.py (+1 lines)
Lines 135-140 o("jemalloc", "rust.use-jemalloc", "build liballoc with jemalloc") Link Here
135
o("full-bootstrap", "build.full-bootstrap", "build three compilers instead of two")
135
o("full-bootstrap", "build.full-bootstrap", "build three compilers instead of two")
136
o("extended", "build.extended", "build an extended rust tool set")
136
o("extended", "build.extended", "build an extended rust tool set")
137
137
138
v("tools", "build.tools", "List of extended tools will be installed")
138
v("build", "build.build", "GNUs ./configure syntax LLVM build triple")
139
v("build", "build.build", "GNUs ./configure syntax LLVM build triple")
139
v("host", None, "GNUs ./configure syntax LLVM host triples")
140
v("host", None, "GNUs ./configure syntax LLVM host triples")
140
v("target", None, "GNUs ./configure syntax LLVM target triples")
141
v("target", None, "GNUs ./configure syntax LLVM target triples")
(-)a/src/bootstrap/install.rs (-8 / +23 lines)
Lines 22-27 use dist::{self, pkgname, sanitize_sh, tmpdir}; Link Here
22
22
23
use builder::{Builder, RunConfig, ShouldRun, Step};
23
use builder::{Builder, RunConfig, ShouldRun, Step};
24
use cache::Interned;
24
use cache::Interned;
25
use config::Config;
25
26
26
pub fn install_docs(builder: &Builder, stage: u32, host: Interned<String>) {
27
pub fn install_docs(builder: &Builder, stage: u32, host: Interned<String>) {
27
    install_sh(builder, "docs", "rust-docs", stage, Some(host));
28
    install_sh(builder, "docs", "rust-docs", stage, Some(host));
Lines 144-149 macro_rules! install { Link Here
144
            pub host: Interned<String>,
145
            pub host: Interned<String>,
145
        }
146
        }
146
147
148
        impl $name {
149
            #[allow(dead_code)]
150
            fn should_build(config: &Config) -> bool {
151
                config.extended && config.tools.as_ref()
152
                    .map_or(true, |t| t.contains($path))
153
            }
154
155
            #[allow(dead_code)]
156
            fn should_install(builder: &Builder) -> bool {
157
                builder.config.tools.as_ref().map_or(false, |t| t.contains($path))
158
            }
159
        }
160
147
        impl Step for $name {
161
        impl Step for $name {
148
            type Output = ();
162
            type Output = ();
149
            const DEFAULT: bool = true;
163
            const DEFAULT: bool = true;
Lines 185-216 install!((self, builder, _config), Link Here
185
            install_std(builder, self.stage, *target);
199
            install_std(builder, self.stage, *target);
186
        }
200
        }
187
    };
201
    };
188
    Cargo, "cargo", _config.extended, only_hosts: true, {
202
    Cargo, "cargo", Self::should_build(_config), only_hosts: true, {
189
        builder.ensure(dist::Cargo { stage: self.stage, target: self.target });
203
        builder.ensure(dist::Cargo { stage: self.stage, target: self.target });
190
        install_cargo(builder, self.stage, self.target);
204
        install_cargo(builder, self.stage, self.target);
191
    };
205
    };
192
    Rls, "rls", _config.extended, only_hosts: true, {
206
    Rls, "rls", Self::should_build(_config), only_hosts: true, {
193
        if builder.ensure(dist::Rls { stage: self.stage, target: self.target }).is_some() {
207
        if builder.ensure(dist::Rls { stage: self.stage, target: self.target }).is_some() ||
208
            Self::should_install(builder) {
194
            install_rls(builder, self.stage, self.target);
209
            install_rls(builder, self.stage, self.target);
195
        } else {
210
        } else {
196
            println!("skipping Install RLS stage{} ({})", self.stage, self.target);
211
            println!("skipping Install RLS stage{} ({})", self.stage, self.target);
197
        }
212
        }
198
    };
213
    };
199
    Rustfmt, "rustfmt", _config.extended, only_hosts: true, {
214
    Rustfmt, "rustfmt", Self::should_build(_config), only_hosts: true, {
200
        if builder.ensure(dist::Rustfmt { stage: self.stage, target: self.target }).is_some() {
215
        if builder.ensure(dist::Rustfmt { stage: self.stage, target: self.target }).is_some() ||
216
            Self::should_install(builder) {
201
            install_rustfmt(builder, self.stage, self.target);
217
            install_rustfmt(builder, self.stage, self.target);
202
        } else {
218
        } else {
203
            println!("skipping Install Rustfmt stage{} ({})", self.stage, self.target);
219
            println!("skipping Install Rustfmt stage{} ({})", self.stage, self.target);
204
        }
220
        }
205
    };
221
    };
206
    Analysis, "analysis", _config.extended, only_hosts: false, {
222
    Analysis, "analysis", Self::should_build(_config), only_hosts: false, {
207
        builder.ensure(dist::Analysis {
223
        builder.ensure(dist::Analysis {
208
            compiler: builder.compiler(self.stage, self.host),
224
            compiler: builder.compiler(self.stage, self.host),
209
            target: self.target
225
            target: self.target
210
        });
226
        });
211
        install_analysis(builder, self.stage, self.target);
227
        install_analysis(builder, self.stage, self.target);
212
    };
228
    };
213
    Src, "src", _config.extended, only_hosts: true, {
229
    Src, "src", Self::should_build(_config) , only_hosts: true, {
214
        builder.ensure(dist::Src);
230
        builder.ensure(dist::Src);
215
        install_src(builder, self.stage);
231
        install_src(builder, self.stage);
216
    }, ONLY_BUILD;
232
    }, ONLY_BUILD;
217
- 

Return to bug 647912