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/src/bootstrap/bin/rustdoc.rs (-1 / +12 lines)
Lines 23-32 use std::path::PathBuf; Link Here
23
fn main() {
23
fn main() {
24
    let args = env::args_os().skip(1).collect::<Vec<_>>();
24
    let args = env::args_os().skip(1).collect::<Vec<_>>();
25
    let rustdoc = env::var_os("RUSTDOC_REAL").expect("RUSTDOC_REAL was not set");
25
    let rustdoc = env::var_os("RUSTDOC_REAL").expect("RUSTDOC_REAL was not set");
26
    let libdir = env::var_os("RUSTC_LIBDIR").expect("RUSTC_LIBDIR was not set");
26
    let libdir = env::var_os("RUSTDOC_LIBDIR").expect("RUSTDOC_LIBDIR was not set");
27
    let stage = env::var("RUSTC_STAGE").expect("RUSTC_STAGE was not set");
27
    let stage = env::var("RUSTC_STAGE").expect("RUSTC_STAGE was not set");
28
    let sysroot = env::var_os("RUSTC_SYSROOT").expect("RUSTC_SYSROOT was not set");
28
    let sysroot = env::var_os("RUSTC_SYSROOT").expect("RUSTC_SYSROOT was not set");
29
29
30
    use std::str::FromStr;
31
32
    let verbose = match env::var("RUSTC_VERBOSE") {
33
        Ok(s) => usize::from_str(&s).expect("RUSTC_VERBOSE should be an integer"),
34
        Err(_) => 0,
35
    };
36
30
    let mut dylib_path = bootstrap::util::dylib_path();
37
    let mut dylib_path = bootstrap::util::dylib_path();
31
    dylib_path.insert(0, PathBuf::from(libdir));
38
    dylib_path.insert(0, PathBuf::from(libdir));
32
39
Lines 59-64 fn main() { Link Here
59
           .arg("--crate-version").arg(version);
66
           .arg("--crate-version").arg(version);
60
    }
67
    }
61
68
69
    if verbose > 1 {
70
        eprintln!("rustdoc command: {:?}", cmd);
71
    }
72
62
    std::process::exit(match cmd.status() {
73
    std::process::exit(match cmd.status() {
63
        Ok(s) => s.code().unwrap_or(1),
74
        Ok(s) => s.code().unwrap_or(1),
64
        Err(e) => panic!("\n\nfailed to run {:?}: {}\n\n", cmd, e),
75
        Err(e) => panic!("\n\nfailed to run {:?}: {}\n\n", cmd, e),
(-)a/src/bootstrap/builder.rs (-3 / +6 lines)
Lines 357-364 impl<'a> Builder<'a> { Link Here
357
357
358
            fn run(self, builder: &Builder) -> Interned<PathBuf> {
358
            fn run(self, builder: &Builder) -> Interned<PathBuf> {
359
                let compiler = self.compiler;
359
                let compiler = self.compiler;
360
                let lib = if compiler.stage >= 2 && builder.build.config.libdir_relative.is_some() {
360
                let lib = if compiler.stage >= 1 && builder.build.config.libdir.is_some() {
361
                    builder.build.config.libdir_relative.clone().unwrap()
361
                    builder.build.config.libdir.clone().unwrap()
362
                } else {
362
                } else {
363
                    PathBuf::from("lib")
363
                    PathBuf::from("lib")
364
                };
364
                };
Lines 416-422 impl<'a> Builder<'a> { Link Here
416
        let compiler = self.compiler(self.top_stage, host);
416
        let compiler = self.compiler(self.top_stage, host);
417
        cmd.env("RUSTC_STAGE", compiler.stage.to_string())
417
        cmd.env("RUSTC_STAGE", compiler.stage.to_string())
418
           .env("RUSTC_SYSROOT", self.sysroot(compiler))
418
           .env("RUSTC_SYSROOT", self.sysroot(compiler))
419
           .env("RUSTC_LIBDIR", self.sysroot_libdir(compiler, self.build.build))
419
           .env("RUSTDOC_LIBDIR", self.sysroot_libdir(compiler, self.build.build))
420
           .env("CFG_RELEASE_CHANNEL", &self.build.config.channel)
420
           .env("CFG_RELEASE_CHANNEL", &self.build.config.channel)
421
           .env("RUSTDOC_REAL", self.rustdoc(host))
421
           .env("RUSTDOC_REAL", self.rustdoc(host))
422
           .env("RUSTDOC_CRATE_VERSION", self.build.rust_version())
422
           .env("RUSTDOC_CRATE_VERSION", self.build.rust_version())
Lines 496-501 impl<'a> Builder<'a> { Link Here
496
        if let Some(target_linker) = self.build.linker(target) {
496
        if let Some(target_linker) = self.build.linker(target) {
497
            cargo.env("RUSTC_TARGET_LINKER", target_linker);
497
            cargo.env("RUSTC_TARGET_LINKER", target_linker);
498
        }
498
        }
499
        if cmd != "build" {
500
            cargo.env("RUSTDOC_LIBDIR", self.rustc_libdir(self.compiler(2, self.build.build)));
501
        }
499
502
500
        if mode != Mode::Tool {
503
        if mode != Mode::Tool {
501
            // Tools don't get debuginfo right now, e.g. cargo and rls don't
504
            // Tools don't get debuginfo right now, e.g. cargo and rls don't
(-)a/src/bootstrap/check.rs (-1 / +1 lines)
Lines 1171-1177 impl Step for Crate { Link Here
1171
            }
1171
            }
1172
            Mode::Librustc => {
1172
            Mode::Librustc => {
1173
                builder.ensure(compile::Rustc { compiler, target });
1173
                builder.ensure(compile::Rustc { compiler, target });
1174
                compile::rustc_cargo(build, &compiler, target, &mut cargo);
1174
                compile::rustc_cargo(build, target, &mut cargo);
1175
                ("librustc", "rustc-main")
1175
                ("librustc", "rustc-main")
1176
            }
1176
            }
1177
            _ => panic!("can only test libraries"),
1177
            _ => panic!("can only test libraries"),
(-)a/src/bootstrap/compile.rs (-9 / +4 lines)
Lines 485-491 impl Step for Rustc { Link Here
485
        build.clear_if_dirty(&stage_out, &libtest_stamp(build, compiler, target));
485
        build.clear_if_dirty(&stage_out, &libtest_stamp(build, compiler, target));
486
486
487
        let mut cargo = builder.cargo(compiler, Mode::Librustc, target, "build");
487
        let mut cargo = builder.cargo(compiler, Mode::Librustc, target, "build");
488
        rustc_cargo(build, &compiler, target, &mut cargo);
488
        rustc_cargo(build, target, &mut cargo);
489
        run_cargo(build,
489
        run_cargo(build,
490
                  &mut cargo,
490
                  &mut cargo,
491
                  &librustc_stamp(build, compiler, target));
491
                  &librustc_stamp(build, compiler, target));
Lines 500-506 impl Step for Rustc { Link Here
500
500
501
/// Same as `std_cargo`, but for libtest
501
/// Same as `std_cargo`, but for libtest
502
pub fn rustc_cargo(build: &Build,
502
pub fn rustc_cargo(build: &Build,
503
                   compiler: &Compiler,
504
                   target: Interned<String>,
503
                   target: Interned<String>,
505
                   cargo: &mut Command) {
504
                   cargo: &mut Command) {
506
    cargo.arg("--features").arg(build.rustc_features())
505
    cargo.arg("--features").arg(build.rustc_features())
Lines 514-526 pub fn rustc_cargo(build: &Build, Link Here
514
         .env("CFG_VERSION", build.rust_version())
513
         .env("CFG_VERSION", build.rust_version())
515
         .env("CFG_PREFIX", build.config.prefix.clone().unwrap_or_default());
514
         .env("CFG_PREFIX", build.config.prefix.clone().unwrap_or_default());
516
515
517
    if compiler.stage == 0 {
516
    let libdir_relative =
518
        cargo.env("CFG_LIBDIR_RELATIVE", "lib");
517
        build.config.libdir.clone().unwrap_or(PathBuf::from("lib"));
519
    } else {
518
    cargo.env("CFG_LIBDIR_RELATIVE", libdir_relative);
520
        let libdir_relative =
521
            build.config.libdir_relative.clone().unwrap_or(PathBuf::from("lib"));
522
        cargo.env("CFG_LIBDIR_RELATIVE", libdir_relative);
523
    }
524
519
525
    // If we're not building a compiler with debugging information then remove
520
    // If we're not building a compiler with debugging information then remove
526
    // these two env vars which would be set otherwise.
521
    // these two env vars which would be set otherwise.
(-)a/src/bootstrap/config.rs (-1 lines)
Lines 119-125 pub struct Config { Link Here
119
    pub docdir: Option<PathBuf>,
119
    pub docdir: Option<PathBuf>,
120
    pub bindir: Option<PathBuf>,
120
    pub bindir: Option<PathBuf>,
121
    pub libdir: Option<PathBuf>,
121
    pub libdir: Option<PathBuf>,
122
    pub libdir_relative: Option<PathBuf>,
123
    pub mandir: Option<PathBuf>,
122
    pub mandir: Option<PathBuf>,
124
    pub codegen_tests: bool,
123
    pub codegen_tests: bool,
125
    pub nodejs: Option<PathBuf>,
124
    pub nodejs: Option<PathBuf>,
(-)a/src/bootstrap/doc.rs (-2 / +1 lines)
Lines 616-622 impl Step for Rustc { Link Here
616
        t!(symlink_dir_force(&my_out, &out_dir));
616
        t!(symlink_dir_force(&my_out, &out_dir));
617
617
618
        let mut cargo = builder.cargo(compiler, Mode::Librustc, target, "doc");
618
        let mut cargo = builder.cargo(compiler, Mode::Librustc, target, "doc");
619
        compile::rustc_cargo(build, &compiler, target, &mut cargo);
619
        compile::rustc_cargo(build, target, &mut cargo);
620
620
621
        if build.config.compiler_docs {
621
        if build.config.compiler_docs {
622
            // src/rustc/Cargo.toml contains a bin crate called rustc which
622
            // src/rustc/Cargo.toml contains a bin crate called rustc which
623
- 

Return to bug 647912